balanceBuilder on choose_wallets; bugs fix

This commit is contained in:
poka 2022-05-28 21:48:04 +02:00
parent f5c14e8924
commit 10f04c1a5a
7 changed files with 32 additions and 5 deletions

View File

@ -148,7 +148,7 @@ class HomeProvider with ChangeNotifier {
// volume: volume, mode: PlayerMode.LOW_LATENCY, stayAwake: false);
// }
Widget bottomAppBar(BuildContext context, int index) {
Widget bottomAppBar(BuildContext context) {
MyWalletsProvider _myWalletProvider =
Provider.of<MyWalletsProvider>(context, listen: false);
WalletsProfilesProvider _historyProvider =

View File

@ -41,7 +41,7 @@ class ChestOptions extends StatelessWidget {
height: 22,
child: Text(currentChest.name!),
)),
bottomNavigationBar: _homeProvider.bottomAppBar(context, 2),
bottomNavigationBar: _homeProvider.bottomAppBar(context),
body: Builder(
builder: (ctx) => SafeArea(
child: Column(children: <Widget>[

View File

@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import 'package:gecko/models/wallet_data.dart';
import 'package:gecko/providers/my_wallets.dart';
import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/providers/wallet_options.dart';
import 'package:gecko/screens/myWallets/wallets_home.dart';
import 'package:provider/provider.dart';
// import 'package:gecko/models/home.dart';
@ -166,6 +167,8 @@ class ChooseWalletScreen extends StatelessWidget {
),
),
)),
balanceBuilder(context, _repository.address!,
selectedWallet!.address == _repository.address!),
ListTile(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
@ -205,4 +208,24 @@ class ChooseWalletScreen extends StatelessWidget {
]),
]);
}
Widget balanceBuilder(context, String _address, bool isDefault) {
return Container(
width: double.infinity,
color: isDefault ? orangeC : yellowC,
child: SizedBox(
height: 25,
child: Column(children: [
const Spacer(),
// Text(
// '0.0 gd',
// textAlign: TextAlign.center,
// style: TextStyle(color: isDefault ? Colors.white : Colors.black),
// ),
balance(
context, _address, 15, isDefault ? Colors.white : Colors.black)
]),
),
);
}
}

View File

@ -67,7 +67,7 @@ class WalletOptions extends StatelessWidget {
}),
),
),
bottomNavigationBar: _homeProvider.bottomAppBar(context, 2),
bottomNavigationBar: _homeProvider.bottomAppBar(context),
body: Builder(
builder: (ctx) => SafeArea(
child: Column(children: <Widget>[

View File

@ -57,7 +57,7 @@ class WalletsHome extends StatelessWidget {
style: TextStyle(color: Colors.grey[850])),
backgroundColor: const Color(0xffFFD58D),
),
bottomNavigationBar: _homeProvider.bottomAppBar(context, 3),
bottomNavigationBar: _homeProvider.bottomAppBar(context),
body: SafeArea(
child: myWalletsTiles(context, _currentChestNumber!),
),

View File

@ -3,6 +3,7 @@ import 'package:gecko/globals.dart';
import 'package:flutter/material.dart';
import 'package:gecko/providers/cesium_plus.dart';
import 'package:gecko/models/g1_wallets_list.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/wallets_profiles.dart';
@ -22,6 +23,8 @@ class SearchResultScreen extends StatelessWidget {
Provider.of<CesiumPlusProvider>(context, listen: false);
WalletsProfilesProvider _walletsProfilesClass =
Provider.of<WalletsProfilesProvider>(context, listen: false);
HomeProvider _homeProvider =
Provider.of<HomeProvider>(context, listen: false);
int keyID = 0;
double _avatarSize = 55;
@ -35,6 +38,7 @@ class SearchResultScreen extends StatelessWidget {
child: Text('Résultats de votre recherche'),
),
),
bottomNavigationBar: _homeProvider.bottomAppBar(context),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),

View File

@ -49,7 +49,7 @@ class WalletViewScreen extends StatelessWidget {
child: Text('Voir un portefeuille'),
),
),
bottomNavigationBar: _homeProvider.bottomAppBar(context, 1),
bottomNavigationBar: _homeProvider.bottomAppBar(context),
// floatingActionButton: _homeProvider.floatingAction(context, 1),
// floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
body: SafeArea(