Initial flow for home settings

This commit is contained in:
OmarHatem 2023-06-20 19:32:55 +03:00
parent 459c397559
commit 4b35ad3b21
4 changed files with 23 additions and 8 deletions

View file

@ -247,7 +247,9 @@ Future setup({
nodeSource: _nodeSource,
isBitcoinBuyEnabled: isBitcoinBuyEnabled,
// Enforce darkTheme on platforms other than mobile till the design for other themes is completed
initialTheme: ResponsiveLayoutUtil.instance.isMobile && DeviceInfo.instance.isMobile ? null : ThemeList.darkTheme,
initialTheme: ResponsiveLayoutUtil.instance.isMobile && DeviceInfo.instance.isMobile
? null
: ThemeList.darkTheme,
);
if (_isSetupFinished) {
@ -879,7 +881,7 @@ Future setup({
getIt.registerFactory(() => IoniaGiftCardsListViewModel(ioniaService: getIt.get<IoniaService>()));
getIt.registerFactory(()=> MarketPlaceViewModel(getIt.get<IoniaService>()));
getIt.registerFactory(() => MarketPlaceViewModel(getIt.get<IoniaService>()));
getIt.registerFactory(() => IoniaAuthViewModel(ioniaService: getIt.get<IoniaService>()));
@ -1013,5 +1015,8 @@ Future setup({
getIt.registerFactoryParam<AdvancedPrivacySettingsViewModel, WalletType, void>(
(type, _) => AdvancedPrivacySettingsViewModel(type, getIt.get<SettingsStore>()));
getIt.registerFactory<HomeSettingsPage>(
() => AdvancedPrivacySettingsViewModel(type, getIt.get<SettingsStore>()));
_isSetupFinished = true;
}

View file

@ -582,6 +582,9 @@ Route<dynamic> createRoute(RouteSettings settings) {
case Routes.modify2FAPage:
return MaterialPageRoute<void>(builder: (_) => getIt.get<Modify2FAPage>());
case Routes.homeSettings:
return CupertinoPageRoute<void>(builder: (_) => getIt.get<HomeSettingsPage>());
default:
return MaterialPageRoute<void>(
builder: (_) => Scaffold(

View file

@ -88,4 +88,5 @@ class Routes {
static const setup_2faQRPage = '/setup_2fa_qr_page';
static const totpAuthCodePage = '/totp_auth_code_page';
static const modify2FAPage = '/modify_2fa_page';
static const homeSettings = '/home_settings';
}

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:flutter/material.dart';
@ -47,12 +48,17 @@ class BalancePage extends StatelessWidget {
textAlign: TextAlign.center,
),
if (dashboardViewModel.balanceViewModel.isHomeScreenSettingsEnabled)
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/home_screen_settings_icon.png',
color:
Theme.of(context).accentTextTheme.displayMedium!.backgroundColor!,
InkWell(
onTap: () {
Navigator.pushNamed(context, Routes.homeSettings)
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/home_screen_settings_icon.png',
color:
Theme.of(context).accentTextTheme.displayMedium!.backgroundColor!,
),
),
),
],