2021-11-21 01:50:05 +01:00
|
|
|
|
import 'package:bubble/bubble.dart';
|
2021-01-26 21:00:26 +01:00
|
|
|
|
import 'package:gecko/globals.dart';
|
2021-11-17 06:20:23 +01:00
|
|
|
|
import 'package:gecko/models/chest_provider.dart';
|
2021-11-30 01:25:48 +01:00
|
|
|
|
import 'package:gecko/models/wallets_profiles.dart';
|
2021-01-08 01:20:03 +01:00
|
|
|
|
import 'package:flutter/material.dart';
|
2021-11-21 01:50:05 +01:00
|
|
|
|
import 'package:gecko/models/home.dart';
|
2021-11-14 19:21:20 +01:00
|
|
|
|
import 'package:gecko/models/my_wallets.dart';
|
|
|
|
|
import 'package:gecko/models/wallet_data.dart';
|
2021-11-21 06:36:12 +01:00
|
|
|
|
import 'package:gecko/screens/myWallets/restore_chest.dart';
|
2021-11-14 19:21:20 +01:00
|
|
|
|
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
2021-11-21 01:50:05 +01:00
|
|
|
|
import 'package:gecko/screens/onBoarding/1.dart';
|
2021-11-23 04:11:45 +01:00
|
|
|
|
import 'package:gecko/screens/search.dart';
|
2021-01-28 15:26:26 +01:00
|
|
|
|
import 'package:gecko/screens/settings.dart';
|
2021-02-27 20:29:35 +01:00
|
|
|
|
import 'package:flutter/services.dart';
|
2021-01-26 21:00:26 +01:00
|
|
|
|
import 'package:provider/provider.dart';
|
2021-01-08 00:12:22 +01:00
|
|
|
|
|
2021-01-26 21:00:26 +01:00
|
|
|
|
class HomeScreen extends StatelessWidget {
|
2021-11-14 19:21:20 +01:00
|
|
|
|
const HomeScreen({Key key}) : super(key: key);
|
|
|
|
|
|
2021-01-08 00:12:22 +01:00
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2021-02-27 20:29:35 +01:00
|
|
|
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
2021-11-19 00:17:00 +01:00
|
|
|
|
// HomeProvider _homeProvider = Provider.of<HomeProvider>(context);
|
2021-02-27 20:29:35 +01:00
|
|
|
|
MyWalletsProvider _myWalletProvider =
|
|
|
|
|
Provider.of<MyWalletsProvider>(context);
|
2021-11-17 06:20:23 +01:00
|
|
|
|
Provider.of<ChestProvider>(context);
|
2021-11-21 01:50:05 +01:00
|
|
|
|
HomeProvider homeClass = HomeProvider();
|
2021-03-08 00:32:18 +01:00
|
|
|
|
|
2021-11-17 06:20:23 +01:00
|
|
|
|
final bool isWalletsExists = _myWalletProvider.checkIfWalletExist();
|
2021-11-14 03:12:07 +01:00
|
|
|
|
|
2021-03-08 00:32:18 +01:00
|
|
|
|
isTall = false;
|
|
|
|
|
ratio = 1;
|
|
|
|
|
if (MediaQuery.of(context).size.height >= 930) {
|
|
|
|
|
isTall = true;
|
|
|
|
|
ratio = 1.125;
|
|
|
|
|
}
|
2021-01-09 09:17:01 +01:00
|
|
|
|
return Scaffold(
|
2021-11-15 18:05:08 +01:00
|
|
|
|
resizeToAvoidBottomInset: false,
|
|
|
|
|
drawer: Drawer(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
|
|
|
|
|
DrawerHeader(
|
|
|
|
|
child: Column(children: const <Widget>[
|
|
|
|
|
SizedBox(height: 0),
|
|
|
|
|
Image(
|
|
|
|
|
image: AssetImage('assets/icon/gecko_final.png'),
|
|
|
|
|
height: 130),
|
|
|
|
|
]),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: orangeC,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
key: const Key('parameters'),
|
|
|
|
|
title: const Text('Paramètres'),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(builder: (context) {
|
|
|
|
|
return SettingsScreen();
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
title: const Text('A propos'),
|
|
|
|
|
onTap: () {
|
|
|
|
|
// Update the state of the app.
|
|
|
|
|
// ...
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
])),
|
|
|
|
|
Align(
|
|
|
|
|
alignment: FractionalOffset.bottomCenter,
|
|
|
|
|
child: Text('Ğecko v$appVersion')),
|
|
|
|
|
const SizedBox(height: 20)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
backgroundColor: const Color(0xffF9F9F1),
|
|
|
|
|
body: Builder(
|
|
|
|
|
builder: (ctx) => StatefulWrapper(
|
2021-11-21 01:50:05 +01:00
|
|
|
|
onInit: () {
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
|
if (isWalletsExists) homeClass.snackNode(ctx);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: isWalletsExists ? geckHome(context) : welcomeHome(context)
|
|
|
|
|
// bottomNavigationBar: BottomNavigationBar(
|
|
|
|
|
// backgroundColor: backgroundColor,
|
|
|
|
|
// fixedColor: Colors.grey[850],
|
|
|
|
|
// unselectedItemColor: const Color(0xffBD935C),
|
|
|
|
|
// type: BottomNavigationBarType.fixed,
|
|
|
|
|
// onTap: (index) {
|
|
|
|
|
// _homeProvider.currentIndex = index;
|
|
|
|
|
// },
|
|
|
|
|
// currentIndex: _homeProvider.currentIndex,
|
|
|
|
|
// items: [
|
|
|
|
|
// BottomNavigationBarItem(
|
|
|
|
|
// icon: Image.asset('assets/block-space-disabled.png', height: 26),
|
|
|
|
|
// activeIcon: Image.asset('assets/blockchain.png', height: 26),
|
|
|
|
|
// label: 'Explorateur',
|
|
|
|
|
// ),
|
|
|
|
|
// const BottomNavigationBarItem(
|
|
|
|
|
// icon: Icon(Icons.lock),
|
|
|
|
|
// label: 'Mes portefeuilles',
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget geckHome(context) {
|
|
|
|
|
MyWalletsProvider _myWalletProvider = Provider.of<MyWalletsProvider>(context);
|
|
|
|
|
Provider.of<ChestProvider>(context);
|
|
|
|
|
|
2021-11-30 01:25:48 +01:00
|
|
|
|
WalletsProfilesProvider _historyProvider =
|
|
|
|
|
Provider.of<WalletsProfilesProvider>(context);
|
2021-11-21 01:50:05 +01:00
|
|
|
|
final double statusBarHeight = MediaQuery.of(context).padding.top;
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
|
image: DecorationImage(
|
|
|
|
|
image: AssetImage("assets/home/background.jpg"),
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child:
|
|
|
|
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
|
|
|
|
|
Stack(children: <Widget>[
|
|
|
|
|
Positioned(
|
|
|
|
|
top: statusBarHeight + 10,
|
|
|
|
|
left: 15,
|
|
|
|
|
child: Builder(
|
|
|
|
|
builder: (context) => IconButton(
|
|
|
|
|
key: const Key('drawerMenu'),
|
|
|
|
|
icon: const Icon(
|
|
|
|
|
Icons.menu,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
size: 35,
|
2021-11-19 00:17:00 +01:00
|
|
|
|
),
|
2021-11-21 01:50:05 +01:00
|
|
|
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
2021-11-15 18:05:08 +01:00
|
|
|
|
),
|
2021-11-21 01:50:05 +01:00
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const Align(
|
|
|
|
|
child:
|
|
|
|
|
Image(image: AssetImage('assets/home/header.png'), height: 210),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 15 * ratio),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: const <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
"y'a pas de lézard ;-)",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 24,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
shadows: <Shadow>[
|
|
|
|
|
Shadow(
|
|
|
|
|
offset: Offset(0, 0),
|
|
|
|
|
blurRadius: 20,
|
|
|
|
|
color: Colors.black,
|
2021-11-19 00:17:00 +01:00
|
|
|
|
),
|
2021-11-21 01:50:05 +01:00
|
|
|
|
Shadow(
|
|
|
|
|
offset: Offset(0, 0),
|
|
|
|
|
blurRadius: 20,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
],
|
2021-11-19 03:18:39 +01:00
|
|
|
|
),
|
2021-11-21 01:50:05 +01:00
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
gradient: LinearGradient(
|
|
|
|
|
begin: Alignment.topCenter,
|
|
|
|
|
end: Alignment.bottomCenter,
|
|
|
|
|
colors: [
|
|
|
|
|
Colors.transparent,
|
|
|
|
|
Colors.black.withOpacity(0.9),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Column(children: <Widget>[
|
|
|
|
|
const Spacer(),
|
|
|
|
|
Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
|
|
|
|
|
Column(children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: ClipOval(
|
|
|
|
|
child: Material(
|
|
|
|
|
color: orangeC, // button color
|
|
|
|
|
child: InkWell(
|
|
|
|
|
child: const Padding(
|
2021-11-23 04:11:45 +01:00
|
|
|
|
padding: EdgeInsets.all(18),
|
|
|
|
|
child: Image(
|
|
|
|
|
image: AssetImage('assets/home/loupe.png'),
|
|
|
|
|
height: 70),
|
|
|
|
|
),
|
2021-11-21 01:50:05 +01:00
|
|
|
|
onTap: () {
|
2021-11-23 04:11:45 +01:00
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(builder: (context) {
|
|
|
|
|
return const SearchScreen();
|
|
|
|
|
}),
|
|
|
|
|
);
|
2021-11-21 01:50:05 +01:00
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
blurRadius: 2,
|
|
|
|
|
offset: Offset(1, 1.5),
|
|
|
|
|
spreadRadius: 0.5)
|
|
|
|
|
],
|
|
|
|
|
),
|
2021-11-19 03:18:39 +01:00
|
|
|
|
),
|
2021-11-21 01:50:05 +01:00
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
|
const Text(
|
2021-12-02 07:23:12 +01:00
|
|
|
|
"Rechercher un\nportefeuille",
|
2021-11-21 01:50:05 +01:00
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 17,
|
|
|
|
|
fontWeight: FontWeight.w500),
|
|
|
|
|
)
|
2021-11-19 03:18:39 +01:00
|
|
|
|
]),
|
2021-11-21 01:50:05 +01:00
|
|
|
|
const SizedBox(width: 120),
|
|
|
|
|
Column(children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: ClipOval(
|
|
|
|
|
key: const Key('manageWallets'),
|
|
|
|
|
child: Material(
|
|
|
|
|
color: orangeC, // button color
|
|
|
|
|
child: InkWell(
|
|
|
|
|
child: const Padding(
|
|
|
|
|
padding: EdgeInsets.all(18),
|
|
|
|
|
child: Image(
|
|
|
|
|
image: AssetImage('assets/home/wallet.png'),
|
|
|
|
|
height: 75)),
|
|
|
|
|
onTap: () {
|
|
|
|
|
WalletData defaultWallet =
|
|
|
|
|
_myWalletProvider.getDefaultWallet(
|
|
|
|
|
configBox.get('currentChest'));
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) {
|
|
|
|
|
return UnlockingWallet(
|
|
|
|
|
wallet: defaultWallet,
|
|
|
|
|
action: "mywallets",
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Navigator.pushNamed(
|
|
|
|
|
// context, '/mywallets')));
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
blurRadius: 2,
|
|
|
|
|
offset: Offset(1, 1.5),
|
|
|
|
|
spreadRadius: 0.5)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
|
const Text(
|
|
|
|
|
"Gérer mes\nportefeuilles",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 17,
|
|
|
|
|
fontWeight: FontWeight.w500),
|
|
|
|
|
)
|
|
|
|
|
])
|
|
|
|
|
]),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 40),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: ClipOval(
|
|
|
|
|
child: Material(
|
|
|
|
|
color: orangeC, // button color
|
|
|
|
|
child: InkWell(
|
|
|
|
|
child: const Padding(
|
|
|
|
|
padding: EdgeInsets.all(18),
|
|
|
|
|
child: Image(
|
|
|
|
|
image: AssetImage(
|
|
|
|
|
'assets/home/qrcode.png'),
|
|
|
|
|
height: 75)),
|
|
|
|
|
onTap: () async {
|
|
|
|
|
await _historyProvider.scan(context);
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
blurRadius: 2,
|
|
|
|
|
offset: Offset(1, 1.5),
|
|
|
|
|
spreadRadius: 0.5)
|
2021-11-19 03:18:39 +01:00
|
|
|
|
],
|
|
|
|
|
),
|
2021-11-21 01:50:05 +01:00
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
|
const Text(
|
|
|
|
|
"Scanner un\nQR code",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 17,
|
|
|
|
|
fontWeight: FontWeight.w500),
|
2021-11-19 03:18:39 +01:00
|
|
|
|
)
|
2021-11-21 01:50:05 +01:00
|
|
|
|
])
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: isTall ? 80 : 40)
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget welcomeHome(context) {
|
|
|
|
|
final double statusBarHeight = MediaQuery.of(context).padding.top;
|
|
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
|
image: DecorationImage(
|
|
|
|
|
image: AssetImage("assets/home/background.jpg"),
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child:
|
|
|
|
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
|
|
|
|
|
Stack(children: <Widget>[
|
|
|
|
|
Positioned(
|
|
|
|
|
top: statusBarHeight + 10,
|
|
|
|
|
left: 15,
|
|
|
|
|
child: Builder(
|
|
|
|
|
builder: (context) => IconButton(
|
|
|
|
|
key: const Key('drawerMenu'),
|
|
|
|
|
icon: const Icon(
|
|
|
|
|
Icons.menu,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
size: 35,
|
2021-11-19 03:18:39 +01:00
|
|
|
|
),
|
2021-11-21 01:50:05 +01:00
|
|
|
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const Align(
|
|
|
|
|
child:
|
|
|
|
|
Image(image: AssetImage('assets/home/header.png'), height: 210),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 1 * ratio),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: const <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
"L’application de paiement Ğ1\nplus rapide qu’un reptile du Vietnam",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 24,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
shadows: <Shadow>[
|
|
|
|
|
Shadow(
|
|
|
|
|
offset: Offset(0, 0),
|
|
|
|
|
blurRadius: 20,
|
|
|
|
|
color: Colors.black,
|
2021-11-19 00:17:00 +01:00
|
|
|
|
),
|
2021-11-21 01:50:05 +01:00
|
|
|
|
Shadow(
|
|
|
|
|
offset: Offset(0, 0),
|
|
|
|
|
blurRadius: 20,
|
|
|
|
|
color: Colors.black,
|
2021-11-19 00:17:00 +01:00
|
|
|
|
),
|
2021-11-21 01:50:05 +01:00
|
|
|
|
],
|
2021-11-19 03:18:39 +01:00
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
]),
|
2021-11-15 18:05:08 +01:00
|
|
|
|
),
|
2021-11-21 01:50:05 +01:00
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
gradient: LinearGradient(
|
|
|
|
|
begin: Alignment.topCenter,
|
|
|
|
|
end: Alignment.bottomCenter,
|
|
|
|
|
colors: [
|
|
|
|
|
Colors.transparent,
|
|
|
|
|
Colors.black.withOpacity(0.9),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Column(children: <Widget>[
|
|
|
|
|
const Spacer(),
|
|
|
|
|
Row(children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Stack(children: <Widget>[
|
|
|
|
|
const Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 55),
|
|
|
|
|
child: Image(
|
|
|
|
|
image: AssetImage('assets/home/gecko-bienvenue.png'),
|
|
|
|
|
height: 220,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Positioned(
|
|
|
|
|
left: 180,
|
|
|
|
|
child: bubbleSpeak("y'a pas de lézard !"),
|
|
|
|
|
),
|
|
|
|
|
const Positioned(
|
|
|
|
|
left: 200,
|
|
|
|
|
top: 60,
|
|
|
|
|
child: Image(
|
|
|
|
|
image: AssetImage('assets/home/bout_de_bulle.png'),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 410,
|
|
|
|
|
height: 70,
|
|
|
|
|
child: ElevatedButton(
|
|
|
|
|
style: ElevatedButton.styleFrom(
|
|
|
|
|
elevation: 4,
|
|
|
|
|
primary: orangeC, // background
|
|
|
|
|
onPrimary: Colors.white, // foreground
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) {
|
|
|
|
|
return OnboardingStepOne();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: const Text(
|
2021-12-02 07:23:12 +01:00
|
|
|
|
'Créer un portefeuille',
|
2021-11-21 01:50:05 +01:00
|
|
|
|
style:
|
|
|
|
|
TextStyle(fontSize: 24, fontWeight: FontWeight.w600),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 25 * ratio),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 410,
|
|
|
|
|
height: 70,
|
|
|
|
|
child: OutlinedButton(
|
|
|
|
|
style: OutlinedButton.styleFrom(
|
|
|
|
|
side: BorderSide(width: 4, color: orangeC)),
|
|
|
|
|
onPressed: () {
|
2021-11-21 06:36:12 +01:00
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) {
|
|
|
|
|
return const RestoreChest();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
2021-11-21 01:50:05 +01:00
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
"Restaurer mes portefeuilles",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 24,
|
|
|
|
|
color: orangeC,
|
|
|
|
|
fontWeight: FontWeight.w600),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: isTall ? 100 : 50)
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
))
|
|
|
|
|
]),
|
|
|
|
|
);
|
2021-02-22 19:44:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class StatefulWrapper extends StatefulWidget {
|
|
|
|
|
final Function onInit;
|
|
|
|
|
final Widget child;
|
2021-11-14 19:21:20 +01:00
|
|
|
|
const StatefulWrapper({Key key, @required this.onInit, @required this.child})
|
|
|
|
|
: super(key: key);
|
2021-02-22 19:44:58 +01:00
|
|
|
|
@override
|
|
|
|
|
_StatefulWrapperState createState() => _StatefulWrapperState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _StatefulWrapperState extends State<StatefulWrapper> {
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
if (widget.onInit != null) {
|
|
|
|
|
widget.onInit();
|
|
|
|
|
}
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return widget.child;
|
2021-01-08 00:12:22 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-11-21 01:50:05 +01:00
|
|
|
|
|
|
|
|
|
Widget bubbleSpeak(String text, {double long, Key textKey}) {
|
|
|
|
|
return Bubble(
|
|
|
|
|
padding: long == null
|
|
|
|
|
? const BubbleEdges.all(20)
|
|
|
|
|
: BubbleEdges.symmetric(horizontal: long, vertical: 30),
|
|
|
|
|
elevation: 5,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Text(
|
|
|
|
|
text,
|
|
|
|
|
key: textKey,
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
color: Colors.black, fontSize: 21, fontWeight: FontWeight.w400),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|