diff --git a/packages/deriv_auth/lib/features/get_started/presentation/layouts/deriv_get_started_layout.dart b/packages/deriv_auth/lib/features/get_started/presentation/layouts/deriv_get_started_layout.dart index 4543a1ce9..2924059d7 100644 --- a/packages/deriv_auth/lib/features/get_started/presentation/layouts/deriv_get_started_layout.dart +++ b/packages/deriv_auth/lib/features/get_started/presentation/layouts/deriv_get_started_layout.dart @@ -41,7 +41,7 @@ class DerivGetStartedLayout extends StatefulWidget { final VoidCallback onSignupTapped; /// Navigation to be called when screen is tapped seven times. - final VoidCallback onTapNavigation; + final Function(BuildContext context) onTapNavigation; @override State createState() => _DerivGetStartedLayoutState(); diff --git a/packages/deriv_auth/lib/features/single_entry/core/models/setting_page_model.dart b/packages/deriv_auth/lib/features/single_entry/core/models/setting_page_model.dart index d0e8083d0..3093a9857 100644 --- a/packages/deriv_auth/lib/features/single_entry/core/models/setting_page_model.dart +++ b/packages/deriv_auth/lib/features/single_entry/core/models/setting_page_model.dart @@ -1,3 +1,5 @@ +import 'package:flutter/material.dart'; + /// Setting page model class SettingPageModel { /// Constructor [SettingPageModel] @@ -7,6 +9,7 @@ class SettingPageModel { required this.endpoint, required this.saveValues, required this.updateFlavorConfigs, + this.settingsPageNavigation, }); /// Setting page App label @@ -24,4 +27,7 @@ class SettingPageModel { /// Update flavor configurations final Function({required String endpoint, required String appId}) updateFlavorConfigs; + + /// Settings page navigation + final Function(BuildContext context)? settingsPageNavigation; } diff --git a/packages/deriv_auth/lib/features/single_entry/features/get_started/pages/get_started_page.dart b/packages/deriv_auth/lib/features/single_entry/features/get_started/pages/get_started_page.dart index b09669843..c82f1d293 100644 --- a/packages/deriv_auth/lib/features/single_entry/features/get_started/pages/get_started_page.dart +++ b/packages/deriv_auth/lib/features/single_entry/features/get_started/pages/get_started_page.dart @@ -25,13 +25,15 @@ class GetStartedPage extends StatelessWidget { builder: (BuildContext context) => const SignupPage(), ), ), - onTapNavigation: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => const SettingsPage(), - ), - ); - }, + onTapNavigation: + AuthData().data.settingPageModel.settingsPageNavigation ?? + (BuildContext context) { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => const SettingsPage(), + ), + ); + }, ); } diff --git a/packages/deriv_auth/test/features/get_started/presentation/layouts/deriv_get_started_layout_test.dart b/packages/deriv_auth/test/features/get_started/presentation/layouts/deriv_get_started_layout_test.dart index 0f7c817e0..2f01f1bae 100644 --- a/packages/deriv_auth/test/features/get_started/presentation/layouts/deriv_get_started_layout_test.dart +++ b/packages/deriv_auth/test/features/get_started/presentation/layouts/deriv_get_started_layout_test.dart @@ -30,7 +30,7 @@ void main() { patrolWidgetTest('should render DerivGetStartedLayout', (PatrolTester $) async { await $.pumpApp(DerivGetStartedLayout( - onTapNavigation: () {}, + onTapNavigation: (context) {}, slides: [mockSlideModel], appLogoIconPath: appLogoIconPath, backgroundImagePath: backgroundImagePath, @@ -49,7 +49,7 @@ void main() { bool loginTapped = false; await $.pumpApp(DerivGetStartedLayout( - onTapNavigation: () {}, + onTapNavigation: (context) {}, slides: [mockSlideModel], appLogoIconPath: appLogoIconPath, backgroundImagePath: backgroundImagePath, @@ -69,7 +69,7 @@ void main() { bool signupTapped = false; await $.pumpApp(DerivGetStartedLayout( - onTapNavigation: () {}, + onTapNavigation: (context) {}, slides: [mockSlideModel], appLogoIconPath: appLogoIconPath, backgroundImagePath: backgroundImagePath,