Skip to content
Snippets Groups Projects
Commit 6d69d039 authored by poka's avatar poka
Browse files

Improve responsive

parent 1b7c01bf
No related branches found
No related tags found
No related merge requests found
...@@ -41,315 +41,310 @@ class HomeScreen extends StatelessWidget { ...@@ -41,315 +41,310 @@ class HomeScreen extends StatelessWidget {
ratio = 1.125; ratio = 1.125;
} }
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
drawer: Drawer( drawer: Drawer(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: ListView(padding: EdgeInsets.zero, children: <Widget>[ child: ListView(padding: EdgeInsets.zero, children: <Widget>[
DrawerHeader( DrawerHeader(
child: Column(children: const <Widget>[ child: Column(children: const <Widget>[
SizedBox(height: 0), 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)
],
),
),
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(
onInit: () {
WidgetsBinding.instance.addPostFrameCallback((_) {
DubpRust.setup();
_historyStatic.snackNode(ctx);
});
},
child: Column(children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[
SizedBox(width: 7),
Image( Image(
image: AssetImage('assets/icon/gecko_final.png'), image: AssetImage('assets/icon/gecko_final.png'),
height: 130), height: 180),
]), ]),
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)
],
),
),
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(
padding: const EdgeInsets.symmetric(horizontal: 16), padding: const EdgeInsets.only(top: 15),
child: IconButton( child: Row(
key: const Key('searchIcon'), mainAxisAlignment: MainAxisAlignment.center,
icon: _homeProvider.searchIcon, children: const <Widget>[
color: Colors.grey[850], Text(
onPressed: () { "y'a pas de lézard !",
if (_homeProvider.searchIcon.icon == Icons.search) { textAlign: TextAlign.center,
_homeProvider.searchIcon = Icon( style: TextStyle(
Icons.close, color: Colors.black,
color: Colors.grey[850], fontSize: 17,
); fontStyle: FontStyle.italic),
_homeProvider.appBarTitle = TextField( )
key: const Key('searchInput'), ]),
autofocus: true, ),
controller: _homeProvider.searchQuery, Padding(
onChanged: (text) { padding: EdgeInsets.only(top: isTall ? 70 : 60),
log.d("Clé tappé: $text"); child: Row(
final String searchResult = mainAxisAlignment: MainAxisAlignment.center,
_historyProvider.isPubkey(context, text); children: <Widget>[
if (searchResult != '') { Column(children: <Widget>[
_homeProvider.currentIndex = 0; Container(
} child: ClipOval(
}, child: Material(
style: TextStyle( color: const Color(0xffFFD58D), // button color
color: Colors.grey[850], 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: InputDecoration( ),
prefixIcon: decoration: const BoxDecoration(
Icon(Icons.search, color: Colors.grey[850]), shape: BoxShape.circle,
hintText: "Rechercher ...", color: Colors.white,
hintStyle: TextStyle(color: Colors.grey[850])), boxShadow: [
); BoxShadow(
_homeProvider.handleSearchStart(); color: Colors.grey,
} else { blurRadius: 4.0,
_homeProvider.handleSearchEnd(); offset: Offset(2.0, 2.5),
} spreadRadius: 0.5)
})) ],
], ),
backgroundColor: const Color(0xffFFD58D), ),
), const SizedBox(height: 12),
backgroundColor: const Color(0xffF9F9F1), const Text(
body: Builder( "Payer par QR-Code",
builder: (ctx) => StatefulWrapper( textAlign: TextAlign.center,
onInit: () { style: TextStyle(color: Colors.black, fontSize: 16),
WidgetsBinding.instance.addPostFrameCallback((_) { )
DubpRust.setup(); ])
_historyStatic.snackNode(ctx); ]),
}); ),
}, Padding(
child: Column(children: <Widget>[ padding: const EdgeInsets.only(top: 50),
Padding( child: Row(
padding: const EdgeInsets.only(top: 20), mainAxisAlignment: MainAxisAlignment.center,
child: Row( children: <Widget>[
mainAxisAlignment: MainAxisAlignment.center, Column(children: <Widget>[
children: const <Widget>[ Container(
SizedBox(width: 7), child: ClipOval(
Image( child: Material(
image: color: const Color(0xffFFD58D), // button color
AssetImage('assets/icon/gecko_final.png'), child: InkWell(
height: 180), splashColor: orangeC, // inkwell color
])), child: const Padding(
Padding( padding: EdgeInsets.symmetric(
padding: const EdgeInsets.only(top: 15), horizontal: 20, vertical: 16),
child: Row( child: Image(
mainAxisAlignment: MainAxisAlignment.center, image:
children: const <Widget>[ AssetImage('assets/blockchain.png'),
Text( height: 70)),
"y'a pas de lézard !", onTap: () {
textAlign: TextAlign.center, // Navigator.push(
style: TextStyle( // context,
color: Colors.black, // MaterialPageRoute(
fontSize: 17, // builder: (context) {
fontStyle: FontStyle.italic), // return TemplateScreen();
) // }),
])), // );
Padding( }),
padding: const EdgeInsets.only(top: 60), ),
child: Row( ),
mainAxisAlignment: MainAxisAlignment.center, decoration: const BoxDecoration(
children: <Widget>[ shape: BoxShape.circle,
Column(children: <Widget>[ color: Colors.white,
Container( boxShadow: [
child: ClipOval( BoxShadow(
child: Material( color: Colors.grey,
color: const Color( blurRadius: 4.0,
0xffFFD58D), // button color offset: Offset(2.0, 2.5),
child: InkWell( spreadRadius: 0.5)
splashColor: orangeC, // inkwell color ],
child: const Padding( ),
padding: EdgeInsets.all(22), ),
child: Image( const SizedBox(height: 12),
image: AssetImage( const Text(
'assets/qrcode-scan.png'), "Explorer\n",
height: 60)), textAlign: TextAlign.center,
onTap: () async { style: TextStyle(color: Colors.black, fontSize: 16),
await _historyProvider )
.scan(context); ]),
}), const SizedBox(width: 140),
), Column(children: <Widget>[
), Container(
decoration: const BoxDecoration( child: ClipOval(
shape: BoxShape.circle, key: const Key('manageWallets'),
color: Colors.white, child: Material(
boxShadow: [ color: const Color(0xffFFD58D), // button color
BoxShadow( child: InkWell(
color: Colors.grey, splashColor: orangeC, // inkwell color
blurRadius: 4.0, child: const Padding(
offset: Offset(2.0, 2.5), padding: EdgeInsets.all(23),
spreadRadius: 0.5) child: Image(
], image: AssetImage('assets/lock.png'),
), height: 57)),
), onTap: () {
const SizedBox(height: 12), isWalletsExists
const Text( ? Navigator.push(context,
"Payer par QR-Code", MaterialPageRoute(builder: (context) {
textAlign: TextAlign.center, return UnlockingWallet(
style: TextStyle( wallet: defaultWallet,
color: Colors.black, fontSize: 16), action: "mywallets",
) );
]) }))
])),
Padding(
padding: const EdgeInsets.only(top: 50),
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.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: <Widget>[
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: () {
isWalletsExists
? 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( MaterialPageRoute(builder: (context) {
builder: (context) { return const NoKeyChainScreen();
return const NoKeyChainScreen(); }));
})); }),
}), ),
), ),
), decoration: const BoxDecoration(
decoration: const BoxDecoration( shape: BoxShape.circle,
shape: BoxShape.circle, color: Colors.white,
color: Colors.white, boxShadow: [
boxShadow: [ BoxShadow(
BoxShadow( color: Colors.grey,
color: Colors.grey, blurRadius: 4.0,
blurRadius: 4.0, offset: Offset(2.0, 2.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( "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.black, fontSize: 16), ])
)
])
]))
]), ]),
// bottomNavigationBar: BottomNavigationBar( )
// backgroundColor: Color(0xffFFD58D), ]),
// fixedColor: Colors.grey[850], // bottomNavigationBar: BottomNavigationBar(
// unselectedItemColor: Color(0xffBD935C), // backgroundColor: Color(0xffFFD58D),
// type: BottomNavigationBarType.fixed, // fixedColor: Colors.grey[850],
// onTap: (index) { // unselectedItemColor: Color(0xffBD935C),
// _homeProvider.currentIndex = index; // type: BottomNavigationBarType.fixed,
// }, // onTap: (index) {
// currentIndex: _homeProvider.currentIndex, // _homeProvider.currentIndex = index;
// items: [ // },
// BottomNavigationBarItem( // currentIndex: _homeProvider.currentIndex,
// icon: Image.asset('assets/block-space-disabled.png', height: 26), // items: [
// activeIcon: Image.asset('assets/blockchain.png', height: 26), // BottomNavigationBarItem(
// label: 'Explorateur', // icon: Image.asset('assets/block-space-disabled.png', height: 26),
// ), // activeIcon: Image.asset('assets/blockchain.png', height: 26),
// BottomNavigationBarItem( // label: 'Explorateur',
// icon: Icon(Icons.lock), // ),
// label: 'Mes portefeuilles', // BottomNavigationBarItem(
// ), // icon: Icon(Icons.lock),
// ], // label: 'Mes portefeuilles',
// ), // ),
))); // ],
// ),
),
),
);
} }
} }
......
...@@ -52,14 +52,13 @@ class UnlockingWallet extends StatelessWidget { ...@@ -52,14 +52,13 @@ class UnlockingWallet extends StatelessWidget {
// backgroundColor: Colors.brown[600], // backgroundColor: Colors.brown[600],
body: SafeArea( body: SafeArea(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
const SizedBox(height: 20),
Expanded( Expanded(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
const SizedBox(height: 50), SizedBox(height: isTall ? 80 : 20),
Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
Image.asset( Image.asset(
'assets/chests/${currentChest.imageName}', 'assets/chests/${currentChest.imageName}',
height: 150, height: 120 * ratio,
), ),
const SizedBox(width: 5), const SizedBox(width: 5),
SizedBox( SizedBox(
...@@ -73,7 +72,7 @@ class UnlockingWallet extends StatelessWidget { ...@@ -73,7 +72,7 @@ class UnlockingWallet extends StatelessWidget {
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
)), )),
]), ]),
const SizedBox(height: 50), SizedBox(height: 30 * ratio),
const SizedBox( const SizedBox(
width: 400, width: 400,
child: Text( child: Text(
...@@ -83,9 +82,9 @@ class UnlockingWallet extends StatelessWidget { ...@@ -83,9 +82,9 @@ class UnlockingWallet extends StatelessWidget {
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w400), fontWeight: FontWeight.w400),
)), )),
const SizedBox(height: 50), SizedBox(height: 40 * ratio),
pinForm(context, _pinLenght), pinForm(context, _pinLenght),
const SizedBox(height: 5), SizedBox(height: 3 * ratio),
InkWell( InkWell(
key: const Key('chooseChest'), key: const Key('chooseChest'),
onTap: () { onTap: () {
...@@ -127,7 +126,7 @@ class UnlockingWallet extends StatelessWidget { ...@@ -127,7 +126,7 @@ class UnlockingWallet extends StatelessWidget {
return Form( return Form(
key: formKey, key: formKey,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 30), padding: EdgeInsets.symmetric(vertical: 5 * ratio, horizontal: 30),
child: PinCodeTextField( child: PinCodeTextField(
autoFocus: true, autoFocus: true,
appContext: context, appContext: context,
...@@ -151,7 +150,7 @@ class UnlockingWallet extends StatelessWidget { ...@@ -151,7 +150,7 @@ class UnlockingWallet extends StatelessWidget {
borderWidth: 4, borderWidth: 4,
shape: PinCodeFieldShape.box, shape: PinCodeFieldShape.box,
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
fieldHeight: 60, fieldHeight: 50 * ratio,
fieldWidth: 50, fieldWidth: 50,
activeFillColor: hasError ? Colors.blueAccent : Colors.black, activeFillColor: hasError ? Colors.blueAccent : Colors.black,
), ),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment