use callback instead of global key

This commit is contained in:
dane madsen
2023-11-03 22:27:29 +10:00
parent 7fa801bc27
commit e64f9a7e11
5 changed files with 24 additions and 19 deletions

View File

@@ -3,7 +3,6 @@ import 'package:maid/config/theme.dart';
import 'package:maid/pages/home_page.dart';
final maidAppKey = GlobalKey<MaidAppState>();
final homePageKey = GlobalKey<MaidHomePageState>();
void main() {
runApp(MaidApp(key: maidAppKey));
@@ -38,7 +37,7 @@ class MaidAppState extends State<MaidApp> {
debugShowCheckedModeBanner: false,
title: 'Maid',
theme: MaidTheme.theme,
home: MaidHomePage(key: homePageKey, title: 'Maid'),
home: const MaidHomePage(title: 'Maid'),
);
}
}