-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CW-229 Improved restore options from QR code (#793)
* add restoring wallet from qr * add restore mode * add alert for exceptions * add restore from seed * add check for create wallet state * convert sweeping page into stateful * fix parsing url * restoration flow update * update restoring from key mode * update config * fix restor of BTC and LTC wallets * fix pin code issue * wallet Seed/keys uri or code fix * fix key restore credentials * update the restore workflow * update from main * PR coments fixes * update * update * PR fixes
- Loading branch information
1 parent
f2b8dd2
commit 1eb8d0c
Showing
38 changed files
with
698 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
import 'package:cake_wallet/themes/theme_base.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:cake_wallet/src/screens/base_page.dart'; | ||
import 'package:cake_wallet/generated/i18n.dart'; | ||
import 'package:flutter/scheduler.dart'; | ||
|
||
class SweepingWalletPage extends BasePage { | ||
SweepingWalletPage(); | ||
|
||
static const aspectRatioImage = 1.25; | ||
final welcomeImageLight = Image.asset('assets/images/welcome_light.png'); | ||
final welcomeImageDark = Image.asset('assets/images/welcome.png'); | ||
|
||
|
||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
backgroundColor: Theme.of(context).backgroundColor, | ||
resizeToAvoidBottomInset: false, | ||
body: body(context)); | ||
} | ||
|
||
@override | ||
Widget body(BuildContext context) { | ||
final welcomeImage = currentTheme.type == ThemeType.dark ? welcomeImageDark : welcomeImageLight; | ||
|
||
return SweepingWalletWidget( | ||
aspectRatioImage: aspectRatioImage, | ||
welcomeImage: welcomeImage, | ||
); | ||
} | ||
} | ||
|
||
class SweepingWalletWidget extends StatefulWidget { | ||
const SweepingWalletWidget({ | ||
required this.aspectRatioImage, | ||
required this.welcomeImage, | ||
}); | ||
|
||
final double aspectRatioImage; | ||
final Image welcomeImage; | ||
|
||
@override | ||
State<SweepingWalletWidget> createState() => _SweepingWalletWidgetState(); | ||
} | ||
|
||
class _SweepingWalletWidgetState extends State<SweepingWalletWidget> { | ||
@override | ||
void initState() { | ||
SchedulerBinding.instance.addPostFrameCallback((_) async { | ||
|
||
}); | ||
super.initState(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return WillPopScope( | ||
onWillPop: () async => false, | ||
child: Container( | ||
padding: EdgeInsets.only(top: 64, bottom: 24, left: 24, right: 24), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: <Widget>[ | ||
Flexible( | ||
flex: 2, | ||
child: AspectRatio( | ||
aspectRatio: widget.aspectRatioImage, | ||
child: FittedBox(child: widget.welcomeImage, fit: BoxFit.fill))), | ||
Flexible( | ||
flex: 3, | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: <Widget>[ | ||
Column( | ||
children: <Widget>[ | ||
Padding( | ||
padding: EdgeInsets.only(top: 24), | ||
child: Text( | ||
S.of(context).please_wait, | ||
style: TextStyle( | ||
fontSize: 18, | ||
fontWeight: FontWeight.w500, | ||
color: Theme.of(context).accentTextTheme!.headline2!.color!, | ||
), | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
Padding( | ||
padding: EdgeInsets.only(top: 5), | ||
child: Text( | ||
S.of(context).sweeping_wallet, | ||
style: TextStyle( | ||
fontSize: 36, | ||
fontWeight: FontWeight.bold, | ||
color: Theme.of(context).primaryTextTheme!.headline6!.color!, | ||
), | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
Padding( | ||
padding: EdgeInsets.only(top: 5), | ||
child: Text( | ||
S.of(context).sweeping_wallet_alert, | ||
style: TextStyle( | ||
fontSize: 16, | ||
fontWeight: FontWeight.w500, | ||
color: Theme.of(context).accentTextTheme!.headline2!.color!, | ||
), | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
], | ||
), | ||
], | ||
)) | ||
], | ||
))); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.