2020-12-10 17:53:40 +00:00
|
|
|
import 'package:cake_wallet/entities/item_from_theme.dart';
|
2020-11-27 11:08:17 +00:00
|
|
|
import 'package:cake_wallet/routes.dart';
|
|
|
|
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';
|
2020-12-10 17:53:40 +00:00
|
|
|
import 'package:cake_wallet/themes.dart';
|
2020-11-27 11:08:17 +00:00
|
|
|
|
|
|
|
class PreSeedPage extends BasePage {
|
|
|
|
static final imageLight = Image.asset('assets/images/pre_seed_light.png');
|
|
|
|
static final imageDark = Image.asset('assets/images/pre_seed_dark.png');
|
|
|
|
|
2020-12-10 17:53:40 +00:00
|
|
|
final Map<Themes, Image> items = {
|
|
|
|
Themes.light: imageLight,
|
|
|
|
Themes.bright: imageLight,
|
|
|
|
Themes.dark: imageDark
|
|
|
|
};
|
|
|
|
|
2020-11-27 11:08:17 +00:00
|
|
|
@override
|
|
|
|
Widget leading(BuildContext context) => null;
|
|
|
|
|
|
|
|
@override
|
2020-11-27 12:16:42 +00:00
|
|
|
String get title => S.current.pre_seed_title;
|
2020-11-27 11:08:17 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget body(BuildContext context) {
|
|
|
|
final image =
|
2020-12-10 17:53:40 +00:00
|
|
|
itemFromTheme(currentTheme: currentTheme, items: items) as Image
|
|
|
|
?? 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(
|
|
|
|
S.of(context).pre_seed_description,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
color: Theme.of(context)
|
|
|
|
.primaryTextTheme
|
|
|
|
.caption
|
|
|
|
.color),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
PrimaryButton(
|
|
|
|
onPressed: () => Navigator.of(context)
|
|
|
|
.popAndPushNamed(Routes.seed, arguments: true),
|
|
|
|
text: S.of(context).pre_seed_button_text,
|
|
|
|
color: Theme.of(context).accentTextTheme.body2.color,
|
|
|
|
textColor: Colors.white)
|
|
|
|
],
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
));
|
2020-11-27 11:08:17 +00:00
|
|
|
}
|
2020-12-03 17:30:56 +00:00
|
|
|
}
|