Skip to content

Commit

Permalink
remove empty route now that ensureInitialized()
Browse files Browse the repository at this point in the history
  • Loading branch information
qcasey committed Jan 13, 2022
1 parent 60f28ec commit 527642f
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ class _PaperlessShareState extends State<PaperlessShare> {
ChangeNotifierProvider<AuthModel>.value(value: _auth),
],
child: Consumer<AuthModel>(builder: (context, model, child) {
var initialRoute = '/';
if (model?.user != null) {
if (model?.user.isValid())
initialRoute = '/share';
else
initialRoute = '/login';
}

return MaterialApp(
title: 'Paperless Share',
theme: ThemeData(
Expand All @@ -78,9 +70,8 @@ class _PaperlessShareState extends State<PaperlessShare> {
brightness: Brightness.dark,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
initialRoute: initialRoute,
initialRoute: model?.user.isValid() ? '/share' : '/login',
routes: {
'/': (context) => new Container(),
'/login': (context) => new LoginPage(),
'/share': (context) => new SharePage(),
},
Expand Down

0 comments on commit 527642f

Please sign in to comment.