Skip to content

Commit

Permalink
Making callback navigation nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
ernest-deriv committed Apr 23, 2024
1 parent 898e244 commit c976cfe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class SettingPageModel {
required this.endpoint,
required this.saveValues,
required this.updateFlavorConfigs,
required this.settingsPageNavigation,
this.settingsPageNavigation,
});

/// Setting page App label
Expand All @@ -29,5 +29,5 @@ class SettingPageModel {
updateFlavorConfigs;

/// Settings page navigation
final Function(BuildContext context) settingsPageNavigation;
final Function(BuildContext context)? settingsPageNavigation;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ class GetStartedPage extends StatelessWidget {
),
),
onTapNavigation:
AuthData().data.settingPageModel.settingsPageNavigation,
AuthData().data.settingPageModel.settingsPageNavigation ??
(BuildContext context) {
Navigator.push(
context,
MaterialPageRoute<Widget>(
builder: (BuildContext context) => const SettingsPage(),
),
);
},
);
}

0 comments on commit c976cfe

Please sign in to comment.