Add a dark theme.
This commit is contained in:
parent
0f65166123
commit
631555af59
@ -25,6 +25,12 @@ class MainApp extends StatelessWidget {
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
|
||||
),
|
||||
darkTheme: ThemeData(
|
||||
useMaterial3: true,
|
||||
brightness: Brightness.dark,
|
||||
colorSchemeSeed: Colors.green,
|
||||
),
|
||||
themeMode: ThemeMode.system,
|
||||
home: HomePage(),
|
||||
);
|
||||
}
|
||||
|
@ -23,9 +23,12 @@ class _ExpensePageState extends State<ExpensePage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
|
||||
expenses.sort(
|
||||
(a, b) => (b.calcComparableCost() - a.calcComparableCost()).toInt(),
|
||||
);
|
||||
|
||||
return expenses.isEmpty
|
||||
? Text("Add expenses to get started!")
|
||||
: ListView.builder(
|
||||
@ -53,7 +56,7 @@ class _ExpensePageState extends State<ExpensePage> {
|
||||
),
|
||||
),
|
||||
secondaryBackground: Container(
|
||||
color: Colors.yellow,
|
||||
color: Colors.orange,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
@ -90,7 +93,7 @@ class _ExpensePageState extends State<ExpensePage> {
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
color: Colors.greenAccent,
|
||||
color: theme.colorScheme.onPrimary,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
@ -184,9 +187,10 @@ class _ExpenseInputDialogState extends State<ExpenseInputDialog> {
|
||||
),
|
||||
AlertDialog(
|
||||
insetPadding: EdgeInsets.all(0),
|
||||
title: widget.expense == null
|
||||
? Text("New Expense")
|
||||
: Text("Edit Expense"),
|
||||
title: Center(
|
||||
child: widget.expense == null
|
||||
? Text("New Expense")
|
||||
: Text("Edit Expense")),
|
||||
content: Form(
|
||||
key: _expenseFormKey,
|
||||
child: Column(
|
||||
|
Loading…
x
Reference in New Issue
Block a user