Skip to content

Commit 582235c

Browse files
authored
fix: back button in add account screen terminates app (#62)
* fix: back button in add account screen terminates app * fix: successful adding account will navigate home * refactor: formatted dart files
1 parent ecca4b5 commit 582235c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/screens/configurations_screen.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ class _ConfigurationsScreenState extends State<ConfigurationsScreen> {
5656
Preferences.saveLogin(apis);
5757
}
5858

59+
if (apis.length > 1) {
60+
Navigator.pop(context);
61+
}
62+
5963
Navigator.pushReplacement(
6064
//Navigate to Home Screen
6165
context,
@@ -121,6 +125,9 @@ class _ConfigurationsScreenState extends State<ConfigurationsScreen> {
121125
passwordFocus.unfocus();
122126
},
123127
child: Scaffold(
128+
appBar: AppBar(
129+
elevation: 0,
130+
),
124131
body: SingleChildScrollView(
125132
child: Column(
126133
children: <Widget>[

lib/screens/main_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class _MainScreenState extends State<MainScreen> {
128128
leading: Icon(Icons.add),
129129
title: Text('Add another account'),
130130
onTap: () {
131-
Navigator.pushReplacement(
131+
Navigator.push(
132132
context,
133133
MaterialPageRoute(
134134
builder: (context) => ConfigurationsScreen(),

0 commit comments

Comments
 (0)