budget: category icons, bigger font, larger gaps; cards: no border, r=20
This commit is contained in:
parent
5a0ca683dc
commit
6b0edf870b
|
|
@ -80,7 +80,7 @@ class _CategoryGroupTile extends ConsumerWidget {
|
||||||
),
|
),
|
||||||
if (expanded)
|
if (expanded)
|
||||||
...cats.map((c) => _CategoryRow(categoryId: c.id)),
|
...cats.map((c) => _CategoryRow(categoryId: c.id)),
|
||||||
const Divider(height: 16),
|
const Divider(height: 32),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -149,7 +149,7 @@ class _CategoryRow extends ConsumerWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(left: 8, bottom: 4),
|
padding: const EdgeInsets.only(left: 8, bottom: 12),
|
||||||
child: Card(
|
child: Card(
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|
@ -161,7 +161,12 @@ class _CategoryRow extends ConsumerWidget {
|
||||||
dense: true,
|
dense: true,
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
title: Text(category.name, style: Theme.of(context).textTheme.bodyMedium),
|
leading: Icon(
|
||||||
|
categoryIcon(category.icon),
|
||||||
|
size: 22,
|
||||||
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
title: Text(category.name, style: Theme.of(context).textTheme.titleMedium?.copyWith(fontWeight: FontWeight.w600)),
|
||||||
trailing: Text(
|
trailing: Text(
|
||||||
formatCurrency(remaining),
|
formatCurrency(remaining),
|
||||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||||
|
|
@ -215,3 +220,21 @@ class _ExpandedGroupNotifier extends StateNotifier<bool> {
|
||||||
final _expandedGroupProvider =
|
final _expandedGroupProvider =
|
||||||
StateNotifierProvider.family<_ExpandedGroupNotifier, bool, int>(
|
StateNotifierProvider.family<_ExpandedGroupNotifier, bool, int>(
|
||||||
(ref, id) => _ExpandedGroupNotifier());
|
(ref, id) => _ExpandedGroupNotifier());
|
||||||
|
|
||||||
|
IconData categoryIcon(String? name) {
|
||||||
|
switch (name) {
|
||||||
|
case 'home': return Icons.home;
|
||||||
|
case 'bolt': return Icons.bolt;
|
||||||
|
case 'water_drop': return Icons.water_drop;
|
||||||
|
case 'shield': return Icons.shield;
|
||||||
|
case 'shopping_cart': return Icons.shopping_cart;
|
||||||
|
case 'restaurant': return Icons.restaurant;
|
||||||
|
case 'local_gas_station': return Icons.local_gas_station;
|
||||||
|
case 'directions_bus': return Icons.directions_bus;
|
||||||
|
case 'tv': return Icons.tv;
|
||||||
|
case 'celebration': return Icons.celebration;
|
||||||
|
case 'savings': return Icons.savings;
|
||||||
|
case 'flight': return Icons.flight;
|
||||||
|
default: return Icons.category;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,9 @@ final ThemeData ynabTheme = ThemeData(
|
||||||
scaffoldBackgroundColor: kSurfaceBg,
|
scaffoldBackgroundColor: kSurfaceBg,
|
||||||
cardTheme: CardThemeData(
|
cardTheme: CardThemeData(
|
||||||
color: kSurfaceCard,
|
color: kSurfaceCard,
|
||||||
elevation: 0, // M3 utilise plutôt les tonalités et outline qu'une grosse élévation
|
elevation: 0,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(20),
|
||||||
side: BorderSide(color: kDivider, width: 1),
|
|
||||||
),
|
),
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
),
|
),
|
||||||
|
|
@ -136,8 +135,7 @@ final ThemeData ynabDarkTheme = ThemeData(
|
||||||
cardTheme: CardThemeData(
|
cardTheme: CardThemeData(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(20),
|
||||||
side: const BorderSide(color: Color(0xFF43493E), width: 1),
|
|
||||||
),
|
),
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue