2021-12-24 12:37:24 +00:00
|
|
|
import 'package:cw_core/wallet_type.dart';
|
2020-11-27 11:08:17 +00:00
|
|
|
import 'package:cake_wallet/routes.dart';
|
2020-12-15 19:43:50 +00:00
|
|
|
import 'package:cake_wallet/themes/theme_base.dart';
|
2020-11-27 11:08:17 +00:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:cake_wallet/generated/i18n.dart';
|
|
|
|
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/base_page.dart';
|
|
|
|
|
|
|
|
class PreSeedPage extends BasePage {
|
2020-12-21 20:20:46 +00:00
|
|
|
PreSeedPage(this.type)
|
|
|
|
: imageLight = Image.asset('assets/images/pre_seed_light.png'),
|
|
|
|
imageDark = Image.asset('assets/images/pre_seed_dark.png'),
|
|
|
|
wordsCount = type == WalletType.monero
|
|
|
|
? 25
|
2021-05-10 10:06:57 +00:00
|
|
|
: 24; // FIXME: Stupid fast implementation
|
2020-12-21 20:20:46 +00:00
|
|
|
|
|
|
|
final Image imageDark;
|
|
|
|
final Image imageLight;
|
|
|
|
final WalletType type;
|
|
|
|
final int wordsCount;
|
2020-12-10 17:53:40 +00:00
|
|
|
|
2020-11-27 11:08:17 +00:00
|
|
|
@override
|
2022-10-12 17:09:57 +00:00
|
|
|
Widget? leading(BuildContext context) => null;
|
2020-11-27 11:08:17 +00:00
|
|
|
|
|
|
|
@override
|
2022-10-12 17:09:57 +00:00
|
|
|
String? get title => S.current.pre_seed_title;
|
2020-11-27 11:08:17 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget body(BuildContext context) {
|
2020-12-15 19:30:16 +00:00
|
|
|
final image = currentTheme.type == ThemeType.dark ? imageDark : imageLight;
|
2020-11-27 11:08:17 +00:00
|
|
|
|
2020-12-03 17:30:56 +00:00
|
|
|
return WillPopScope(
|
|
|
|
onWillPop: () async => false,
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.all(24),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Flexible(
|
|
|
|
flex: 2,
|
|
|
|
child: AspectRatio(
|
|
|
|
aspectRatio: 1,
|
|
|
|
child: FittedBox(child: image, fit: BoxFit.contain))),
|
|
|
|
Flexible(
|
|
|
|
flex: 3,
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(top: 70, left: 16, right: 16),
|
|
|
|
child: Text(
|
2021-05-10 10:06:57 +00:00
|
|
|
S
|
|
|
|
.of(context)
|
|
|
|
.pre_seed_description(wordsCount.toString()),
|
2020-12-03 17:30:56 +00:00
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
color: Theme.of(context)
|
2022-10-12 17:09:57 +00:00
|
|
|
.primaryTextTheme!
|
|
|
|
.caption!
|
|
|
|
.color!),
|
2020-12-03 17:30:56 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
PrimaryButton(
|
|
|
|
onPressed: () => Navigator.of(context)
|
|
|
|
.popAndPushNamed(Routes.seed, arguments: true),
|
|
|
|
text: S.of(context).pre_seed_button_text,
|
2022-10-12 17:09:57 +00:00
|
|
|
color: Theme.of(context).accentTextTheme!.bodyText1!.color!,
|
2020-12-03 17:30:56 +00:00
|
|
|
textColor: Colors.white)
|
|
|
|
],
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
));
|
2020-11-27 11:08:17 +00:00
|
|
|
}
|
2020-12-03 17:30:56 +00:00
|
|
|
}
|