nouvelle transaction: fond dynamique vert/rouge + titre gras centré
This commit is contained in:
parent
bb3d4ebe2a
commit
d140548e5f
34
lib/app.dart
34
lib/app.dart
|
|
@ -60,19 +60,43 @@ class _YnabAppState extends ConsumerState<YnabApp> {
|
|||
DateTime date = DateTime.now();
|
||||
bool isExpense = true;
|
||||
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
await showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
useSafeArea: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
builder: (ctx) => StatefulBuilder(
|
||||
builder: (context, setSheetState) => Padding(
|
||||
builder: (context, setSheetState) => Container(
|
||||
decoration: BoxDecoration(
|
||||
color: isExpense ? colorScheme.errorContainer : colorScheme.primaryContainer,
|
||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(20)),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(24, 0, 24, MediaQuery.of(context).viewInsets.bottom + 24),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const SizedBox(height: 8),
|
||||
Text('Nouvelle transaction', style: Theme.of(context).textTheme.titleLarge),
|
||||
const SizedBox(height: 12),
|
||||
Center(
|
||||
child: Container(
|
||||
width: 32,
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
color: colorScheme.onSurfaceVariant.withAlpha(80),
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'Nouvelle transaction',
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
TextField(
|
||||
controller: payeeCtrl,
|
||||
|
|
@ -127,13 +151,15 @@ class _YnabAppState extends ConsumerState<YnabApp> {
|
|||
},
|
||||
child: const Text('Ajouter'),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
void _toggleSearch() {
|
||||
setState(() {
|
||||
_searchActive = !_searchActive;
|
||||
|
|
|
|||
|
|
@ -109,7 +109,6 @@ final ThemeData ynabTheme = ThemeData(
|
|||
),
|
||||
bottomSheetTheme: const BottomSheetThemeData(
|
||||
backgroundColor: kSurfaceCard,
|
||||
showDragHandle: true,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue