diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id new file mode 100644 index 00000000..0c913ed6 --- /dev/null +++ b/ios/Flutter/.last_build_id @@ -0,0 +1 @@ +4dc2ef1ba73deeed13cd85894dacb10b \ No newline at end of file diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index a3b83428..fae18ebc 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -354,7 +354,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -493,7 +493,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -526,7 +526,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( diff --git a/lib/entities/fs_migration.dart b/lib/entities/fs_migration.dart index 1d3ae8d4..2cdc2495 100644 --- a/lib/entities/fs_migration.dart +++ b/lib/entities/fs_migration.dart @@ -29,7 +29,8 @@ Future migrate_android_v1() async { await android_migrate_wallets(appDocDir: appDocDir); } -Future ios_migrate_v1(Box walletInfoSource, Box tradeSource, Box contactSource) async { +Future ios_migrate_v1(Box walletInfoSource, + Box tradeSource, Box contactSource) async { final prefs = await SharedPreferences.getInstance(); if (prefs.getBool('ios_migration_v1_completed') ?? false) { @@ -137,6 +138,11 @@ Future ios_migrate_wallet_passwords() async { final walletsDir = Directory('${appDocDir.path}/wallets'); final moneroWalletsDir = Directory('${walletsDir.path}/monero'); + if (!moneroWalletsDir.existsSync() || moneroWalletsDir.listSync().isEmpty) { + await prefs.setBool('ios_migration_wallet_passwords_completed', true); + return; + } + moneroWalletsDir.listSync().forEach((item) async { try { if (item is Directory) { @@ -385,7 +391,7 @@ Future ios_migrate_trades_list(Box tradeSource) async { Future ios_migrate_address_book(Box contactSource) async { final prefs = await SharedPreferences.getInstance(); - + if (prefs.getBool('ios_migration_address_book_completed') ?? false) { return; } diff --git a/lib/router.dart b/lib/router.dart index 1c579c70..986544be 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -58,7 +58,7 @@ class Router { return CupertinoPageRoute( builder: (_) => getIt.get( param1: (BuildContext context, dynamic _) => - Navigator.pushNamed(context, Routes.newWalletType)), + Navigator.pushNamed(context, Routes.newWallet)), fullscreenDialog: true); case Routes.newWalletType: @@ -128,7 +128,7 @@ class Router { return CupertinoPageRoute( builder: (_) => getIt.get( param1: (BuildContext context, dynamic _) => - Navigator.pushNamed(context, Routes.restoreWalletType)), + Navigator.pushNamed(context, Routes.restoreWalletOptions)), fullscreenDialog: true); case Routes.seed: diff --git a/lib/src/screens/welcome/welcome_page.dart b/lib/src/screens/welcome/welcome_page.dart index aa0d5b80..b777e99a 100644 --- a/lib/src/screens/welcome/welcome_page.dart +++ b/lib/src/screens/welcome/welcome_page.dart @@ -14,118 +14,178 @@ class WelcomePage extends BasePage { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme + .of(context) + .backgroundColor, resizeToAvoidBottomPadding: false, body: SafeArea(child: body(context))); } @override Widget body(BuildContext context) { - final welcomeImage = getIt.get().isDarkTheme + final welcomeImage = getIt + .get() + .isDarkTheme ? welcomeImageDark : welcomeImageLight; final newWalletImage = Image.asset('assets/images/new_wallet.png', height: 12, width: 12, - color: Theme.of(context).accentTextTheme.headline.decorationColor); + color: Theme + .of(context) + .accentTextTheme + .headline + .decorationColor); final restoreWalletImage = Image.asset('assets/images/restore_wallet.png', height: 12, width: 12, - color: Theme.of(context).primaryTextTheme.title.color); + color: Theme + .of(context) + .primaryTextTheme + .title + .color); - return Container( - padding: EdgeInsets.all(24), - child: Column( - children: [ - Flexible( - flex: 2, - child: AspectRatio( - aspectRatio: aspectRatioImage, - child: FittedBox(child: welcomeImage, fit: BoxFit.fill) - ) - ), - Flexible( - flex: 3, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( + return WillPopScope(onWillPop: () async =>, child: Container( + padding: EdgeInsets.all(24), + child: Column( + children: [ + Flexible( + flex: 2, + child: AspectRatio( + aspectRatio: aspectRatioImage, + child: FittedBox(child: welcomeImage, fit: BoxFit.fill) + ) + ), + Flexible( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Padding( - padding: EdgeInsets.only(top: 24), - child: Text( - S.of(context).welcome, - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.w500, - color: Theme.of(context).accentTextTheme.display3.color, + Column( + children: [ + Padding( + padding: EdgeInsets.only(top: 24), + child: Text( + S + .of(context) + .welcome, + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w500, + color: Theme + .of(context) + .accentTextTheme + .display3 + .color, + ), + textAlign: TextAlign.center, + ), ), - textAlign: TextAlign.center, - ), - ), - Padding( - padding: EdgeInsets.only(top: 5), - child: Text( - S.of(context).cake_wallet, - style: TextStyle( - fontSize: 36, - fontWeight: FontWeight.bold, - color: Theme.of(context).primaryTextTheme.title.color, + Padding( + padding: EdgeInsets.only(top: 5), + child: Text( + S + .of(context) + .cake_wallet, + style: TextStyle( + fontSize: 36, + fontWeight: FontWeight.bold, + color: Theme + .of(context) + .primaryTextTheme + .title + .color, + ), + textAlign: TextAlign.center, + ), ), - textAlign: TextAlign.center, - ), - ), - Padding( - padding: EdgeInsets.only(top: 5), - child: Text( - S.of(context).first_wallet_text, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - color: Theme.of(context).accentTextTheme.display3.color, + Padding( + padding: EdgeInsets.only(top: 5), + child: Text( + S + .of(context) + .first_wallet_text, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Theme + .of(context) + .accentTextTheme + .display3 + .color, + ), + textAlign: TextAlign.center, + ), ), - textAlign: TextAlign.center, - ), - ), - ], - ), - Column( - children: [ - Text( - S.of(context).please_make_selection, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.normal, - color: Theme.of(context).accentTextTheme.display3.color, - ), - textAlign: TextAlign.center, - ), - Padding( - padding: EdgeInsets.only(top: 24), - child: PrimaryImageButton( - onPressed: () => Navigator.pushNamed(context, Routes.newWallet), - image: newWalletImage, - text: S.of(context).create_new, - color: Theme.of(context).accentTextTheme.subtitle.decorationColor, - textColor: Theme.of(context).accentTextTheme.headline.decorationColor, - ), + ], ), - Padding( - padding: EdgeInsets.only(top: 10), - child: PrimaryImageButton( - onPressed: () => Navigator.pushNamed(context, Routes.restoreWalletOptions), - image: restoreWalletImage, - text: S.of(context).restore_wallet, - color: Theme.of(context).accentTextTheme.caption.color, - textColor: Theme.of(context).primaryTextTheme.title.color), + Column( + children: [ + Text( + S + .of(context) + .please_make_selection, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.normal, + color: Theme + .of(context) + .accentTextTheme + .display3 + .color, + ), + textAlign: TextAlign.center, + ), + Padding( + padding: EdgeInsets.only(top: 24), + child: PrimaryImageButton( + onPressed: () => + Navigator.pushNamed(context, + Routes.newWalletFromWelcome), + image: newWalletImage, + text: S + .of(context) + .create_new, + color: Theme + .of(context) + .accentTextTheme + .subtitle + .decorationColor, + textColor: Theme + .of(context) + .accentTextTheme + .headline + .decorationColor, + ), + ), + Padding( + padding: EdgeInsets.only(top: 10), + child: PrimaryImageButton( + onPressed: () => + Navigator.pushNamed(context, + Routes.restoreWalletOptionsFromWelcome), + image: restoreWalletImage, + text: S + .of(context) + .restore_wallet, + color: Theme + .of(context) + .accentTextTheme + .caption + .color, + textColor: Theme + .of(context) + .primaryTextTheme + .title + .color), + ) + ], ) ], ) - ], ) - ) - ], - ) - ); + ], + ) + )); } }