This commit is contained in:
@@ -21,7 +21,7 @@ const logonWidth = 300.0;
|
|||||||
const outlineAlpha = 0.15;
|
const outlineAlpha = 0.15;
|
||||||
const padding = 16.0;
|
const padding = 16.0;
|
||||||
const paddingSmall = padding / 2.0;
|
const paddingSmall = padding / 2.0;
|
||||||
const primaryAlpha = 0.25;
|
const primaryAlpha = 0.20;
|
||||||
const boxShadowAlpha = 0.20;
|
const boxShadowAlpha = 0.20;
|
||||||
const primarySurfaceAlpha = 92.0;
|
const primarySurfaceAlpha = 92.0;
|
||||||
const protocolTypeList = ['http', 'https'];
|
const protocolTypeList = ['http', 'https'];
|
||||||
|
@@ -50,145 +50,101 @@ class _MountWidgetState extends State<MountWidget>
|
|||||||
width: 1,
|
width: 1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Stack(
|
child: Padding(
|
||||||
children: [
|
padding: const EdgeInsets.all(constants.padding),
|
||||||
Positioned.fill(
|
child: Consumer<Mount>(
|
||||||
child: Container(
|
builder: (context, Mount mount, _) {
|
||||||
decoration: BoxDecoration(
|
return Column(
|
||||||
borderRadius: BorderRadius.circular(
|
mainAxisSize: MainAxisSize.min,
|
||||||
constants.borderRadiusSmall,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
),
|
children: [
|
||||||
gradient: const LinearGradient(
|
Row(
|
||||||
begin: Alignment.topCenter,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: constants.gradientColors2,
|
|
||||||
),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.black.withValues(
|
|
||||||
alpha: constants.boxShadowAlpha,
|
|
||||||
),
|
|
||||||
blurRadius: constants.borderRadiusSmall,
|
|
||||||
offset: const Offset(0, constants.borderRadiusSmall),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(constants.padding),
|
|
||||||
child: Consumer<Mount>(
|
|
||||||
builder: (context, Mount mount, _) {
|
|
||||||
return Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Row(
|
AppIconButtonFramed(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
icon: Icons.settings,
|
||||||
children: [
|
onTap: () {
|
||||||
AppIconButtonFramed(
|
Navigator.pushNamed(
|
||||||
icon: Icons.settings,
|
context,
|
||||||
onTap: () {
|
'/edit',
|
||||||
Navigator.pushNamed(
|
arguments: mount,
|
||||||
context,
|
);
|
||||||
'/edit',
|
},
|
||||||
arguments: mount,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(width: constants.padding),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
SelectableText(
|
|
||||||
mount.provider,
|
|
||||||
style: titleStyle,
|
|
||||||
),
|
|
||||||
SelectableText(
|
|
||||||
'Name • ${formatMountName(mount.type, mount.name)}',
|
|
||||||
style: subStyle,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
AppToggleButtonFramed(
|
|
||||||
mounted: mount.mounted,
|
|
||||||
onPressed: _createMountHandler(context, mount),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: constants.padding),
|
const SizedBox(width: constants.padding),
|
||||||
Row(
|
Expanded(
|
||||||
children: [
|
child: Column(
|
||||||
_EditPathButton(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
enabled: mount.mounted == false,
|
children: [
|
||||||
onPressed: () async {
|
SelectableText(mount.provider, style: titleStyle),
|
||||||
if (!_editEnabled) {
|
SelectableText(
|
||||||
return;
|
'Name • ${formatMountName(mount.type, mount.name)}',
|
||||||
}
|
|
||||||
setState(() {
|
|
||||||
_editEnabled = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
final available = await mount
|
|
||||||
.getAvailableLocations();
|
|
||||||
|
|
||||||
if (!mounted) {
|
|
||||||
setState(() {
|
|
||||||
_editEnabled = true;
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!context.mounted) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final location = await editMountLocation(
|
|
||||||
context,
|
|
||||||
available,
|
|
||||||
location: mount.path,
|
|
||||||
);
|
|
||||||
if (location != null) {
|
|
||||||
await mount.setMountLocation(location);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mounted) {
|
|
||||||
setState(() {
|
|
||||||
_editEnabled = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(width: constants.padding),
|
|
||||||
Expanded(
|
|
||||||
child: SelectableText(
|
|
||||||
_prettyPath(mount),
|
|
||||||
style: subStyle,
|
style: subStyle,
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
|
),
|
||||||
|
AppToggleButtonFramed(
|
||||||
|
mounted: mount.mounted,
|
||||||
|
onPressed: _createMountHandler(context, mount),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
),
|
||||||
},
|
const SizedBox(height: constants.padding),
|
||||||
),
|
Row(
|
||||||
),
|
children: [
|
||||||
Positioned(
|
_EditPathButton(
|
||||||
left: constants.padding,
|
enabled: mount.mounted == false,
|
||||||
right: constants.padding,
|
onPressed: () async {
|
||||||
bottom: constants.padding - 1,
|
if (!_editEnabled) {
|
||||||
child: Container(
|
return;
|
||||||
height: 1,
|
}
|
||||||
decoration: BoxDecoration(
|
setState(() {
|
||||||
color: Theme.of(context).colorScheme.outlineVariant
|
_editEnabled = false;
|
||||||
.withValues(alpha: constants.outlineAlpha),
|
});
|
||||||
borderRadius: BorderRadius.circular(1),
|
|
||||||
),
|
final available = await mount.getAvailableLocations();
|
||||||
),
|
|
||||||
),
|
if (!mounted) {
|
||||||
],
|
setState(() {
|
||||||
|
_editEnabled = true;
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!context.mounted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final location = await editMountLocation(
|
||||||
|
context,
|
||||||
|
available,
|
||||||
|
location: mount.path,
|
||||||
|
);
|
||||||
|
if (location != null) {
|
||||||
|
await mount.setMountLocation(location);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mounted) {
|
||||||
|
setState(() {
|
||||||
|
_editEnabled = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(width: constants.padding),
|
||||||
|
Expanded(
|
||||||
|
child: SelectableText(
|
||||||
|
_prettyPath(mount),
|
||||||
|
style: subStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user