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