Skip to content

Commit 1e975a7

Browse files
chore(authenticator): remove navigator from tree for AuthenticatedState (#2354)
chore: remove navigator from tree for AuthenticatedState
1 parent 5d009b6 commit 1e975a7

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

packages/amplify_authenticator/lib/amplify_authenticator.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -759,21 +759,20 @@ class _AuthenticatorBody extends StatelessWidget {
759759
return _AuthStateBuilder(
760760
child: child,
761761
builder: (state, child) {
762+
if (state is AuthenticatedState) return child;
762763
return Navigator(
763764
onPopPage: (_, dynamic __) => true,
764765
pages: [
765-
if (state is AuthenticatedState) MaterialPage<void>(child: child),
766-
if (state is! AuthenticatedState)
767-
MaterialPage<void>(
768-
child: ScaffoldMessenger(
769-
key: _AuthenticatorState.scaffoldMessengerKey,
770-
child: Scaffold(
771-
body: SizedBox.expand(
772-
child: child,
773-
),
766+
MaterialPage<void>(
767+
child: ScaffoldMessenger(
768+
key: _AuthenticatorState.scaffoldMessengerKey,
769+
child: Scaffold(
770+
body: SizedBox.expand(
771+
child: child,
774772
),
775773
),
776774
),
775+
),
777776
],
778777
);
779778
},

0 commit comments

Comments
 (0)