New home style

This commit is contained in:
poka 2021-11-19 00:17:00 +01:00
parent 679d1511c1
commit 9d5c71b857
10 changed files with 277 additions and 249 deletions

BIN
assets/home/background.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 KiB

9
assets/home/background.svg Executable file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 16 MiB

BIN
assets/home/header.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

14
assets/home/header.svg Executable file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 30 KiB

BIN
assets/home/loupe.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

1
assets/home/loupe.svg Executable file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 57 KiB

BIN
assets/home/qrcode.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/home/wallet.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -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,79 +90,82 @@ 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),
]),
), ),
),
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,
),
onPressed: () => Scaffold.of(context).openDrawer(),
),
),
),
const Align(
child: Image(
image: AssetImage('assets/home/header.png'),
height: 210),
),
]),
Padding( Padding(
padding: const EdgeInsets.only(top: 15), padding: const EdgeInsets.only(top: 15),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: const <Widget>[
Text( Text(
"y'a pas de lézard !", "y'a pas de lézard ;-)",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.white,
fontSize: 24,
fontWeight: FontWeight.w700,
shadows: <Shadow>[
Shadow(
offset: Offset(0, 0),
blurRadius: 20,
color: Colors.black, color: Colors.black,
fontSize: 17, ),
fontStyle: FontStyle.italic), Shadow(
offset: Offset(0, 0),
blurRadius: 20,
color: Colors.black,
),
],
),
) )
]), ]),
), ),
Padding( Expanded(
padding: EdgeInsets.only(top: isTall ? 100 : 60), flex: 1,
child: Row( child: Container(
mainAxisAlignment: MainAxisAlignment.center, decoration: BoxDecoration(
children: <Widget>[ gradient: LinearGradient(
Column(children: <Widget>[ begin: Alignment.topCenter,
Container( end: Alignment.bottomCenter,
child: ClipOval( colors: [
child: Material( Colors.transparent,
color: const Color(0xffFFD58D), // button color Colors.black.withOpacity(0.9),
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);
}),
),
),
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey,
blurRadius: 4.0,
offset: Offset(2.0, 2.5),
spreadRadius: 0.5)
], ],
), ),
), ),
const SizedBox(height: 12), child: Column(children: <Widget>[
const Text(
"Payer par QR-Code",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.black, fontSize: 16),
)
])
]),
),
Padding( Padding(
padding: const EdgeInsets.only(top: 50), padding: EdgeInsets.only(top: isTall ? 240 : 130),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
@ -226,15 +173,13 @@ class HomeScreen extends StatelessWidget {
Container( Container(
child: ClipOval( child: ClipOval(
child: Material( child: Material(
color: const Color(0xffFFD58D), // button color color: orangeC, // button color
child: InkWell( child: InkWell(
splashColor: orangeC, // inkwell color
child: const Padding( child: const Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.all(18),
horizontal: 20, vertical: 16),
child: Image( child: Image(
image: image: AssetImage(
AssetImage('assets/blockchain.png'), 'assets/home/loupe.png'),
height: 70)), height: 70)),
onTap: () { onTap: () {
// Navigator.push( // Navigator.push(
@ -249,44 +194,49 @@ class HomeScreen extends StatelessWidget {
), ),
decoration: const BoxDecoration( decoration: const BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: Colors.white, color: Colors.black,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey, blurRadius: 2,
blurRadius: 4.0, offset: Offset(1, 1.5),
offset: Offset(2.0, 2.5),
spreadRadius: 0.5) spreadRadius: 0.5)
], ],
), ),
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
const Text( const Text(
"Explorer\n", "Rechercher un\nportfeuille",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.black, fontSize: 16), style: TextStyle(
color: Colors.white,
fontSize: 17,
fontWeight: FontWeight.w500),
) )
]), ]),
const SizedBox(width: 140), const SizedBox(width: 120),
Column(children: <Widget>[ Column(children: <Widget>[
Container( Container(
child: ClipOval( child: ClipOval(
key: const Key('manageWallets'), key: const Key('manageWallets'),
child: Material( child: Material(
color: const Color(0xffFFD58D), // button color color: orangeC, // button color
child: InkWell( child: InkWell(
splashColor: orangeC, // inkwell color
child: const Padding( child: const Padding(
padding: EdgeInsets.all(23), padding: EdgeInsets.all(18),
child: Image( child: Image(
image: AssetImage('assets/lock.png'), image: AssetImage(
height: 57)), 'assets/home/wallet.png'),
height: 75)),
onTap: () { onTap: () {
WalletData defaultWallet = WalletData defaultWallet =
_myWalletProvider.getDefaultWallet( _myWalletProvider
configBox.get('currentChest')); .getDefaultWallet(
configBox.get(
'currentChest'));
isWalletsExists isWalletsExists
? Navigator.push(context, ? Navigator.push(context,
MaterialPageRoute(builder: (context) { MaterialPageRoute(
builder: (context) {
return UnlockingWallet( return UnlockingWallet(
wallet: defaultWallet, wallet: defaultWallet,
action: "mywallets", action: "mywallets",
@ -296,7 +246,8 @@ class HomeScreen extends StatelessWidget {
// Navigator.pushNamed( // Navigator.pushNamed(
// context, '/mywallets') // context, '/mywallets')
: Navigator.push(context, : Navigator.push(context,
MaterialPageRoute(builder: (context) { MaterialPageRoute(
builder: (context) {
return const NoKeyChainScreen(); return const NoKeyChainScreen();
})); }));
}), }),
@ -304,12 +255,11 @@ class HomeScreen extends StatelessWidget {
), ),
decoration: const BoxDecoration( decoration: const BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: Colors.white, color: Colors.black,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey, blurRadius: 2,
blurRadius: 4.0, offset: Offset(1, 1.5),
offset: Offset(2.0, 2.5),
spreadRadius: 0.5) spreadRadius: 0.5)
], ],
), ),
@ -318,11 +268,60 @@ class HomeScreen extends StatelessWidget {
const Text( const Text(
"Gérer mes\nportefeuilles", "Gérer mes\nportefeuilles",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.black, fontSize: 16), 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(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),
) )
])
]),
),
]), ]),
// bottomNavigationBar: BottomNavigationBar( // bottomNavigationBar: BottomNavigationBar(
// backgroundColor: Color(0xffFFD58D), // backgroundColor: Color(0xffFFD58D),
@ -346,6 +345,10 @@ class HomeScreen extends StatelessWidget {
// ], // ],
// ), // ),
), ),
)
]),
),
),
), ),
); );
} }

View File

@ -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/