This commit is contained in:
@@ -21,7 +21,7 @@ const logonWidth = 300.0;
|
||||
const outlineAlpha = 0.15;
|
||||
const padding = 16.0;
|
||||
const paddingSmall = padding / 2.0;
|
||||
const primaryAlpha = 0.25;
|
||||
const primaryAlpha = 0.20;
|
||||
const boxShadowAlpha = 0.20;
|
||||
const primarySurfaceAlpha = 92.0;
|
||||
const protocolTypeList = ['http', 'https'];
|
||||
|
@@ -50,145 +50,101 @@ class _MountWidgetState extends State<MountWidget>
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(
|
||||
constants.borderRadiusSmall,
|
||||
),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
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,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(constants.padding),
|
||||
child: Consumer<Mount>(
|
||||
builder: (context, Mount mount, _) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
AppIconButtonFramed(
|
||||
icon: Icons.settings,
|
||||
onTap: () {
|
||||
Navigator.pushNamed(
|
||||
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),
|
||||
),
|
||||
],
|
||||
AppIconButtonFramed(
|
||||
icon: Icons.settings,
|
||||
onTap: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
'/edit',
|
||||
arguments: mount,
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: constants.padding),
|
||||
Row(
|
||||
children: [
|
||||
_EditPathButton(
|
||||
enabled: mount.mounted == false,
|
||||
onPressed: () async {
|
||||
if (!_editEnabled) {
|
||||
return;
|
||||
}
|
||||
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),
|
||||
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),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: constants.padding,
|
||||
right: constants.padding,
|
||||
bottom: constants.padding - 1,
|
||||
child: Container(
|
||||
height: 1,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.outlineVariant
|
||||
.withValues(alpha: constants.outlineAlpha),
|
||||
borderRadius: BorderRadius.circular(1),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: constants.padding),
|
||||
Row(
|
||||
children: [
|
||||
_EditPathButton(
|
||||
enabled: mount.mounted == false,
|
||||
onPressed: () async {
|
||||
if (!_editEnabled) {
|
||||
return;
|
||||
}
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
Reference in New Issue
Block a user