Compare commits
3 Commits
96df3168fc
...
43280b2913
Author | SHA1 | Date | |
---|---|---|---|
43280b2913 | |||
788aefdf86 | |||
3453bd0b50 |
@ -17,7 +17,7 @@ class MyApp extends StatelessWidget {
|
|||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
title: constants.app_title,
|
title: constants.app_title,
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.orange),
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
|
||||||
),
|
),
|
||||||
home: const MyHomePage(title: constants.app_title),
|
home: const MyHomePage(title: constants.app_title),
|
||||||
);
|
);
|
||||||
|
@ -20,23 +20,42 @@ class _MountWidgetState extends State<MountWidget> {
|
|||||||
return Card(
|
return Card(
|
||||||
child: Consumer<Mount>(
|
child: Consumer<Mount>(
|
||||||
builder: (context, mount, widget) {
|
builder: (context, mount, widget) {
|
||||||
final isThreeLine = mount.state == Icons.toggle_on;
|
final textColor = Colors.blue;
|
||||||
|
final subTextColor = Colors.black;
|
||||||
|
|
||||||
|
final isActive = mount.state == Icons.toggle_on;
|
||||||
|
final nameText = Text(
|
||||||
|
formatMountName(mount.type, mount.name),
|
||||||
|
style: TextStyle(color: subTextColor),
|
||||||
|
);
|
||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
isThreeLine: isThreeLine,
|
isThreeLine: isActive,
|
||||||
leading: const Icon(Icons.settings),
|
leading: IconButton(
|
||||||
|
icon: Icon(Icons.settings, color: textColor),
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
subtitle:
|
subtitle:
|
||||||
isThreeLine
|
isActive
|
||||||
? Column(
|
? Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(formatMountName(mount.type, mount.name)),
|
nameText,
|
||||||
Text(mount.path),
|
Text(mount.path, style: TextStyle(color: subTextColor)),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: Text(formatMountName(mount.type, mount.name)),
|
: nameText,
|
||||||
title: Text(initialCaps(mount.type)),
|
title: Text(
|
||||||
trailing: Icon(mount.state),
|
initialCaps(mount.type),
|
||||||
|
style: TextStyle(color: textColor, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
trailing: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
mount.state,
|
||||||
|
color: isActive ? Colors.blue : Colors.grey,
|
||||||
|
),
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user