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();
|
DateTime date = DateTime.now();
|
||||||
bool isExpense = true;
|
bool isExpense = true;
|
||||||
|
|
||||||
|
final colorScheme = Theme.of(context).colorScheme;
|
||||||
await showModalBottomSheet(
|
await showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
builder: (ctx) => StatefulBuilder(
|
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),
|
padding: EdgeInsets.fromLTRB(24, 0, 24, MediaQuery.of(context).viewInsets.bottom + 24),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 12),
|
||||||
Text('Nouvelle transaction', style: Theme.of(context).textTheme.titleLarge),
|
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),
|
const SizedBox(height: 20),
|
||||||
TextField(
|
TextField(
|
||||||
controller: payeeCtrl,
|
controller: payeeCtrl,
|
||||||
|
|
@ -127,13 +151,15 @@ class _YnabAppState extends ConsumerState<YnabApp> {
|
||||||
},
|
},
|
||||||
child: const Text('Ajouter'),
|
child: const Text('Ajouter'),
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
void _toggleSearch() {
|
void _toggleSearch() {
|
||||||
setState(() {
|
setState(() {
|
||||||
_searchActive = !_searchActive;
|
_searchActive = !_searchActive;
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,6 @@ final ThemeData ynabTheme = ThemeData(
|
||||||
),
|
),
|
||||||
bottomSheetTheme: const BottomSheetThemeData(
|
bottomSheetTheme: const BottomSheetThemeData(
|
||||||
backgroundColor: kSurfaceCard,
|
backgroundColor: kSurfaceCard,
|
||||||
showDragHandle: true,
|
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue