diff --git a/assets/home/background.png b/assets/home/background.png new file mode 100755 index 0000000..55f24c7 Binary files /dev/null and b/assets/home/background.png differ diff --git a/assets/home/background.svg b/assets/home/background.svg new file mode 100755 index 0000000..71ecdcc --- /dev/null +++ b/assets/home/background.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/home/header.png b/assets/home/header.png new file mode 100755 index 0000000..9d66bb0 Binary files /dev/null and b/assets/home/header.png differ diff --git a/assets/home/header.svg b/assets/home/header.svg new file mode 100755 index 0000000..171ccc8 --- /dev/null +++ b/assets/home/header.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/home/loupe.png b/assets/home/loupe.png new file mode 100755 index 0000000..891ab51 Binary files /dev/null and b/assets/home/loupe.png differ diff --git a/assets/home/loupe.svg b/assets/home/loupe.svg new file mode 100755 index 0000000..a9fc7ef --- /dev/null +++ b/assets/home/loupe.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/home/qrcode.png b/assets/home/qrcode.png new file mode 100755 index 0000000..136f3c9 Binary files /dev/null and b/assets/home/qrcode.png differ diff --git a/assets/home/wallet.png b/assets/home/wallet.png new file mode 100755 index 0000000..ddadaec Binary files /dev/null and b/assets/home/wallet.png differ diff --git a/lib/screens/home.dart b/lib/screens/home.dart index f305064..ac99a87 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -2,7 +2,6 @@ import 'package:dubp/dubp.dart'; import 'package:gecko/globals.dart'; import 'package:gecko/models/chest_provider.dart'; import 'package:gecko/models/history.dart'; -import 'package:gecko/models/home.dart'; import 'package:flutter/material.dart'; import 'package:gecko/models/my_wallets.dart'; import 'package:gecko/models/wallet_data.dart'; @@ -19,7 +18,7 @@ class HomeScreen extends StatelessWidget { @override Widget build(BuildContext context) { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); - HomeProvider _homeProvider = Provider.of(context); + // HomeProvider _homeProvider = Provider.of(context); HistoryProvider _historyProvider = Provider.of(context); HistoryProvider _historyStatic = HistoryProvider(''); MyWalletsProvider _myWalletProvider = @@ -28,11 +27,7 @@ class HomeScreen extends StatelessWidget { final bool isWalletsExists = _myWalletProvider.checkIfWalletExist(); - // walletBox.toMap().forEach((key, value) { - // if (value.chest == 0) { - // print('$key: ${value.derivation}'); - // } - // }); + var statusBarHeight = MediaQuery.of(context).padding.top; isTall = false; 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), body: Builder( builder: (ctx) => StatefulWrapper( @@ -146,205 +90,264 @@ class HomeScreen extends StatelessWidget { _historyStatic.snackNode(ctx); }); }, - child: Column(children: [ - Padding( - padding: const EdgeInsets.only(top: 20), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: const [ - SizedBox(width: 7), - Image( - image: AssetImage('assets/icon/gecko_final.png'), - height: 180), - ]), + child: Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/home/background.png"), + fit: BoxFit.cover, + ), ), - Padding( - padding: const EdgeInsets.only(top: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: const [ - Text( - "y'a pas de lézard !", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, - fontSize: 17, - fontStyle: FontStyle.italic), - ) - ]), - ), - Padding( - padding: EdgeInsets.only(top: isTall ? 100 : 60), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Column(children: [ - 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); - }), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack(children: [ + 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(), ), - 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 Align( + child: Image( + image: AssetImage('assets/home/header.png'), + height: 210), + ), + ]), + Padding( + padding: const EdgeInsets.only(top: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: const [ + Text( + "y'a pas de lézard ;-)", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 24, + fontWeight: FontWeight.w700, + shadows: [ + 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), - const Text( - "Payer par QR-Code", - textAlign: TextAlign.center, - style: TextStyle(color: Colors.black, fontSize: 16), - ) - ]) - ]), - ), - Padding( - padding: const EdgeInsets.only(top: 50), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Column(children: [ - Container( - child: ClipOval( - child: Material( - color: const Color(0xffFFD58D), // button color - child: InkWell( - splashColor: orangeC, // inkwell color - child: const Padding( - padding: EdgeInsets.symmetric( - horizontal: 20, vertical: 16), - child: Image( - image: - AssetImage('assets/blockchain.png'), - height: 70)), - onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) { - // return TemplateScreen(); - // }), - // ); - }), - ), - ), - 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), - const Text( - "Explorer\n", - textAlign: TextAlign.center, - style: TextStyle(color: Colors.black, fontSize: 16), - ) - ]), - const SizedBox(width: 140), - Column(children: [ - Container( - child: ClipOval( - key: const Key('manageWallets'), - child: Material( - color: const Color(0xffFFD58D), // button color - child: InkWell( - splashColor: orangeC, // inkwell color - child: const Padding( - padding: EdgeInsets.all(23), - child: Image( - image: AssetImage('assets/lock.png'), - height: 57)), - onTap: () { - WalletData defaultWallet = - _myWalletProvider.getDefaultWallet( - configBox.get('currentChest')); - isWalletsExists - ? Navigator.push(context, - MaterialPageRoute(builder: (context) { - return UnlockingWallet( - wallet: defaultWallet, - action: "mywallets", - ); - })) + child: Column(children: [ + Padding( + padding: EdgeInsets.only(top: isTall ? 240 : 130), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Column(children: [ + Container( + child: ClipOval( + child: Material( + color: orangeC, // button color + child: InkWell( + child: const Padding( + padding: EdgeInsets.all(18), + child: Image( + image: AssetImage( + 'assets/home/loupe.png'), + height: 70)), + onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) { + // return TemplateScreen(); + // }), + // ); + }), + ), + ), + 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( + "Rechercher un\nportfeuille", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 17, + fontWeight: FontWeight.w500), + ) + ]), + const SizedBox(width: 120), + Column(children: [ + 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')); + isWalletsExists + ? Navigator.push(context, + MaterialPageRoute( + builder: (context) { + return UnlockingWallet( + wallet: defaultWallet, + action: "mywallets", + ); + })) - // Navigator.pushNamed( - // context, '/mywallets') - : Navigator.push(context, - MaterialPageRoute(builder: (context) { - return const NoKeyChainScreen(); - })); - }), - ), + // Navigator.pushNamed( + // context, '/mywallets') + : Navigator.push(context, + MaterialPageRoute( + 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( - shape: BoxShape.circle, - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.grey, - blurRadius: 4.0, - offset: Offset(2.0, 2.5), - spreadRadius: 0.5) - ], + Padding( + padding: const EdgeInsets.only(top: 40), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Column(children: [ + 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), + ) + ]) + ]), ), - ), - const SizedBox(height: 12), - const Text( - "Gérer mes\nportefeuilles", - textAlign: TextAlign.center, - style: TextStyle(color: Colors.black, fontSize: 16), - ) - ]) - ]), - ) - ]), - // 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', - // ), - // ], - // ), + ]), + // 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', + // ), + // ], + // ), + ), + ) + ]), + ), ), ), ); diff --git a/pubspec.yaml b/pubspec.yaml index 7de7c38..c132693 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ description: Pay with G1. # 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 -version: 0.0.2+11 +version: 0.0.3+1 environment: sdk: ">=2.7.0 <3.0.0" @@ -80,6 +80,7 @@ flutter: - images/ - config/gva_endpoints.json - assets/ + - assets/home/ - assets/customs/ - assets/avatars/ - assets/chests/