-
Notifications
You must be signed in to change notification settings - Fork 323
/
intro_welcome.dart
executable file
·104 lines (100 loc) · 4.28 KB
/
intro_welcome.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:natrium_wallet_flutter/appstate_container.dart';
import 'package:natrium_wallet_flutter/dimens.dart';
import 'package:natrium_wallet_flutter/styles.dart';
import 'package:natrium_wallet_flutter/localization.dart';
import 'package:natrium_wallet_flutter/ui/widgets/buttons.dart';
import 'package:flare_flutter/flare_actor.dart';
class IntroWelcomePage extends StatefulWidget {
@override
_IntroWelcomePageState createState() => _IntroWelcomePageState();
}
class _IntroWelcomePageState extends State<IntroWelcomePage> {
var _scaffoldKey = new GlobalKey<ScaffoldState>();
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
key: _scaffoldKey,
backgroundColor: StateContainer.of(context).curTheme.backgroundDark,
body: LayoutBuilder(
builder: (context, constraints) => SafeArea(
minimum: EdgeInsets.only(
bottom: MediaQuery.of(context).size.height * 0.035,
top: MediaQuery.of(context).size.height * 0.10,
),
child: Column(
children: <Widget>[
//A widget that holds welcome animation + paragraph
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
//Container for the animation
Container(
//Width/Height ratio for the animation is needed because BoxFit is not working as expected
width: double.infinity,
height: MediaQuery.of(context).size.width * 5 / 8,
child: Center(
child: FlareActor(
"assets/welcome_animation.flr",
animation: "main",
fit: BoxFit.contain,
color: StateContainer.of(context)
.curTheme
.primary,
),
),
),
//Container for the paragraph
Container(
margin: EdgeInsets.symmetric(
horizontal: smallScreen(context)?30:40, vertical: 20),
child: AutoSizeText(
AppLocalization.of(context).welcomeText,
style: AppStyles.textStyleParagraph(context),
maxLines: 4,
stepGranularity: 0.5,
),
),
],
),
),
//A column with "New Wallet" and "Import Wallet" buttons
Column(
children: <Widget>[
Row(
children: <Widget>[
// New Wallet Button
AppButton.buildAppButton(
context,
AppButtonType.PRIMARY,
AppLocalization.of(context).newWallet,
Dimens.BUTTON_TOP_DIMENS, onPressed: () {
Navigator.of(context)
.pushNamed('/intro_password_on_launch');
}),
],
),
Row(
children: <Widget>[
// Import Wallet Button
AppButton.buildAppButton(
context,
AppButtonType.PRIMARY_OUTLINE,
AppLocalization.of(context).importWallet,
Dimens.BUTTON_BOTTOM_DIMENS, onPressed: () {
Navigator.of(context).pushNamed('/intro_import');
}),
],
),
],
),
],
),
),
),
);
}
}