New home style
After Width: | Height: | Size: 620 KiB |
After Width: | Height: | Size: 16 MiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 3.5 KiB |
|
@ -2,7 +2,6 @@ import 'package:dubp/dubp.dart';
|
||||||
import 'package:gecko/globals.dart';
|
import 'package:gecko/globals.dart';
|
||||||
import 'package:gecko/models/chest_provider.dart';
|
import 'package:gecko/models/chest_provider.dart';
|
||||||
import 'package:gecko/models/history.dart';
|
import 'package:gecko/models/history.dart';
|
||||||
import 'package:gecko/models/home.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gecko/models/my_wallets.dart';
|
import 'package:gecko/models/my_wallets.dart';
|
||||||
import 'package:gecko/models/wallet_data.dart';
|
import 'package:gecko/models/wallet_data.dart';
|
||||||
|
@ -19,7 +18,7 @@ class HomeScreen extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||||
HomeProvider _homeProvider = Provider.of<HomeProvider>(context);
|
// HomeProvider _homeProvider = Provider.of<HomeProvider>(context);
|
||||||
HistoryProvider _historyProvider = Provider.of<HistoryProvider>(context);
|
HistoryProvider _historyProvider = Provider.of<HistoryProvider>(context);
|
||||||
HistoryProvider _historyStatic = HistoryProvider('');
|
HistoryProvider _historyStatic = HistoryProvider('');
|
||||||
MyWalletsProvider _myWalletProvider =
|
MyWalletsProvider _myWalletProvider =
|
||||||
|
@ -28,11 +27,7 @@ class HomeScreen extends StatelessWidget {
|
||||||
|
|
||||||
final bool isWalletsExists = _myWalletProvider.checkIfWalletExist();
|
final bool isWalletsExists = _myWalletProvider.checkIfWalletExist();
|
||||||
|
|
||||||
// walletBox.toMap().forEach((key, value) {
|
var statusBarHeight = MediaQuery.of(context).padding.top;
|
||||||
// if (value.chest == 0) {
|
|
||||||
// print('$key: ${value.derivation}');
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
isTall = false;
|
isTall = false;
|
||||||
ratio = 1;
|
ratio = 1;
|
||||||
|
@ -86,57 +81,6 @@ class HomeScreen extends StatelessWidget {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
appBar: AppBar(
|
|
||||||
toolbarHeight: 60 * ratio,
|
|
||||||
leading: Builder(
|
|
||||||
builder: (context) => IconButton(
|
|
||||||
key: const Key('drawerMenu'),
|
|
||||||
icon: Icon(Icons.menu, color: Colors.grey[850]),
|
|
||||||
onPressed: () => Scaffold.of(context).openDrawer(),
|
|
||||||
)),
|
|
||||||
title: _homeProvider.appBarTitle,
|
|
||||||
actions: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
child: IconButton(
|
|
||||||
key: const Key('searchIcon'),
|
|
||||||
icon: _homeProvider.searchIcon,
|
|
||||||
color: Colors.grey[850],
|
|
||||||
onPressed: () {
|
|
||||||
if (_homeProvider.searchIcon.icon == Icons.search) {
|
|
||||||
_homeProvider.searchIcon = Icon(
|
|
||||||
Icons.close,
|
|
||||||
color: Colors.grey[850],
|
|
||||||
);
|
|
||||||
_homeProvider.appBarTitle = TextField(
|
|
||||||
key: const Key('searchInput'),
|
|
||||||
autofocus: true,
|
|
||||||
controller: _homeProvider.searchQuery,
|
|
||||||
onChanged: (text) {
|
|
||||||
log.d("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: const Color(0xffFFD58D),
|
|
||||||
),
|
|
||||||
backgroundColor: const Color(0xffF9F9F1),
|
backgroundColor: const Color(0xffF9F9F1),
|
||||||
body: Builder(
|
body: Builder(
|
||||||
builder: (ctx) => StatefulWrapper(
|
builder: (ctx) => StatefulWrapper(
|
||||||
|
@ -146,205 +90,264 @@ class HomeScreen extends StatelessWidget {
|
||||||
_historyStatic.snackNode(ctx);
|
_historyStatic.snackNode(ctx);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Column(children: <Widget>[
|
child: Container(
|
||||||
Padding(
|
decoration: const BoxDecoration(
|
||||||
padding: const EdgeInsets.only(top: 20),
|
image: DecorationImage(
|
||||||
child: Row(
|
image: AssetImage("assets/home/background.png"),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
fit: BoxFit.cover,
|
||||||
children: const <Widget>[
|
),
|
||||||
SizedBox(width: 7),
|
|
||||||
Image(
|
|
||||||
image: AssetImage('assets/icon/gecko_final.png'),
|
|
||||||
height: 180),
|
|
||||||
]),
|
|
||||||
),
|
),
|
||||||
Padding(
|
child: Column(
|
||||||
padding: const EdgeInsets.only(top: 15),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: Row(
|
children: <Widget>[
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
Stack(children: <Widget>[
|
||||||
children: const <Widget>[
|
Positioned(
|
||||||
Text(
|
top: statusBarHeight + 10,
|
||||||
"y'a pas de lézard !",
|
left: 15,
|
||||||
textAlign: TextAlign.center,
|
child: Builder(
|
||||||
style: TextStyle(
|
builder: (context) => IconButton(
|
||||||
color: Colors.black,
|
key: const Key('drawerMenu'),
|
||||||
fontSize: 17,
|
icon: const Icon(
|
||||||
fontStyle: FontStyle.italic),
|
Icons.menu,
|
||||||
)
|
color: Colors.white,
|
||||||
]),
|
size: 35,
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(top: isTall ? 100 : 60),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
Column(children: <Widget>[
|
|
||||||
Container(
|
|
||||||
child: ClipOval(
|
|
||||||
child: Material(
|
|
||||||
color: const Color(0xffFFD58D), // button color
|
|
||||||
child: InkWell(
|
|
||||||
splashColor: orangeC, // inkwell color
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(22),
|
|
||||||
child: Image(
|
|
||||||
image: AssetImage(
|
|
||||||
'assets/qrcode-scan.png'),
|
|
||||||
height: 60)),
|
|
||||||
onTap: () async {
|
|
||||||
await _historyProvider.scan(context);
|
|
||||||
}),
|
|
||||||
),
|
),
|
||||||
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
||||||
),
|
),
|
||||||
decoration: const BoxDecoration(
|
),
|
||||||
shape: BoxShape.circle,
|
),
|
||||||
color: Colors.white,
|
const Align(
|
||||||
boxShadow: [
|
child: Image(
|
||||||
BoxShadow(
|
image: AssetImage('assets/home/header.png'),
|
||||||
color: Colors.grey,
|
height: 210),
|
||||||
blurRadius: 4.0,
|
),
|
||||||
offset: Offset(2.0, 2.5),
|
]),
|
||||||
spreadRadius: 0.5)
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 15),
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
Shadow(
|
||||||
|
offset: Offset(0, 0),
|
||||||
|
blurRadius: 20,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
colors: [
|
||||||
|
Colors.transparent,
|
||||||
|
Colors.black.withOpacity(0.9),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
child: Column(children: <Widget>[
|
||||||
const Text(
|
Padding(
|
||||||
"Payer par QR-Code",
|
padding: EdgeInsets.only(top: isTall ? 240 : 130),
|
||||||
textAlign: TextAlign.center,
|
child: Row(
|
||||||
style: TextStyle(color: Colors.black, fontSize: 16),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
)
|
children: <Widget>[
|
||||||
])
|
Column(children: <Widget>[
|
||||||
]),
|
Container(
|
||||||
),
|
child: ClipOval(
|
||||||
Padding(
|
child: Material(
|
||||||
padding: const EdgeInsets.only(top: 50),
|
color: orangeC, // button color
|
||||||
child: Row(
|
child: InkWell(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
child: const Padding(
|
||||||
children: <Widget>[
|
padding: EdgeInsets.all(18),
|
||||||
Column(children: <Widget>[
|
child: Image(
|
||||||
Container(
|
image: AssetImage(
|
||||||
child: ClipOval(
|
'assets/home/loupe.png'),
|
||||||
child: Material(
|
height: 70)),
|
||||||
color: const Color(0xffFFD58D), // button color
|
onTap: () {
|
||||||
child: InkWell(
|
// Navigator.push(
|
||||||
splashColor: orangeC, // inkwell color
|
// context,
|
||||||
child: const Padding(
|
// MaterialPageRoute(
|
||||||
padding: EdgeInsets.symmetric(
|
// builder: (context) {
|
||||||
horizontal: 20, vertical: 16),
|
// return TemplateScreen();
|
||||||
child: Image(
|
// }),
|
||||||
image:
|
// );
|
||||||
AssetImage('assets/blockchain.png'),
|
}),
|
||||||
height: 70)),
|
),
|
||||||
onTap: () {
|
),
|
||||||
// Navigator.push(
|
decoration: const BoxDecoration(
|
||||||
// context,
|
shape: BoxShape.circle,
|
||||||
// MaterialPageRoute(
|
color: Colors.black,
|
||||||
// builder: (context) {
|
boxShadow: [
|
||||||
// return TemplateScreen();
|
BoxShadow(
|
||||||
// }),
|
blurRadius: 2,
|
||||||
// );
|
offset: Offset(1, 1.5),
|
||||||
}),
|
spreadRadius: 0.5)
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
decoration: const BoxDecoration(
|
),
|
||||||
shape: BoxShape.circle,
|
const SizedBox(height: 12),
|
||||||
color: Colors.white,
|
const Text(
|
||||||
boxShadow: [
|
"Rechercher un\nportfeuille",
|
||||||
BoxShadow(
|
textAlign: TextAlign.center,
|
||||||
color: Colors.grey,
|
style: TextStyle(
|
||||||
blurRadius: 4.0,
|
color: Colors.white,
|
||||||
offset: Offset(2.0, 2.5),
|
fontSize: 17,
|
||||||
spreadRadius: 0.5)
|
fontWeight: FontWeight.w500),
|
||||||
],
|
)
|
||||||
),
|
]),
|
||||||
),
|
const SizedBox(width: 120),
|
||||||
const SizedBox(height: 12),
|
Column(children: <Widget>[
|
||||||
const Text(
|
Container(
|
||||||
"Explorer\n",
|
child: ClipOval(
|
||||||
textAlign: TextAlign.center,
|
key: const Key('manageWallets'),
|
||||||
style: TextStyle(color: Colors.black, fontSize: 16),
|
child: Material(
|
||||||
)
|
color: orangeC, // button color
|
||||||
]),
|
child: InkWell(
|
||||||
const SizedBox(width: 140),
|
child: const Padding(
|
||||||
Column(children: <Widget>[
|
padding: EdgeInsets.all(18),
|
||||||
Container(
|
child: Image(
|
||||||
child: ClipOval(
|
image: AssetImage(
|
||||||
key: const Key('manageWallets'),
|
'assets/home/wallet.png'),
|
||||||
child: Material(
|
height: 75)),
|
||||||
color: const Color(0xffFFD58D), // button color
|
onTap: () {
|
||||||
child: InkWell(
|
WalletData defaultWallet =
|
||||||
splashColor: orangeC, // inkwell color
|
_myWalletProvider
|
||||||
child: const Padding(
|
.getDefaultWallet(
|
||||||
padding: EdgeInsets.all(23),
|
configBox.get(
|
||||||
child: Image(
|
'currentChest'));
|
||||||
image: AssetImage('assets/lock.png'),
|
isWalletsExists
|
||||||
height: 57)),
|
? Navigator.push(context,
|
||||||
onTap: () {
|
MaterialPageRoute(
|
||||||
WalletData defaultWallet =
|
builder: (context) {
|
||||||
_myWalletProvider.getDefaultWallet(
|
return UnlockingWallet(
|
||||||
configBox.get('currentChest'));
|
wallet: defaultWallet,
|
||||||
isWalletsExists
|
action: "mywallets",
|
||||||
? Navigator.push(context,
|
);
|
||||||
MaterialPageRoute(builder: (context) {
|
}))
|
||||||
return UnlockingWallet(
|
|
||||||
wallet: defaultWallet,
|
|
||||||
action: "mywallets",
|
|
||||||
);
|
|
||||||
}))
|
|
||||||
|
|
||||||
// Navigator.pushNamed(
|
// Navigator.pushNamed(
|
||||||
// context, '/mywallets')
|
// context, '/mywallets')
|
||||||
: Navigator.push(context,
|
: Navigator.push(context,
|
||||||
MaterialPageRoute(builder: (context) {
|
MaterialPageRoute(
|
||||||
return const NoKeyChainScreen();
|
builder: (context) {
|
||||||
}));
|
return const NoKeyChainScreen();
|
||||||
}),
|
}));
|
||||||
),
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
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),
|
||||||
|
)
|
||||||
|
])
|
||||||
|
]),
|
||||||
),
|
),
|
||||||
decoration: const BoxDecoration(
|
Padding(
|
||||||
shape: BoxShape.circle,
|
padding: const EdgeInsets.only(top: 40),
|
||||||
color: Colors.white,
|
child: Row(
|
||||||
boxShadow: [
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
BoxShadow(
|
children: <Widget>[
|
||||||
color: Colors.grey,
|
Column(children: <Widget>[
|
||||||
blurRadius: 4.0,
|
Container(
|
||||||
offset: Offset(2.0, 2.5),
|
child: ClipOval(
|
||||||
spreadRadius: 0.5)
|
child: Material(
|
||||||
],
|
color: orangeC, // button color
|
||||||
|
child: InkWell(
|
||||||
|
child: const Padding(
|
||||||
|
padding: EdgeInsets.all(22),
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage(
|
||||||
|
'assets/home/qrcode.png'),
|
||||||
|
height: 60)),
|
||||||
|
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)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
const Text(
|
||||||
|
"Scanner un\nQR code",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 17,
|
||||||
|
fontWeight: FontWeight.w500),
|
||||||
|
)
|
||||||
|
])
|
||||||
|
]),
|
||||||
),
|
),
|
||||||
),
|
]),
|
||||||
const SizedBox(height: 12),
|
// bottomNavigationBar: BottomNavigationBar(
|
||||||
const Text(
|
// backgroundColor: Color(0xffFFD58D),
|
||||||
"Gérer mes\nportefeuilles",
|
// fixedColor: Colors.grey[850],
|
||||||
textAlign: TextAlign.center,
|
// unselectedItemColor: Color(0xffBD935C),
|
||||||
style: TextStyle(color: Colors.black, fontSize: 16),
|
// type: BottomNavigationBarType.fixed,
|
||||||
)
|
// onTap: (index) {
|
||||||
])
|
// _homeProvider.currentIndex = index;
|
||||||
]),
|
// },
|
||||||
)
|
// currentIndex: _homeProvider.currentIndex,
|
||||||
]),
|
// items: [
|
||||||
// bottomNavigationBar: BottomNavigationBar(
|
// BottomNavigationBarItem(
|
||||||
// backgroundColor: Color(0xffFFD58D),
|
// icon: Image.asset('assets/block-space-disabled.png', height: 26),
|
||||||
// fixedColor: Colors.grey[850],
|
// activeIcon: Image.asset('assets/blockchain.png', height: 26),
|
||||||
// unselectedItemColor: Color(0xffBD935C),
|
// label: 'Explorateur',
|
||||||
// type: BottomNavigationBarType.fixed,
|
// ),
|
||||||
// onTap: (index) {
|
// BottomNavigationBarItem(
|
||||||
// _homeProvider.currentIndex = index;
|
// icon: Icon(Icons.lock),
|
||||||
// },
|
// label: 'Mes portefeuilles',
|
||||||
// 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',
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -5,7 +5,7 @@ description: Pay with G1.
|
||||||
# pub.dev using `pub publish`. This is preferred for private packages.
|
# pub.dev using `pub publish`. This is preferred for private packages.
|
||||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
version: 0.0.2+11
|
version: 0.0.3+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.7.0 <3.0.0"
|
sdk: ">=2.7.0 <3.0.0"
|
||||||
|
@ -80,6 +80,7 @@ flutter:
|
||||||
- images/
|
- images/
|
||||||
- config/gva_endpoints.json
|
- config/gva_endpoints.json
|
||||||
- assets/
|
- assets/
|
||||||
|
- assets/home/
|
||||||
- assets/customs/
|
- assets/customs/
|
||||||
- assets/avatars/
|
- assets/avatars/
|
||||||
- assets/chests/
|
- assets/chests/
|
||||||
|
|