From df84eb7a48b1ef9b220eb9813056cefc16d4f263 Mon Sep 17 00:00:00 2001 From: poka Date: Sat, 28 May 2022 06:12:39 +0200 Subject: [PATCH] cleaning code --- lib/providers/home.dart | 82 -------------------------------- lib/screens/common_elements.dart | 76 ++++++++--------------------- lib/screens/onBoarding/3.dart | 4 +- lib/screens/onBoarding/9.dart | 1 - lib/screens/search_result.dart | 5 +- 5 files changed, 25 insertions(+), 143 deletions(-) diff --git a/lib/providers/home.dart b/lib/providers/home.dart index 1ea7663..44ad2da 100644 --- a/lib/providers/home.dart +++ b/lib/providers/home.dart @@ -211,88 +211,6 @@ class HomeProvider with ChangeNotifier { ); } - // BottomAppBar bottomAppBar(BuildContext context, int index) { - // MyWalletsProvider _myWalletProvider = - // Provider.of(context, listen: false); - - // return BottomAppBar( - // color: yellowC, - // notchMargin: 0, //not - // child: SizedBox( - // height: 70, - // child: Row( - // children: [ - // const Spacer(flex: 1), - // IconButton( - // iconSize: 50, - // icon: const Image(image: AssetImage('assets/loupe-noire.png')), - // onPressed: () { - // Navigator.popUntil( - // context, - // ModalRoute.withName('/'), - // ); - // Navigator.push( - // context, - // MaterialPageRoute(builder: (context) { - // return const SearchScreen(); - // }), - // ); - // }, - // ), - // const Spacer(flex: 4), - // IconButton( - // iconSize: 60, - // icon: const Image(image: AssetImage('assets/wallet.png')), - // onPressed: () { - // WalletData? defaultWallet = - // _myWalletProvider.getDefaultWallet(); - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) { - // return UnlockingWallet( - // wallet: defaultWallet, - // action: "mywallets", - // ); - // }, - // ), - // ); - // }, - // ), - // const Spacer(flex: 1), - // ], - // )), - // ); - // } - - // Widget floatingAction(BuildContext context, index) { - // WalletsProfilesProvider _historyProvider = - // Provider.of(context, listen: false); - // return SizedBox( - // height: 90, - // width: 90, - // child: FittedBox( - // child: FloatingActionButton( - // // shape: const RoundedRectangleBorder( - // // borderRadius: BorderRadius.all(Radius.elliptical(150, 100)), - // // ), - // backgroundColor: yellowC, - // elevation: 0, - // onPressed: () async { - // Navigator.popUntil( - // context, - // ModalRoute.withName('/'), - // ); - // await _historyProvider.scan(context); - // }, - // child: const Image( - // image: AssetImage('assets/qrcode-scan.png'), - // height: 35), //icon inside button - // ), - // ), - // ); - // } - void handleSearchEnd() { searchIcon = Icon( Icons.search, diff --git a/lib/screens/common_elements.dart b/lib/screens/common_elements.dart index cfba0f7..9aef3b6 100644 --- a/lib/screens/common_elements.dart +++ b/lib/screens/common_elements.dart @@ -192,59 +192,23 @@ class FaderTransition extends PageRouteBuilder { ); } -class SlideLeftRoute extends PageRouteBuilder { - final Widget? page; - SlideLeftRoute({this.page}) - : super( - pageBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - ) => - page!, - transitionsBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - Widget child, - ) => - SlideTransition( - position: Tween( - begin: const Offset(1, 0), - end: Offset.zero, - ).animate(animation), - child: child, - ), - ); -} - -class GeckoSpeechAppBar extends StatelessWidget with PreferredSizeWidget { - @override - final Size preferredSize; - final String title; - - GeckoSpeechAppBar( - this.title, { - Key? key, - }) : preferredSize = const Size.fromHeight(105.4), - super(key: key); - - @override - Widget build(BuildContext context) { - return AppBar( - toolbarHeight: 60 * ratio, - leading: IconButton( - icon: SizedBox( - height: 30, - child: Image.asset('assets/onBoarding/gecko_bar.png')), - onPressed: () => Navigator.popUntil( - context, - ModalRoute.withName('/'), - ), - ), - title: SizedBox( - height: 25, - child: Text(title), - )); - } -} +// Widget geckoAppBar() { +// return AppBar( +// toolbarHeight: 60 * ratio, +// elevation: 0, +// leading: IconButton( +// icon: const Icon(Icons.arrow_back, color: Colors.black), +// onPressed: () { +// _walletOptions.isEditing = false; +// _walletOptions.isBalanceBlur = false; +// Navigator.pop(context); +// }), +// title: SizedBox( +// height: 22, +// child: Consumer( +// builder: (context, walletProvider, _) { +// return Text(_walletOptions.nameController.text); +// }), +// ), +// ); +// } diff --git a/lib/screens/onBoarding/3.dart b/lib/screens/onBoarding/3.dart index ebce3a4..7453e03 100644 --- a/lib/screens/onBoarding/3.dart +++ b/lib/screens/onBoarding/3.dart @@ -30,7 +30,9 @@ class OnboardingStepThree extends StatelessWidget { child: common.infoIntro( context, [ - const TextSpan(text: 'Dans une blockchain, pas de procédure de récupération par mail. Seule votre phrase de restauration peut vous permettre de récupérer vos Ğ1 à tout moment.'), + const TextSpan( + text: + 'Dans une blockchain, pas de procédure de récupération par mail. Seule votre phrase de restauration peut vous permettre de récupérer vos Ğ1 à tout moment.'), ], 'mot-de-passe-oublie.png', '>', diff --git a/lib/screens/onBoarding/9.dart b/lib/screens/onBoarding/9.dart index f9ed8a4..b41dc2f 100644 --- a/lib/screens/onBoarding/9.dart +++ b/lib/screens/onBoarding/9.dart @@ -1,5 +1,4 @@ // ignore_for_file: file_names -import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/globals.dart'; diff --git a/lib/screens/search_result.dart b/lib/screens/search_result.dart index b626d8e..97d7d77 100644 --- a/lib/screens/search_result.dart +++ b/lib/screens/search_result.dart @@ -28,6 +28,7 @@ class SearchResultScreen extends StatelessWidget { return Scaffold( appBar: AppBar( + elevation: 1, toolbarHeight: 60 * ratio, title: const SizedBox( height: 22, @@ -126,9 +127,7 @@ class SearchResultScreen extends StatelessWidget { } }), title: Row(children: [ - Text( - - getShortPubkey(g1Wallet.pubkey!), + Text(getShortPubkey(g1Wallet.pubkey!), style: const TextStyle( fontSize: 18, fontFamily: 'Monospace',