Skip to content

Commit 7585a79

Browse files
committed
fix: redirect to sign up page on failed creation
1 parent 7b855ed commit 7585a79

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

kitchenowl/lib/pages/signup_page.dart

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'package:kitchenowl/cubits/auth_cubit.dart';
88
import 'package:kitchenowl/cubits/server_info_cubit.dart';
99
import 'package:kitchenowl/helpers/url_launcher.dart';
1010
import 'package:kitchenowl/kitchenowl.dart';
11+
import 'package:kitchenowl/router.dart';
1112
import 'package:kitchenowl/styles/color_mapper.dart';
1213
import 'package:kitchenowl/widgets/create_user_form_fields.dart';
1314
import 'package:responsive_builder/responsive_builder.dart';
@@ -186,13 +187,17 @@ class _SignupPageState extends State<SignupPage> {
186187
name: nameController.text,
187188
email: emailController.text,
188189
password: passwordController.text,
189-
wrongCredentialsCallback: (msg) => showSnackbar(
190-
context: context,
191-
content: Text(
192-
_extractErrorMessage(context, msg),
193-
),
194-
width: null,
195-
),
190+
wrongCredentialsCallback: (msg) {
191+
showSnackbar(
192+
context: context,
193+
content: Text(
194+
_extractErrorMessage(context, msg),
195+
),
196+
width: null,
197+
);
198+
Future.delayed(
199+
Duration(milliseconds: 1), () => router.go("/register"));
200+
},
196201
);
197202
}
198203
}

0 commit comments

Comments
 (0)