fix color
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
2025-08-15 15:24:51 -05:00
parent b5d5e63486
commit 5326b3b81f

View File

@@ -27,10 +27,9 @@ class _MountWidgetState extends State<MountWidget> {
child: Consumer<Mount>(
builder: (context, Mount mount, _) {
final textColor = Theme.of(context).colorScheme.onSurface;
final subTextColor =
Theme.of(context).brightness == Brightness.dark
? Colors.white38
: Colors.black87;
final subTextColor = Theme.of(context).brightness == Brightness.dark
? Colors.white38
: Colors.black87;
final nameText = SelectableText(
formatMountName(mount.type, mount.name),
@@ -41,8 +40,8 @@ class _MountWidgetState extends State<MountWidget> {
isThreeLine: true,
leading: IconButton(
icon: Icon(Icons.settings, color: textColor),
onPressed:
() => Navigator.pushNamed(context, '/edit', arguments: mount),
onPressed: () =>
Navigator.pushNamed(context, '/edit', arguments: mount),
),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -95,17 +94,15 @@ class _MountWidgetState extends State<MountWidget> {
: mount.mounted!
? Icons.toggle_on
: Icons.toggle_off,
color:
mount.mounted ?? false
? Color.fromARGB(255, 163, 96, 76)
: subTextColor,
color: mount.mounted ?? false
? Theme.of(context).colorScheme.primary
: subTextColor,
),
tooltip:
mount.mounted == null
? ''
: mount.mounted!
? 'Unmount'
: 'Mount',
tooltip: mount.mounted == null
? ''
: mount.mounted!
? 'Unmount'
: 'Mount',
onPressed: _createMountHandler(context, mount),
),
],
@@ -119,43 +116,43 @@ class _MountWidgetState extends State<MountWidget> {
VoidCallback? _createMountHandler(context, Mount mount) {
return _enabled && mount.mounted != null
? () async {
if (mount.mounted == null) {
return;
}
if (mount.mounted == null) {
return;
}
final mounted = mount.mounted!;
final mounted = mount.mounted!;
setState(() {
_enabled = false;
});
final location = await _getMountLocation(context, mount);
cleanup() {
setState(() {
_enabled = true;
_enabled = false;
});
}
if (!mounted && location == null) {
displayErrorMessage(context, "Mount location is not set");
return cleanup();
}
final location = await _getMountLocation(context, mount);
final success = await mount.mount(mounted, location: location);
if (success ||
mounted ||
constants.navigatorKey.currentContext == null ||
!constants.navigatorKey.currentContext!.mounted) {
return cleanup();
}
cleanup() {
setState(() {
_enabled = true;
});
}
displayErrorMessage(
context,
"Mount location is not available: $location",
);
cleanup();
}
if (!mounted && location == null) {
displayErrorMessage(context, "Mount location is not set");
return cleanup();
}
final success = await mount.mount(mounted, location: location);
if (success ||
mounted ||
constants.navigatorKey.currentContext == null ||
!constants.navigatorKey.currentContext!.mounted) {
return cleanup();
}
displayErrorMessage(
context,
"Mount location is not available: $location",
);
cleanup();
}
: null;
}