This commit is contained in:
M 2020-10-12 11:47:20 +03:00
parent 9cb7e77a5e
commit 9a169254a6
5 changed files with 163 additions and 96 deletions

View file

@ -0,0 +1 @@
4dc2ef1ba73deeed13cd85894dacb10b

View file

@ -354,7 +354,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 7;
DEVELOPMENT_TEAM = 32J6BB6VUS; DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -493,7 +493,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 7;
DEVELOPMENT_TEAM = 32J6BB6VUS; DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -526,7 +526,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 7;
DEVELOPMENT_TEAM = 32J6BB6VUS; DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (

View file

@ -29,7 +29,8 @@ Future<void> migrate_android_v1() async {
await android_migrate_wallets(appDocDir: appDocDir); await android_migrate_wallets(appDocDir: appDocDir);
} }
Future<void> ios_migrate_v1(Box<WalletInfo> walletInfoSource, Box<Trade> tradeSource, Box<Contact> contactSource) async { Future<void> ios_migrate_v1(Box<WalletInfo> walletInfoSource,
Box<Trade> tradeSource, Box<Contact> contactSource) async {
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
if (prefs.getBool('ios_migration_v1_completed') ?? false) { if (prefs.getBool('ios_migration_v1_completed') ?? false) {
@ -137,6 +138,11 @@ Future<void> ios_migrate_wallet_passwords() async {
final walletsDir = Directory('${appDocDir.path}/wallets'); final walletsDir = Directory('${appDocDir.path}/wallets');
final moneroWalletsDir = Directory('${walletsDir.path}/monero'); 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 { moneroWalletsDir.listSync().forEach((item) async {
try { try {
if (item is Directory) { if (item is Directory) {
@ -385,7 +391,7 @@ Future<void> ios_migrate_trades_list(Box<Trade> tradeSource) async {
Future<void> ios_migrate_address_book(Box<Contact> contactSource) async { Future<void> ios_migrate_address_book(Box<Contact> contactSource) async {
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
if (prefs.getBool('ios_migration_address_book_completed') ?? false) { if (prefs.getBool('ios_migration_address_book_completed') ?? false) {
return; return;
} }

View file

@ -58,7 +58,7 @@ class Router {
return CupertinoPageRoute<void>( return CupertinoPageRoute<void>(
builder: (_) => getIt.get<SetupPinCodePage>( builder: (_) => getIt.get<SetupPinCodePage>(
param1: (BuildContext context, dynamic _) => param1: (BuildContext context, dynamic _) =>
Navigator.pushNamed(context, Routes.newWalletType)), Navigator.pushNamed(context, Routes.newWallet)),
fullscreenDialog: true); fullscreenDialog: true);
case Routes.newWalletType: case Routes.newWalletType:
@ -128,7 +128,7 @@ class Router {
return CupertinoPageRoute<void>( return CupertinoPageRoute<void>(
builder: (_) => getIt.get<SetupPinCodePage>( builder: (_) => getIt.get<SetupPinCodePage>(
param1: (BuildContext context, dynamic _) => param1: (BuildContext context, dynamic _) =>
Navigator.pushNamed(context, Routes.restoreWalletType)), Navigator.pushNamed(context, Routes.restoreWalletOptions)),
fullscreenDialog: true); fullscreenDialog: true);
case Routes.seed: case Routes.seed:

View file

@ -14,118 +14,178 @@ class WelcomePage extends BasePage {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: Theme.of(context).backgroundColor, backgroundColor: Theme
.of(context)
.backgroundColor,
resizeToAvoidBottomPadding: false, resizeToAvoidBottomPadding: false,
body: SafeArea(child: body(context))); body: SafeArea(child: body(context)));
} }
@override @override
Widget body(BuildContext context) { Widget body(BuildContext context) {
final welcomeImage = getIt.get<SettingsStore>().isDarkTheme final welcomeImage = getIt
.get<SettingsStore>()
.isDarkTheme
? welcomeImageDark : welcomeImageLight; ? welcomeImageDark : welcomeImageLight;
final newWalletImage = Image.asset('assets/images/new_wallet.png', final newWalletImage = Image.asset('assets/images/new_wallet.png',
height: 12, height: 12,
width: 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', final restoreWalletImage = Image.asset('assets/images/restore_wallet.png',
height: 12, height: 12,
width: 12, width: 12,
color: Theme.of(context).primaryTextTheme.title.color); color: Theme
.of(context)
.primaryTextTheme
.title
.color);
return Container( return WillPopScope(onWillPop: () async =>, child: Container(
padding: EdgeInsets.all(24), padding: EdgeInsets.all(24),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
flex: 2, flex: 2,
child: AspectRatio( child: AspectRatio(
aspectRatio: aspectRatioImage, aspectRatio: aspectRatioImage,
child: FittedBox(child: welcomeImage, fit: BoxFit.fill) child: FittedBox(child: welcomeImage, fit: BoxFit.fill)
) )
), ),
Flexible( Flexible(
flex: 3, flex: 3,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
children: <Widget>[ children: <Widget>[
Padding( Column(
padding: EdgeInsets.only(top: 24), children: <Widget>[
child: Text( Padding(
S.of(context).welcome, padding: EdgeInsets.only(top: 24),
style: TextStyle( child: Text(
fontSize: 18, S
fontWeight: FontWeight.w500, .of(context)
color: Theme.of(context).accentTextTheme.display3.color, .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(
Padding( S
padding: EdgeInsets.only(top: 5), .of(context)
child: Text( .cake_wallet,
S.of(context).cake_wallet, style: TextStyle(
style: TextStyle( fontSize: 36,
fontSize: 36, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, color: Theme
color: Theme.of(context).primaryTextTheme.title.color, .of(context)
.primaryTextTheme
.title
.color,
),
textAlign: TextAlign.center,
),
), ),
textAlign: TextAlign.center, Padding(
), padding: EdgeInsets.only(top: 5),
), child: Text(
Padding( S
padding: EdgeInsets.only(top: 5), .of(context)
child: Text( .first_wallet_text,
S.of(context).first_wallet_text, style: TextStyle(
style: TextStyle( fontSize: 16,
fontSize: 16, fontWeight: FontWeight.w500,
fontWeight: FontWeight.w500, color: Theme
color: Theme.of(context).accentTextTheme.display3.color, .of(context)
.accentTextTheme
.display3
.color,
),
textAlign: TextAlign.center,
),
), ),
textAlign: TextAlign.center, ],
),
), ),
], Column(
), children: <Widget>[
Column( Text(
children: <Widget>[ S
Text( .of(context)
S.of(context).please_make_selection, .please_make_selection,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: Theme.of(context).accentTextTheme.display3.color, color: Theme
), .of(context)
textAlign: TextAlign.center, .accentTextTheme
), .display3
Padding( .color,
padding: EdgeInsets.only(top: 24), ),
child: PrimaryImageButton( textAlign: TextAlign.center,
onPressed: () => Navigator.pushNamed(context, Routes.newWallet), ),
image: newWalletImage, Padding(
text: S.of(context).create_new, padding: EdgeInsets.only(top: 24),
color: Theme.of(context).accentTextTheme.subtitle.decorationColor, child: PrimaryImageButton(
textColor: Theme.of(context).accentTextTheme.headline.decorationColor, onPressed: () =>
), Navigator.pushNamed(context,
), Routes.newWalletFromWelcome),
Padding( image: newWalletImage,
padding: EdgeInsets.only(top: 10), text: S
child: PrimaryImageButton( .of(context)
onPressed: () => Navigator.pushNamed(context, Routes.restoreWalletOptions), .create_new,
image: restoreWalletImage, color: Theme
text: S.of(context).restore_wallet, .of(context)
color: Theme.of(context).accentTextTheme.caption.color, .accentTextTheme
textColor: Theme.of(context).primaryTextTheme.title.color), .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),
)
],
) )
], ],
) )
],
) )
) ],
], )
) ));
);
} }
} }