UX: improve appBar in safeHome
This commit is contained in:
parent
a28df90c18
commit
622ceda579
|
@ -12,6 +12,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:gecko/screens/wallet_view.dart';
|
||||
import 'package:gecko/widgets/bottom_app_bar.dart';
|
||||
import 'package:gecko/widgets/header_profile.dart';
|
||||
import 'package:gecko/widgets/page_route_no_transition.dart';
|
||||
import 'package:graphql_flutter/graphql_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
@ -361,7 +362,7 @@ class ActivityScreen extends StatelessWidget with ChangeNotifier {
|
|||
// _cesiumPlusProvider.avatarCancelToken.cancel('cancelled');
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
PageNoTransit(builder: (context) {
|
||||
return WalletViewScreen(
|
||||
address: repository[1],
|
||||
username: username ?? '',
|
||||
|
|
|
@ -464,7 +464,7 @@ class WalletOptions extends StatelessWidget {
|
|||
// _historyProvider.nPage = 1;
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
PageNoTransit(builder: (context) {
|
||||
return ActivityScreen(
|
||||
address: walletProvider.address.text,
|
||||
avatar: wallet.imageCustomPath == null
|
||||
|
|
|
@ -63,7 +63,9 @@ class WalletsHome extends StatelessWidget {
|
|||
backgroundColor: const Color(0xffFFD58D),
|
||||
),
|
||||
bottomNavigationBar: myWalletProvider.lastFlyBy == ''
|
||||
? const GeckoBottomAppBar()
|
||||
? const GeckoBottomAppBar(
|
||||
actualRoute: 'safeHome',
|
||||
)
|
||||
: dragInfo(context),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
|
@ -330,13 +332,14 @@ class WalletsHome extends StatelessWidget {
|
|||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
decoration: const BoxDecoration(
|
||||
gradient: RadialGradient(
|
||||
radius: 0.8,
|
||||
colors: [
|
||||
Color.fromARGB(255, 255, 255, 211),
|
||||
yellowC,
|
||||
],
|
||||
)),
|
||||
gradient: RadialGradient(
|
||||
radius: 0.8,
|
||||
colors: [
|
||||
Color.fromARGB(255, 255, 255, 211),
|
||||
yellowC,
|
||||
],
|
||||
),
|
||||
),
|
||||
child:
|
||||
// SvgPicture.asset('assets/chopp-gecko2.png',
|
||||
// semanticsLabel: 'Gecko', height: 48),
|
||||
|
|
|
@ -12,9 +12,8 @@ import 'package:gecko/screens/search.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
|
||||
class GeckoBottomAppBar extends StatelessWidget {
|
||||
const GeckoBottomAppBar({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
const GeckoBottomAppBar({Key? key, this.actualRoute = ''}) : super(key: key);
|
||||
final String actualRoute;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -24,8 +23,8 @@ class GeckoBottomAppBar extends StatelessWidget {
|
|||
Provider.of<WalletsProfilesProvider>(context, listen: false);
|
||||
|
||||
final size = MediaQuery.of(context).size;
|
||||
|
||||
const bool showBottomBar = true;
|
||||
final lockAction = actualRoute == 'safeHome';
|
||||
|
||||
return Visibility(
|
||||
visible: showBottomBar,
|
||||
|
@ -33,15 +32,7 @@ class GeckoBottomAppBar extends StatelessWidget {
|
|||
color: yellowC,
|
||||
width: size.width,
|
||||
height: 80,
|
||||
child:
|
||||
// Stack(
|
||||
// children: [
|
||||
// // CustomPaint(
|
||||
// // size: Size(size.width, 110),
|
||||
// // painter: CustomRoundedButton(),
|
||||
// // ),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.start, children: [
|
||||
// SizedBox(width: 0),
|
||||
child: Row(mainAxisAlignment: MainAxisAlignment.start, children: [
|
||||
const Spacer(),
|
||||
const SizedBox(width: 11),
|
||||
IconButton(
|
||||
|
@ -77,37 +68,66 @@ class GeckoBottomAppBar extends StatelessWidget {
|
|||
),
|
||||
const Spacer(),
|
||||
const SizedBox(width: 15),
|
||||
IconButton(
|
||||
key: keyAppBarChest,
|
||||
iconSize: 60,
|
||||
icon: const Image(image: AssetImage('assets/wallet.png')),
|
||||
onPressed: () async {
|
||||
WalletData? defaultWallet = myWalletProvider.getDefaultWallet();
|
||||
String? pin;
|
||||
if (myWalletProvider.pinCode == '') {
|
||||
pin = await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (homeContext) {
|
||||
return UnlockingWallet(wallet: defaultWallet);
|
||||
},
|
||||
Stack(
|
||||
children: [
|
||||
if (lockAction)
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 0),
|
||||
child: Container(
|
||||
width: 75,
|
||||
height: 75,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border:
|
||||
Border.all(color: orangeC.withOpacity(0), width: 3),
|
||||
gradient: RadialGradient(
|
||||
radius: 0.5,
|
||||
colors: [
|
||||
yellowC,
|
||||
orangeC.withOpacity(0.1),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
IconButton(
|
||||
key: keyAppBarChest,
|
||||
iconSize: 60,
|
||||
icon: const Image(image: AssetImage('assets/wallet.png')),
|
||||
onPressed: lockAction
|
||||
? null
|
||||
: () async {
|
||||
WalletData? defaultWallet =
|
||||
myWalletProvider.getDefaultWallet();
|
||||
String? pin;
|
||||
if (myWalletProvider.pinCode == '') {
|
||||
pin = await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (homeContext) {
|
||||
return UnlockingWallet(wallet: defaultWallet);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (pin != null || myWalletProvider.pinCode != '') {
|
||||
Navigator.popUntil(
|
||||
context,
|
||||
ModalRoute.withName('/'),
|
||||
);
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return const WalletsHome();
|
||||
}),
|
||||
);
|
||||
}
|
||||
},
|
||||
if (pin != null || myWalletProvider.pinCode != '') {
|
||||
Navigator.popUntil(
|
||||
context,
|
||||
ModalRoute.withName('/'),
|
||||
);
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return const WalletsHome();
|
||||
}),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
]),
|
||||
|
|
|
@ -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.14+46
|
||||
version: 0.0.15+47
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
|
Loading…
Reference in New Issue