mirror of
https://github.com/Iconica-Development/flutter_registration.git
synced 2025-05-19 05:23:43 +02:00
feat: Added the ability to decide to go back to the first page
This commit is contained in:
parent
a9380b0eb7
commit
f8ecce95a0
2 changed files with 6 additions and 3 deletions
|
@ -20,7 +20,7 @@ class RegistrationOptions {
|
|||
|
||||
final RegistrationTranslations registrationTranslations;
|
||||
final List<AuthStep> registrationSteps;
|
||||
final void Function(String error)? onError;
|
||||
final bool? Function(String error)? onError;
|
||||
final VoidCallback afterRegistration;
|
||||
final RegistrationRepository registrationRepository;
|
||||
final AppBar Function(String title)? customAppbarBuilder;
|
||||
|
|
|
@ -27,8 +27,11 @@ class RegistrationScreen extends StatelessWidget {
|
|||
if (registered == null) {
|
||||
registrationOptions.afterRegistration();
|
||||
} else {
|
||||
registrationOptions.onError?.call(registered);
|
||||
onError();
|
||||
var returnToFirstPage = registrationOptions.onError?.call(registered);
|
||||
|
||||
if (returnToFirstPage ?? true) {
|
||||
onError();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
onError();
|
||||
|
|
Loading…
Reference in a new issue