2021-01-26 21:00:26 +01:00
|
|
|
|
import 'package:gecko/globals.dart';
|
2021-02-16 17:40:25 +01:00
|
|
|
|
import 'package:gecko/models/history.dart';
|
2021-01-26 21:00:26 +01:00
|
|
|
|
import 'package:gecko/models/home.dart';
|
2021-01-08 01:20:03 +01:00
|
|
|
|
import 'package:flutter/material.dart';
|
2021-02-22 08:49:29 +01:00
|
|
|
|
import 'package:gecko/screens/myWallets/walletsHome.dart';
|
2021-01-08 00:12:22 +01:00
|
|
|
|
import 'dart:ui';
|
2021-01-28 15:26:26 +01:00
|
|
|
|
import 'package:gecko/screens/settings.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-01-08 00:12:22 +01:00
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2021-01-28 17:50:40 +01:00
|
|
|
|
HomeProvider _homeProvider = Provider.of<HomeProvider>(context);
|
2021-02-16 17:40:25 +01:00
|
|
|
|
HistoryProvider _historyProvider = Provider.of<HistoryProvider>(context);
|
2021-02-22 08:49:29 +01:00
|
|
|
|
// _historyProvider.snackNode(context);
|
|
|
|
|
|
2021-01-09 09:17:01 +01:00
|
|
|
|
return Scaffold(
|
2021-02-22 08:49:29 +01:00
|
|
|
|
resizeToAvoidBottomInset: false,
|
|
|
|
|
drawer: Drawer(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
|
|
|
|
|
DrawerHeader(
|
|
|
|
|
child: Column(children: <Widget>[
|
|
|
|
|
SizedBox(height: 0),
|
|
|
|
|
Image(
|
|
|
|
|
image: AssetImage('assets/icon/gecko_final.png'),
|
|
|
|
|
height: 130),
|
|
|
|
|
]),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Color(0xffD28928),
|
|
|
|
|
),
|
2021-01-16 03:32:41 +01:00
|
|
|
|
),
|
2021-02-22 08:49:29 +01:00
|
|
|
|
ListTile(
|
|
|
|
|
title: Text('Paramètres'),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(builder: (context) {
|
|
|
|
|
return SettingsScreen();
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
title: Text('A propos'),
|
|
|
|
|
onTap: () {
|
|
|
|
|
// Update the state of the app.
|
|
|
|
|
// ...
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
])),
|
|
|
|
|
Container(
|
|
|
|
|
child: Align(
|
|
|
|
|
alignment: FractionalOffset.bottomCenter,
|
|
|
|
|
child: Text('Ğecko v$appVersion'))),
|
|
|
|
|
SizedBox(height: 20)
|
|
|
|
|
],
|
|
|
|
|
),
|
2021-01-16 03:32:41 +01:00
|
|
|
|
),
|
2021-02-22 08:49:29 +01:00
|
|
|
|
appBar: AppBar(
|
|
|
|
|
leading: Builder(
|
|
|
|
|
builder: (context) => IconButton(
|
|
|
|
|
icon: new Icon(Icons.menu, color: Colors.grey[850]),
|
|
|
|
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
|
|
|
|
)),
|
|
|
|
|
title: _homeProvider.appBarTitle,
|
|
|
|
|
actions: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: _homeProvider.searchIcon,
|
|
|
|
|
color: Colors.grey[850],
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
// context,
|
|
|
|
|
// MaterialPageRoute(builder: (context) {
|
|
|
|
|
// return SearchList();
|
|
|
|
|
// }),
|
|
|
|
|
// );
|
2021-02-16 17:40:25 +01:00
|
|
|
|
|
2021-02-22 08:49:29 +01:00
|
|
|
|
if (_homeProvider.searchIcon.icon == Icons.search) {
|
|
|
|
|
_homeProvider.searchIcon = Icon(
|
|
|
|
|
Icons.close,
|
2021-02-16 17:40:25 +01:00
|
|
|
|
color: Colors.grey[850],
|
2021-02-22 08:49:29 +01:00
|
|
|
|
);
|
|
|
|
|
_homeProvider.appBarTitle = TextField(
|
|
|
|
|
autofocus: true,
|
|
|
|
|
controller: _homeProvider.searchQuery,
|
|
|
|
|
onChanged: (text) {
|
|
|
|
|
print("Clé tappé: $text");
|
|
|
|
|
final String searchResult =
|
|
|
|
|
_historyProvider.isPubkey(context, text);
|
|
|
|
|
if (searchResult != '') {
|
|
|
|
|
_homeProvider.currentIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.grey[850],
|
|
|
|
|
),
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
prefixIcon:
|
|
|
|
|
Icon(Icons.search, color: Colors.grey[850]),
|
|
|
|
|
hintText: "Rechercher ...",
|
|
|
|
|
hintStyle: TextStyle(color: Colors.grey[850])),
|
|
|
|
|
);
|
|
|
|
|
_homeProvider.handleSearchStart();
|
|
|
|
|
} else {
|
|
|
|
|
_homeProvider.handleSearchEnd();
|
|
|
|
|
}
|
|
|
|
|
}))
|
|
|
|
|
],
|
|
|
|
|
backgroundColor: Color(0xffFFD58D),
|
|
|
|
|
),
|
|
|
|
|
backgroundColor: Color(0xffF9F9F1),
|
|
|
|
|
body: // _homeProvider.currentTab[_homeProvider.currentIndex],
|
|
|
|
|
Builder(
|
|
|
|
|
builder: (context) => Column(children: <Widget>[
|
|
|
|
|
// _historyProvider.snackNode(context),
|
|
|
|
|
// SnackBar(content: Text('tataaa')),
|
|
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 22),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Image(
|
|
|
|
|
image: AssetImage('assets/icon/gecko_final.png'),
|
|
|
|
|
height: 180),
|
|
|
|
|
])),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 15),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
"L’application de paiement Ğ1\nplus mobile qu’un lésard du Vietnam",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(color: Colors.black, fontSize: 15),
|
|
|
|
|
)
|
|
|
|
|
])),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 60),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(children: <Widget>[
|
2021-02-22 08:54:40 +01:00
|
|
|
|
Container(
|
|
|
|
|
child: ClipOval(
|
|
|
|
|
child: Material(
|
|
|
|
|
color: Color(0xffFFD58D), // button color
|
|
|
|
|
child: InkWell(
|
|
|
|
|
splashColor:
|
|
|
|
|
Color(0xffD28928), // inkwell color
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.all(17),
|
|
|
|
|
child: Image(
|
|
|
|
|
image: AssetImage(
|
|
|
|
|
'assets/qrcode-scan.png'),
|
|
|
|
|
height: 58)),
|
2021-02-22 08:49:29 +01:00
|
|
|
|
onTap: () async {
|
|
|
|
|
await _historyProvider.scan(context);
|
2021-02-22 08:54:40 +01:00
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
blurRadius: 4.0,
|
|
|
|
|
offset: Offset(2.0, 2.5),
|
|
|
|
|
spreadRadius: 0.5)
|
|
|
|
|
],
|
2021-02-22 08:49:29 +01:00
|
|
|
|
),
|
2021-02-16 04:57:13 +01:00
|
|
|
|
),
|
2021-02-22 08:54:40 +01:00
|
|
|
|
SizedBox(height: 10),
|
2021-02-22 08:49:29 +01:00
|
|
|
|
Text(
|
|
|
|
|
"Payer par QR-Code",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(color: Colors.black, fontSize: 13),
|
|
|
|
|
)
|
|
|
|
|
])
|
|
|
|
|
])),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 60),
|
2021-02-22 08:54:40 +01:00
|
|
|
|
child:
|
|
|
|
|
Row(mainAxisAlignment: MainAxisAlignment.center, children: <
|
|
|
|
|
Widget>[
|
|
|
|
|
Column(children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: ClipOval(
|
|
|
|
|
child: Material(
|
|
|
|
|
color: Color(0xffFFD58D), // button color
|
|
|
|
|
child: InkWell(
|
|
|
|
|
splashColor: Color(0xffD28928), // inkwell color
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 18, vertical: 14),
|
2021-02-22 08:49:29 +01:00
|
|
|
|
child: Image(
|
|
|
|
|
image:
|
|
|
|
|
AssetImage('assets/blockchain.png'),
|
2021-02-22 08:54:40 +01:00
|
|
|
|
height: 65)),
|
|
|
|
|
onTap: () {}),
|
2021-02-22 08:49:29 +01:00
|
|
|
|
),
|
2021-02-22 08:54:40 +01:00
|
|
|
|
),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
blurRadius: 4.0,
|
|
|
|
|
offset: Offset(2.0, 2.5),
|
|
|
|
|
spreadRadius: 0.5)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 10),
|
|
|
|
|
Text(
|
|
|
|
|
"Explorer\n",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(color: Colors.black, fontSize: 13),
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
SizedBox(width: 140),
|
|
|
|
|
Column(children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: ClipOval(
|
|
|
|
|
child: Material(
|
|
|
|
|
color: Color(0xffFFD58D), // button color
|
|
|
|
|
child: InkWell(
|
|
|
|
|
splashColor: Color(0xffD28928), // inkwell color
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.all(20),
|
2021-02-22 08:49:29 +01:00
|
|
|
|
child: Image(
|
|
|
|
|
image: AssetImage('assets/lock.png'),
|
2021-02-22 08:54:40 +01:00
|
|
|
|
height: 50)),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(builder: (context) {
|
|
|
|
|
return WalletsHome();
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
}),
|
2021-02-22 08:49:29 +01:00
|
|
|
|
),
|
2021-02-22 08:54:40 +01:00
|
|
|
|
),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
blurRadius: 4.0,
|
|
|
|
|
offset: Offset(2.0, 2.5),
|
|
|
|
|
spreadRadius: 0.5)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 10),
|
|
|
|
|
Text(
|
|
|
|
|
"Gérer mes\nportefeuilles",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(color: Colors.black, fontSize: 13),
|
|
|
|
|
)
|
|
|
|
|
])
|
|
|
|
|
]))
|
2021-02-22 08:49:29 +01:00
|
|
|
|
]),
|
|
|
|
|
// bottomNavigationBar: BottomNavigationBar(
|
|
|
|
|
// backgroundColor: Color(0xffFFD58D),
|
|
|
|
|
// fixedColor: Colors.grey[850],
|
|
|
|
|
// unselectedItemColor: 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',
|
|
|
|
|
// ),
|
|
|
|
|
// BottomNavigationBarItem(
|
|
|
|
|
// icon: Icon(Icons.lock),
|
|
|
|
|
// label: 'Mes portefeuilles',
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
));
|
2021-01-08 00:12:22 +01:00
|
|
|
|
}
|
|
|
|
|
}
|