From 47402efd64a325e2d8926491e32a5f07f3537dcb Mon Sep 17 00:00:00 2001 From: andrei Date: Wed, 3 Nov 2021 10:16:57 -0400 Subject: [PATCH] changed theme --- lib/box_checker.dart | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/box_checker.dart b/lib/box_checker.dart index 8dfcf48..980c883 100644 --- a/lib/box_checker.dart +++ b/lib/box_checker.dart @@ -14,7 +14,13 @@ class BoxChecker extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', - theme: ThemeData(brightness: Brightness.dark), + theme: ThemeData.from(colorScheme: ColorScheme.dark()).copyWith( + canvasColor: Colors.black, + shadowColor: Colors.blueGrey, + colorScheme: ColorScheme.fromSwatch( + primarySwatch: Colors.blue, + ), + ), themeMode: ThemeMode.dark, home: const MainListPage(title: 'BoxChecker'), ); @@ -31,13 +37,15 @@ class MainListPage extends StatefulWidget { class _MainListPageState extends State { int _selectedPage = data.Page.lists.index; - List lists = [data.List(100, "test")]; + List lists = []; void _loadData(data.Page listType) async { lists.clear(); var res = await DBHelper.dbHelper.getAllLists(listType); setState(() { - for (var row in res) lists.add(data.List.fromMap(row)); + for (var row in res) { + lists.add(data.List.fromMap(row)); + } }); } @@ -62,7 +70,7 @@ class _MainListPageState extends State { MaterialPageRoute( builder: (context) => AddForm(type: data.Page.values[_selectedPage]))); - }, // TODO Implement add button + }, tooltip: 'Add List', child: const Icon(Icons.add), ), @@ -72,9 +80,10 @@ class _MainListPageState extends State { return ListTile( title: Text(lists[index].name), subtitle: Text(lists[index].id.toString()), - ); // TODO Implement tile rendering + ); }), bottomNavigationBar: BottomNavigationBar( + elevation: 4, currentIndex: _selectedPage, onTap: (index) { setState(() {