wallet_view.dart 29.47 KiB
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';
import 'package:gecko/models/wallet_data.dart';
import 'package:gecko/providers/wallets_profiles.dart';
import 'package:gecko/screens/avatar_fullscreen.dart';
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
import 'package:provider/provider.dart';
class WalletViewScreen extends StatelessWidget {
const WalletViewScreen(
{required this.pubkey, this.username, this.avatar, Key? key})
: super(key: key);
final String? pubkey;
final String? username;
final Image? avatar;
final double buttonSize = 100;
final double buttonFontSize = 18;
@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
WalletsProfilesProvider _walletViewProvider =
Provider.of<WalletsProfilesProvider>(context, listen: false);
CesiumPlusProvider _cesiumPlusProvider =
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);
WalletData? defaultWallet = _myWalletProvider.getDefaultWallet();
_sub.setCurrentWallet(defaultWallet!);
return Scaffold(
backgroundColor: backgroundColor,
resizeToAvoidBottomInset: true,
appBar: AppBar(
elevation: 0,
toolbarHeight: 60 * ratio,
title: const SizedBox(
height: 22,
child: Text('Voir un portefeuille'),
),
),
bottomNavigationBar: _homeProvider.bottomAppBar(context),
// floatingActionButton: _homeProvider.floatingAction(context, 1),
// floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
body: SafeArea(
child: Column(children: <Widget>[
headerProfileView(
context, _walletViewProvider, _cesiumPlusProvider),
SizedBox(height: isTall ? 50 : 20),
Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
Column(children: <Widget>[
SizedBox(
height: buttonSize,
child: ClipOval(
child: Material(
color: Colors
.grey[300], //const Color(0xffFFD58D), // button color
child: InkWell(
key: const Key('viewHistory'),