Merge branch 'bottomBar'
This commit is contained in:
commit
2a4b54d9eb
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
|
@ -1,3 +1,6 @@
|
|||
[
|
||||
"wss://gdev.librelois.fr/ws"
|
||||
"wss://gdev.librelois.fr/ws",
|
||||
"wss://gdev.1000i100.fr/ws",
|
||||
"wss://gdev.komun.org/ws"
|
||||
|
||||
]
|
||||
|
|
|
@ -14,7 +14,7 @@ class ChestProvider with ChangeNotifier {
|
|||
Future deleteChest(context, ChestData _chest) async {
|
||||
final bool? _answer = await (_confirmDeletingChest(context, _chest.name));
|
||||
SubstrateSdk _sub = Provider.of<SubstrateSdk>(context, listen: false);
|
||||
if (_answer!) {
|
||||
if (_answer ?? false) {
|
||||
await _sub.deleteAccounts(getChestWallets(_chest));
|
||||
await chestBox.delete(_chest.key);
|
||||
if (chestBox.isEmpty) {
|
||||
|
|
|
@ -7,10 +7,16 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/services.dart';
|
||||
import 'dart:async';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/providers/wallets_profiles.dart';
|
||||
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
||||
import 'package:gecko/screens/search.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
import 'package:path_provider/path_provider.dart' as pp;
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class HomeProvider with ChangeNotifier {
|
||||
bool? isSearching;
|
||||
|
@ -20,9 +26,6 @@ class HomeProvider with ChangeNotifier {
|
|||
Widget appBarExplorer =
|
||||
Text('Explorateur', style: TextStyle(color: Colors.grey[850]));
|
||||
|
||||
bool isFirstBuild = true;
|
||||
// AudioCache player = AudioCache(prefix: 'sounds/');
|
||||
|
||||
Future<void> initHive() async {
|
||||
late Directory hivePath;
|
||||
|
||||
|
@ -58,6 +61,8 @@ class HomeProvider with ChangeNotifier {
|
|||
}
|
||||
|
||||
Future<List?> getValidEndpoints() async {
|
||||
await configBox.delete('endpoint');
|
||||
|
||||
List _listEndpoints = [];
|
||||
if (!configBox.containsKey('endpoint') ||
|
||||
configBox.get('endpoint') == [] ||
|
||||
|
@ -132,6 +137,162 @@ class HomeProvider with ChangeNotifier {
|
|||
// volume: volume, mode: PlayerMode.LOW_LATENCY, stayAwake: false);
|
||||
// }
|
||||
|
||||
Widget bottomAppBar(BuildContext context, int index) {
|
||||
MyWalletsProvider _myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context, listen: false);
|
||||
WalletsProfilesProvider _historyProvider =
|
||||
Provider.of<WalletsProfilesProvider>(context, listen: false);
|
||||
|
||||
const bool _showBottomBar = true;
|
||||
|
||||
return Visibility(
|
||||
visible: _showBottomBar,
|
||||
child: Container(
|
||||
color: yellowC,
|
||||
width: double.infinity,
|
||||
height: 80,
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
const Spacer(flex: 1),
|
||||
IconButton(
|
||||
iconSize: 40,
|
||||
icon: const Image(image: AssetImage('assets/loupe-noire.png')),
|
||||
onPressed: () {
|
||||
// Navigator.popUntil(
|
||||
// context,
|
||||
// ModalRoute.withName('/'),
|
||||
// );
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return const SearchScreen();
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
// SizedBox(width: 0),
|
||||
const Spacer(flex: 2),
|
||||
IconButton(
|
||||
iconSize: 60,
|
||||
icon: const Image(image: AssetImage('assets/qrcode-scan.png')),
|
||||
onPressed: () async {
|
||||
// Navigator.popUntil(
|
||||
// context,
|
||||
// ModalRoute.withName('/'),
|
||||
// );
|
||||
await _historyProvider.scan(context);
|
||||
},
|
||||
),
|
||||
const Spacer(flex: 2),
|
||||
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),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// BottomAppBar bottomAppBar(BuildContext context, int index) {
|
||||
// MyWalletsProvider _myWalletProvider =
|
||||
// Provider.of<MyWalletsProvider>(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<WalletsProfilesProvider>(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,
|
||||
|
|
|
@ -48,7 +48,6 @@ class SubstrateSdk with ChangeNotifier {
|
|||
List<NetworkParams> node = [];
|
||||
|
||||
for (String _endpoint in configBox.get('endpoint')) {
|
||||
log.d(_endpoint);
|
||||
final n = NetworkParams();
|
||||
n.name = currencyName;
|
||||
n.endpoint = _endpoint;
|
||||
|
|
|
@ -94,6 +94,7 @@ class HomeScreen extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
// bottomNavigationBar: _homeProvider.bottomBar(context, 1),
|
||||
backgroundColor: const Color(0xffF9F9F1),
|
||||
body: Builder(
|
||||
builder: (ctx) => StatefulWrapper(
|
||||
|
|
|
@ -35,6 +35,7 @@ class ChangePinScreen extends StatelessWidget with ChangeNotifier {
|
|||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
elevation: 1,
|
||||
toolbarHeight: 60 * ratio,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back, color: Colors.black),
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:gecko/globals.dart';
|
|||
import 'package:gecko/models/chest_data.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/providers/chest_provider.dart';
|
||||
import 'package:gecko/providers/home.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/screens/myWallets/change_pin.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
@ -17,12 +18,15 @@ class ChestOptions extends StatelessWidget {
|
|||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
ChestProvider _chestProvider =
|
||||
Provider.of<ChestProvider>(context, listen: false);
|
||||
HomeProvider _homeProvider =
|
||||
Provider.of<HomeProvider>(context, listen: false);
|
||||
|
||||
ChestData currentChest = chestBox.get(configBox.get('currentChest'))!;
|
||||
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
elevation: 1,
|
||||
toolbarHeight: 60 * ratio,
|
||||
// leading: IconButton(
|
||||
// icon: const Icon(Icons.arrow_back, color: Colors.black),
|
||||
|
@ -37,6 +41,7 @@ class ChestOptions extends StatelessWidget {
|
|||
height: 22,
|
||||
child: Text(currentChest.name!),
|
||||
)),
|
||||
bottomNavigationBar: _homeProvider.bottomAppBar(context, 2),
|
||||
body: Builder(
|
||||
builder: (ctx) => SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'dart:async';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/chest_data.dart';
|
||||
import 'package:gecko/providers/home.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
|
@ -26,6 +27,8 @@ class WalletOptions extends StatelessWidget {
|
|||
Provider.of<WalletsProfilesProvider>(context, listen: false);
|
||||
MyWalletsProvider _myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context);
|
||||
HomeProvider _homeProvider =
|
||||
Provider.of<HomeProvider>(context, listen: false);
|
||||
|
||||
log.d(_walletOptions.address.text);
|
||||
|
||||
|
@ -62,6 +65,7 @@ class WalletOptions extends StatelessWidget {
|
|||
}),
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: _homeProvider.bottomAppBar(context, 2),
|
||||
body: Builder(
|
||||
builder: (ctx) => SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
|
@ -102,27 +106,34 @@ class WalletOptions extends StatelessWidget {
|
|||
);
|
||||
}),
|
||||
SizedBox(height: 10 * ratio),
|
||||
QrImageWidget(
|
||||
data: _walletOptions.address.text,
|
||||
version: QrVersions.auto,
|
||||
size: isTall ? 300 : 270,
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(children: <Widget>[
|
||||
QrImageWidget(
|
||||
data: _walletOptions.address.text,
|
||||
version: QrVersions.auto,
|
||||
size: isTall ? 300 : 270,
|
||||
),
|
||||
SizedBox(height: 15 * ratio),
|
||||
Consumer<WalletOptionsProvider>(
|
||||
builder: (context, walletProvider, _) {
|
||||
return Column(children: [
|
||||
pubkeyWidget(walletProvider, ctx),
|
||||
SizedBox(height: 10 * ratio),
|
||||
historyWidget(
|
||||
context, _historyProvider, walletProvider),
|
||||
SizedBox(height: 12 * ratio),
|
||||
setDefaultWallet(context, walletProvider,
|
||||
_myWalletProvider, _walletOptions, _currentChest),
|
||||
SizedBox(height: 17 * ratio),
|
||||
if (!walletProvider.isDefaultWallet)
|
||||
deleteWallet(context, walletProvider,
|
||||
_myWalletProvider, _currentChest)
|
||||
]);
|
||||
}),
|
||||
]),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15 * ratio),
|
||||
Consumer<WalletOptionsProvider>(
|
||||
builder: (context, walletProvider, _) {
|
||||
return Column(children: [
|
||||
pubkeyWidget(walletProvider, ctx),
|
||||
SizedBox(height: 10 * ratio),
|
||||
historyWidget(context, _historyProvider, walletProvider),
|
||||
SizedBox(height: 12 * ratio),
|
||||
setDefaultWallet(context, walletProvider, _myWalletProvider,
|
||||
_walletOptions, _currentChest),
|
||||
SizedBox(height: 17 * ratio),
|
||||
if (!walletProvider.isDefaultWallet)
|
||||
deleteWallet(context, walletProvider, _myWalletProvider,
|
||||
_currentChest)
|
||||
]);
|
||||
}),
|
||||
]),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/chest_data.dart';
|
||||
import 'package:gecko/providers/home.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/models/queries.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
|
@ -21,6 +22,8 @@ class WalletsHome extends StatelessWidget {
|
|||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
MyWalletsProvider myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context);
|
||||
HomeProvider _homeProvider =
|
||||
Provider.of<HomeProvider>(context, listen: false);
|
||||
|
||||
final int? _currentChestNumber = myWalletProvider.getCurrentChest();
|
||||
final ChestData _currentChest = chestBox.get(_currentChestNumber)!;
|
||||
|
@ -38,6 +41,7 @@ class WalletsHome extends StatelessWidget {
|
|||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 1,
|
||||
toolbarHeight: 60 * ratio,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back, color: Colors.black),
|
||||
|
@ -53,6 +57,7 @@ class WalletsHome extends StatelessWidget {
|
|||
style: TextStyle(color: Colors.grey[850])),
|
||||
backgroundColor: const Color(0xffFFD58D),
|
||||
),
|
||||
bottomNavigationBar: _homeProvider.bottomAppBar(context, 3),
|
||||
body: SafeArea(
|
||||
child: myWalletsTiles(context, _currentChestNumber!),
|
||||
),
|
||||
|
@ -154,8 +159,7 @@ class WalletsHome extends StatelessWidget {
|
|||
}
|
||||
|
||||
List _listWallets = _myWalletProvider.listWallets;
|
||||
WalletData? defaultWallet =
|
||||
_myWalletProvider.getDefaultWallet();
|
||||
WalletData? defaultWallet = _myWalletProvider.getDefaultWallet();
|
||||
final double screenWidth = MediaQuery.of(context).size.width;
|
||||
int nTule = 2;
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ class SearchScreen extends StatelessWidget {
|
|||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 1,
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: const SizedBox(
|
||||
height: 22,
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'package:flutter/services.dart';
|
|||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/providers/cesium_plus.dart';
|
||||
import 'package:gecko/providers/home.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:gecko/providers/wallet_options.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
|
@ -30,6 +31,8 @@ class WalletViewScreen extends StatelessWidget {
|
|||
Provider.of<CesiumPlusProvider>(context, listen: false);
|
||||
_walletViewProvider.pubkey = pubkey!;
|
||||
SubstrateSdk _sub = Provider.of<SubstrateSdk>(context, listen: false);
|
||||
HomeProvider _homeProvider =
|
||||
Provider.of<HomeProvider>(context, listen: false);
|
||||
|
||||
MyWalletsProvider _myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context, listen: false);
|
||||
|
@ -46,11 +49,14 @@ class WalletViewScreen extends StatelessWidget {
|
|||
child: Text('Voir un portefeuille'),
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: _homeProvider.bottomAppBar(context, 1),
|
||||
// floatingActionButton: _homeProvider.floatingAction(context, 1),
|
||||
// floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||
body: SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
headerProfileView(
|
||||
context, _walletViewProvider, _cesiumPlusProvider),
|
||||
SizedBox(height: isTall ? 120 : 70),
|
||||
SizedBox(height: isTall ? 50 : 20),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
|
||||
Column(children: <Widget>[
|
||||
SizedBox(
|
||||
|
@ -233,7 +239,7 @@ class WalletViewScreen extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
fontSize: buttonFontSize, fontWeight: FontWeight.w500),
|
||||
),
|
||||
SizedBox(height: isTall ? 120 : 70)
|
||||
SizedBox(height: isTall ? 50 : 20)
|
||||
]),
|
||||
));
|
||||
}
|
||||
|
|
10
pubspec.lock
10
pubspec.lock
|
@ -112,7 +112,7 @@ packages:
|
|||
name: build_resolvers
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.8"
|
||||
version: "2.0.9"
|
||||
build_runner:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
|
@ -983,10 +983,10 @@ packages:
|
|||
description:
|
||||
path: "."
|
||||
ref: fixAndroidActivityVersion
|
||||
resolved-ref: e33351cde5ea9b55d191772fe3b36f9dbb8277e6
|
||||
resolved-ref: "069a9f696ec8d9eacd0a3fdd284116fd2c1faf44"
|
||||
url: "https://github.com/poka-IT/sdk.git"
|
||||
source: git
|
||||
version: "0.4.5"
|
||||
version: "0.4.6"
|
||||
pool:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1389,7 +1389,7 @@ packages:
|
|||
name: webview_flutter_android
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.8.8"
|
||||
version: "2.8.9"
|
||||
webview_flutter_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1403,7 +1403,7 @@ packages:
|
|||
name: webview_flutter_wkwebview
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.7.5"
|
||||
version: "2.8.0"
|
||||
win32:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -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.6+6
|
||||
version: 0.0.6+8
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
|
Loading…
Reference in New Issue