Adapt to large screen
This commit is contained in:
parent
33c1149987
commit
7bdd564a91
|
@ -51,7 +51,7 @@ Future<void> main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
|
if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
|
||||||
setWindowTitle('Ğecko');
|
setWindowTitle('Ğecko');
|
||||||
setWindowMinSize(const Size(600, 800));
|
setWindowMinSize(const Size(400, 700));
|
||||||
setWindowMaxSize(const Size(800, 1000));
|
setWindowMaxSize(const Size(800, 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@ class ChestProvider with ChangeNotifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future deleteChest(context, ChestData _chest) async {
|
Future deleteChest(context, ChestData _chest) async {
|
||||||
final bool _answer = await (_confirmDeletingChest(context, _chest.name) as FutureOr<bool>);
|
final bool? _answer = await (_confirmDeletingChest(context, _chest.name));
|
||||||
|
|
||||||
if (_answer) {
|
if (_answer!) {
|
||||||
await chestBox.delete(_chest.key);
|
await chestBox.delete(_chest.key);
|
||||||
if (chestBox.isEmpty) {
|
if (chestBox.isEmpty) {
|
||||||
await configBox.put('currentChest', 0);
|
await configBox.put('currentChest', 0);
|
||||||
|
|
|
@ -316,9 +316,9 @@ class GenerateWalletsProvider with ChangeNotifier {
|
||||||
return bip39Words.contains(word);
|
return bip39Words.contains(word);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isBipWordsList(List words) {
|
bool isBipWordsList(List<String> words) {
|
||||||
bool isValid = true;
|
bool isValid = true;
|
||||||
for (String word in words as Iterable<String>) {
|
for (String word in words) {
|
||||||
// Needed for bad encoding of UTF-8
|
// Needed for bad encoding of UTF-8
|
||||||
word = word.replaceAll('é', 'é');
|
word = word.replaceAll('é', 'é');
|
||||||
word = word.replaceAll('è', 'è');
|
word = word.replaceAll('è', 'è');
|
||||||
|
@ -380,6 +380,7 @@ class GenerateWalletsProvider with ChangeNotifier {
|
||||||
if (generatedWallet == null) {
|
if (generatedWallet == null) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
generatedMnemonic = inputMnemonic;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,8 +65,8 @@ class MyWalletsProvider with ChangeNotifier {
|
||||||
try {
|
try {
|
||||||
log.w('DELETE ALL WALLETS ?');
|
log.w('DELETE ALL WALLETS ?');
|
||||||
|
|
||||||
final bool _answer = await (_confirmDeletingAllWallets(context) as FutureOr<bool>);
|
final bool? _answer = await (_confirmDeletingAllWallets(context));
|
||||||
if (_answer) {
|
if (_answer!) {
|
||||||
await walletBox.clear();
|
await walletBox.clear();
|
||||||
await chestBox.clear();
|
await chestBox.clear();
|
||||||
await configBox.delete('defaultWallet');
|
await configBox.delete('defaultWallet');
|
||||||
|
|
|
@ -108,6 +108,11 @@ class WalletOptionsProvider with ChangeNotifier {
|
||||||
return pinLength;
|
return pinLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<double> getBalance(String pubkey, {bool isUd = false}) async {
|
||||||
|
final node = Gva(node: endPointGVA);
|
||||||
|
return await node.balance(pubkey, ud: isUd);
|
||||||
|
}
|
||||||
|
|
||||||
void _renameWallet(List<int?> _walletID, _newName,
|
void _renameWallet(List<int?> _walletID, _newName,
|
||||||
{required bool isCesium}) async {
|
{required bool isCesium}) async {
|
||||||
if (isCesium) {
|
if (isCesium) {
|
||||||
|
@ -145,10 +150,9 @@ class WalletOptionsProvider with ChangeNotifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> deleteWallet(context, WalletData wallet) async {
|
Future<int> deleteWallet(context, WalletData wallet) async {
|
||||||
final bool _answer =
|
final bool? _answer = await (_confirmDeletingWallet(context, wallet.name));
|
||||||
await (_confirmDeletingWallet(context, wallet.name) as FutureOr<bool>);
|
|
||||||
|
|
||||||
if (_answer) {
|
if (_answer!) {
|
||||||
walletBox.delete(wallet.key);
|
walletBox.delete(wallet.key);
|
||||||
|
|
||||||
Navigator.popUntil(
|
Navigator.popUntil(
|
||||||
|
|
|
@ -8,39 +8,46 @@ class CommonElements {
|
||||||
return const Text('Coucou');
|
return const Text('Coucou');
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget bubbleSpeak(String text, {double? long, Key? textKey}) {
|
Widget bubbleSpeak(String text,
|
||||||
return Bubble(
|
{double? long, Key? textKey, bool isMaxWidth = true}) {
|
||||||
padding: long == null
|
return SizedBox(
|
||||||
? const BubbleEdges.all(18)
|
width: isMaxWidth ? double.infinity : 300,
|
||||||
: BubbleEdges.symmetric(horizontal: long, vertical: 30),
|
child: Bubble(
|
||||||
elevation: 5,
|
padding: long == null
|
||||||
color: Colors.white,
|
? const BubbleEdges.all(18)
|
||||||
margin: const BubbleEdges.fromLTRB(10, 0, 20, 10),
|
: BubbleEdges.symmetric(horizontal: long, vertical: 30),
|
||||||
// nip: BubbleNip.leftTop,
|
elevation: 5,
|
||||||
child: Text(
|
color: Colors.white,
|
||||||
text,
|
margin: const BubbleEdges.fromLTRB(10, 0, 20, 10),
|
||||||
key: textKey,
|
// nip: BubbleNip.leftTop,
|
||||||
style: const TextStyle(
|
child: Text(
|
||||||
color: Colors.black, fontSize: 18, fontWeight: FontWeight.w400),
|
text,
|
||||||
|
key: textKey,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.black, fontSize: 18, fontWeight: FontWeight.w400),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget bubbleSpeakRich(List<TextSpan> text, {Key? textKey}) {
|
Widget bubbleSpeakRich(List<TextSpan> text, {Key? textKey}) {
|
||||||
return Bubble(
|
return SizedBox(
|
||||||
padding: const BubbleEdges.all(18),
|
width: double.infinity,
|
||||||
elevation: 5,
|
child: Bubble(
|
||||||
color: Colors.white,
|
padding: const BubbleEdges.all(18),
|
||||||
margin: const BubbleEdges.fromLTRB(10, 0, 20, 10),
|
elevation: 5,
|
||||||
// nip: BubbleNip.leftTop,
|
color: Colors.white,
|
||||||
child: RichText(
|
margin: const BubbleEdges.fromLTRB(10, 0, 20, 10),
|
||||||
key: textKey,
|
// nip: BubbleNip.leftTop,
|
||||||
text: TextSpan(
|
child: RichText(
|
||||||
style: const TextStyle(
|
key: textKey,
|
||||||
fontSize: 18.0,
|
text: TextSpan(
|
||||||
color: Colors.black,
|
style: const TextStyle(
|
||||||
|
fontSize: 18.0,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
children: text,
|
||||||
),
|
),
|
||||||
children: text,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -106,7 +106,7 @@ class CesiumWalletOptions extends StatelessWidget {
|
||||||
const SizedBox(width: 25),
|
const SizedBox(width: 25),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
File newAvatar = await (_walletOptions.changeAvatar() as FutureOr<File>);
|
File newAvatar = await (_walletOptions.changeAvatar());
|
||||||
cesiumWallet.imageFile = newAvatar;
|
cesiumWallet.imageFile = newAvatar;
|
||||||
_walletOptions.reloadBuild();
|
_walletOptions.reloadBuild();
|
||||||
},
|
},
|
||||||
|
@ -119,7 +119,7 @@ class CesiumWalletOptions extends StatelessWidget {
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
File newAvatar = await (_walletOptions.changeAvatar() as FutureOr<File>);
|
File newAvatar = await (_walletOptions.changeAvatar());
|
||||||
cesiumWallet.imageFile = newAvatar;
|
cesiumWallet.imageFile = newAvatar;
|
||||||
_walletOptions.reloadBuild();
|
_walletOptions.reloadBuild();
|
||||||
},
|
},
|
||||||
|
|
|
@ -53,7 +53,7 @@ class _ChooseChestState extends State<ChooseChest> {
|
||||||
enableInfiniteScroll: false,
|
enableInfiniteScroll: false,
|
||||||
initialPage: currentChest!,
|
initialPage: currentChest!,
|
||||||
enlargeCenterPage: true,
|
enlargeCenterPage: true,
|
||||||
viewportFraction: 0.6,
|
viewportFraction: 0.5,
|
||||||
),
|
),
|
||||||
items: chestBox.toMap().entries.map((i) {
|
items: chestBox.toMap().entries.map((i) {
|
||||||
return Builder(
|
return Builder(
|
||||||
|
|
|
@ -4,23 +4,18 @@ import 'dart:ui';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gecko/globals.dart';
|
import 'package:gecko/globals.dart';
|
||||||
import 'package:gecko/providers/my_wallets.dart';
|
import 'package:gecko/providers/my_wallets.dart';
|
||||||
import 'package:gecko/models/queries.dart';
|
|
||||||
import 'package:gecko/models/wallet_data.dart';
|
import 'package:gecko/models/wallet_data.dart';
|
||||||
import 'package:gecko/providers/wallet_options.dart';
|
import 'package:gecko/providers/wallet_options.dart';
|
||||||
import 'package:gecko/providers/wallets_profiles.dart';
|
import 'package:gecko/providers/wallets_profiles.dart';
|
||||||
import 'package:gecko/screens/history.dart';
|
import 'package:gecko/screens/history.dart';
|
||||||
import 'package:graphql_flutter/graphql_flutter.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:qr_flutter/qr_flutter.dart';
|
import 'package:qr_flutter/qr_flutter.dart';
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class WalletOptions extends StatelessWidget {
|
class WalletOptions extends StatelessWidget {
|
||||||
WalletOptions({Key? keyMyWallets, required this.wallet})
|
const WalletOptions({Key? keyMyWallets, required this.wallet})
|
||||||
: super(key: keyMyWallets);
|
: super(key: keyMyWallets);
|
||||||
WalletData wallet;
|
final WalletData wallet;
|
||||||
int _nbrLinesName = 1;
|
|
||||||
bool _isNewNameValid = false;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -32,33 +27,13 @@ class WalletOptions extends StatelessWidget {
|
||||||
MyWalletsProvider _myWalletProvider =
|
MyWalletsProvider _myWalletProvider =
|
||||||
Provider.of<MyWalletsProvider>(context);
|
Provider.of<MyWalletsProvider>(context);
|
||||||
|
|
||||||
|
|
||||||
|
_walletOptions.pubkey.text =
|
||||||
log.d(_walletOptions.pubkey.text);
|
log.d(_walletOptions.pubkey.text);
|
||||||
|
|
||||||
final int? _currentChest = _myWalletProvider.getCurrentChest();
|
final int _currentChest = _myWalletProvider.getCurrentChest()!;
|
||||||
final String shortPubkey =
|
|
||||||
_walletOptions.getShortPubkey(_walletOptions.pubkey.text);
|
|
||||||
|
|
||||||
if (_isNewNameValid == false) {
|
log.d("Wallet options: $_currentChest:${wallet.number}");
|
||||||
_walletOptions.nameController.text = wallet.name!;
|
|
||||||
} else {
|
|
||||||
wallet.name = _walletOptions.nameController.text;
|
|
||||||
}
|
|
||||||
|
|
||||||
_walletOptions.nameController.text.length >= 15
|
|
||||||
? _nbrLinesName = 2
|
|
||||||
: _nbrLinesName = 1;
|
|
||||||
if (_walletOptions.nameController.text.length >= 26 && isTall) {
|
|
||||||
_nbrLinesName = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
WalletData defaultWallet =
|
|
||||||
_myWalletProvider.getDefaultWallet(_currentChest)!;
|
|
||||||
|
|
||||||
_walletOptions.isDefaultWallet = (defaultWallet.number == wallet.id()[1]);
|
|
||||||
|
|
||||||
int? currentChest = _myWalletProvider.getCurrentChest();
|
|
||||||
|
|
||||||
log.d("Wallet options: $currentChest:${wallet.number}");
|
|
||||||
|
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () {
|
onWillPop: () {
|
||||||
|
@ -112,167 +87,21 @@ class WalletOptions extends StatelessWidget {
|
||||||
const Color(0xfffafafa),
|
const Color(0xfffafafa),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
child: Row(children: <Widget>[
|
child: Row(
|
||||||
const SizedBox(width: 25),
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
InkWell(
|
children: <Widget>[
|
||||||
onTap: () async {
|
const Spacer(),
|
||||||
File newAvatar = await (walletProvider.changeAvatar() as FutureOr<File>);
|
avatar(walletProvider),
|
||||||
wallet.imageFile = newAvatar;
|
const Spacer(),
|
||||||
walletProvider.reloadBuild();
|
|
||||||
},
|
|
||||||
child: wallet.imageFile == null
|
|
||||||
? Image.asset(
|
|
||||||
'assets/avatars/${wallet.imageName}',
|
|
||||||
width: 110,
|
|
||||||
)
|
|
||||||
: Image.file(
|
|
||||||
wallet.imageFile!,
|
|
||||||
width: 110,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
File newAvatar = await (walletProvider.changeAvatar() as FutureOr<File>);
|
|
||||||
wallet.imageFile = newAvatar;
|
|
||||||
walletProvider.reloadBuild();
|
|
||||||
},
|
|
||||||
child: Column(children: <Widget>[
|
|
||||||
Image.asset(
|
|
||||||
'assets/walletOptions/camera.png',
|
|
||||||
height: 40,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 80)
|
|
||||||
])),
|
|
||||||
Column(children: <Widget>[
|
|
||||||
Row(children: <Widget>[
|
|
||||||
Column(children: <Widget>[
|
Column(children: <Widget>[
|
||||||
SizedBox(
|
walletName(walletProvider, _walletOptions),
|
||||||
width: 260,
|
|
||||||
child: TextField(
|
|
||||||
key: const Key('walletName'),
|
|
||||||
autofocus: false,
|
|
||||||
focusNode: walletProvider.walletNameFocus,
|
|
||||||
enabled: walletProvider.isEditing,
|
|
||||||
controller: walletProvider.nameController,
|
|
||||||
maxLines: _nbrLinesName,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
border: InputBorder.none,
|
|
||||||
focusedBorder: InputBorder.none,
|
|
||||||
enabledBorder: InputBorder.none,
|
|
||||||
disabledBorder: InputBorder.none,
|
|
||||||
contentPadding: EdgeInsets.all(15.0),
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: isTall ? 27 : 23,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
fontFamily: 'Monospace')),
|
|
||||||
),
|
|
||||||
SizedBox(height: isTall ? 5 : 0),
|
SizedBox(height: isTall ? 5 : 0),
|
||||||
Query(
|
balance(walletProvider),
|
||||||
options: QueryOptions(
|
|
||||||
document: gql(getBalance),
|
|
||||||
variables: {
|
|
||||||
'pubkey': walletProvider.pubkey.text,
|
|
||||||
},
|
|
||||||
// pollInterval: Duration(seconds: 1),
|
|
||||||
),
|
|
||||||
builder: (QueryResult result,
|
|
||||||
{VoidCallback? refetch, FetchMore? fetchMore}) {
|
|
||||||
if (result.hasException) {
|
|
||||||
return Text(result.exception.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result.isLoading) {
|
|
||||||
return const Text('Loading');
|
|
||||||
}
|
|
||||||
|
|
||||||
// List repositories = result.data['viewer']['repositories']['nodes'];
|
|
||||||
String wBalanceUD;
|
|
||||||
if (result.data!['balance'] == null) {
|
|
||||||
wBalanceUD = '0.0';
|
|
||||||
} else if (result.hasException) {
|
|
||||||
wBalanceUD = '?';
|
|
||||||
} else {
|
|
||||||
int wBalanceG1 =
|
|
||||||
result.data!['balance']['amount'];
|
|
||||||
int currentUD =
|
|
||||||
result.data!['currentUd']['amount'];
|
|
||||||
double wBalanceUDBrut =
|
|
||||||
wBalanceG1 / currentUD; // .toString();
|
|
||||||
wBalanceUD = double.parse(
|
|
||||||
(wBalanceUDBrut).toStringAsFixed(2))
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
return Row(children: <Widget>[
|
|
||||||
ImageFiltered(
|
|
||||||
imageFilter: ImageFilter.blur(
|
|
||||||
sigmaX:
|
|
||||||
walletProvider.isBalanceBlur ? 6 : 0.001,
|
|
||||||
sigmaY:
|
|
||||||
walletProvider.isBalanceBlur ? 5 : 0.001),
|
|
||||||
child: Text(
|
|
||||||
wBalanceUD,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: isTall ? 20 : 18,
|
|
||||||
color: Colors.black),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(' DU',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: isTall ? 20 : 18,
|
|
||||||
color: Colors.black))
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Text(
|
|
||||||
// '$wBalanceUD DU',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 20, color: Colors.black),
|
|
||||||
// );
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
InkWell(
|
|
||||||
key: const Key('displayBalance'),
|
|
||||||
onTap: () {
|
|
||||||
walletProvider.bluringBalance();
|
|
||||||
},
|
|
||||||
child: Image.asset(
|
|
||||||
walletProvider.isBalanceBlur
|
|
||||||
? 'assets/walletOptions/icon_oeuil.png'
|
|
||||||
: 'assets/walletOptions/icon_oeuil_close.png',
|
|
||||||
height: 35,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]),
|
]),
|
||||||
const SizedBox(width: 0),
|
const Spacer(),
|
||||||
Column(children: <Widget>[
|
const Spacer(),
|
||||||
InkWell(
|
const Spacer(),
|
||||||
key: const Key('renameWallet'),
|
|
||||||
onTap: () async {
|
|
||||||
_isNewNameValid = walletProvider.editWalletName(
|
|
||||||
wallet.id(),
|
|
||||||
isCesium: false);
|
|
||||||
await Future.delayed(
|
|
||||||
const Duration(milliseconds: 30));
|
|
||||||
walletProvider.walletNameFocus.requestFocus();
|
|
||||||
},
|
|
||||||
child: ClipRRect(
|
|
||||||
child: Image.asset(
|
|
||||||
walletProvider.isEditing
|
|
||||||
? 'assets/walletOptions/android-checkmark.png'
|
|
||||||
: 'assets/walletOptions/edit.png',
|
|
||||||
width: 20,
|
|
||||||
height: 20),
|
|
||||||
)),
|
|
||||||
const SizedBox(
|
|
||||||
height: 60,
|
|
||||||
)
|
|
||||||
])
|
|
||||||
]),
|
]),
|
||||||
]),
|
|
||||||
]),
|
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
SizedBox(height: 4 * ratio),
|
SizedBox(height: 4 * ratio),
|
||||||
|
@ -285,169 +114,16 @@ class WalletOptions extends StatelessWidget {
|
||||||
Consumer<WalletOptionsProvider>(
|
Consumer<WalletOptionsProvider>(
|
||||||
builder: (context, walletProvider, _) {
|
builder: (context, walletProvider, _) {
|
||||||
return Column(children: [
|
return Column(children: [
|
||||||
GestureDetector(
|
pubkeyWidget(walletProvider, ctx),
|
||||||
key: const Key('copyPubkey'),
|
|
||||||
onTap: () {
|
|
||||||
Clipboard.setData(
|
|
||||||
ClipboardData(text: walletProvider.pubkey.text));
|
|
||||||
walletProvider.snackCopyKey(ctx);
|
|
||||||
},
|
|
||||||
child: SizedBox(
|
|
||||||
height: 50,
|
|
||||||
child: Row(children: <Widget>[
|
|
||||||
const SizedBox(width: 30),
|
|
||||||
Image.asset(
|
|
||||||
'assets/walletOptions/key.png',
|
|
||||||
height: 45,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 20),
|
|
||||||
Text("${shortPubkey.split(':')[0]}:",
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 22,
|
|
||||||
fontWeight: FontWeight.w800,
|
|
||||||
fontFamily: 'Monospace',
|
|
||||||
color: Colors.black)),
|
|
||||||
Text(shortPubkey.split(':')[1],
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 22,
|
|
||||||
fontWeight: FontWeight.w800,
|
|
||||||
fontFamily: 'Monospace')),
|
|
||||||
const SizedBox(width: 15),
|
|
||||||
SizedBox(
|
|
||||||
height: 40,
|
|
||||||
child: ElevatedButton(
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
elevation: 1,
|
|
||||||
primary: orangeC, // background
|
|
||||||
onPrimary: Colors.black, // foreground
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
Clipboard.setData(ClipboardData(
|
|
||||||
text: walletProvider.pubkey.text));
|
|
||||||
walletProvider.snackCopyKey(ctx);
|
|
||||||
},
|
|
||||||
child: Row(children: <Widget>[
|
|
||||||
Image.asset(
|
|
||||||
'assets/walletOptions/copy-white.png',
|
|
||||||
height: 25,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 7),
|
|
||||||
Text(
|
|
||||||
'Copier',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 15, color: Colors.grey[50]),
|
|
||||||
)
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 10 * ratio),
|
SizedBox(height: 10 * ratio),
|
||||||
InkWell(
|
historyWidget(context, _historyProvider, walletProvider),
|
||||||
key: const Key('displayHistory'),
|
|
||||||
onTap: () {
|
|
||||||
_historyProvider.nPage = 1;
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) {
|
|
||||||
return HistoryScreen(
|
|
||||||
pubkey: walletProvider.pubkey.text,
|
|
||||||
avatar: wallet.imageFile == null
|
|
||||||
? Image.asset(
|
|
||||||
'assets/avatars/${wallet.imageName}',
|
|
||||||
width: 110,
|
|
||||||
)
|
|
||||||
: Image.file(
|
|
||||||
wallet.imageFile!,
|
|
||||||
width: 110,
|
|
||||||
));
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: SizedBox(
|
|
||||||
height: 50,
|
|
||||||
child: Row(children: <Widget>[
|
|
||||||
const SizedBox(width: 30),
|
|
||||||
Image.asset(
|
|
||||||
'assets/walletOptions/clock.png',
|
|
||||||
height: 45,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 22),
|
|
||||||
const Text('Historique des transactions',
|
|
||||||
style:
|
|
||||||
TextStyle(fontSize: 20, color: Colors.black)),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 12 * ratio),
|
SizedBox(height: 12 * ratio),
|
||||||
InkWell(
|
setDefaultWallet(walletProvider, _myWalletProvider,
|
||||||
key: const Key('setDefaultWallet'),
|
_walletOptions, _currentChest),
|
||||||
onTap: !walletProvider.isDefaultWallet
|
|
||||||
? () {
|
|
||||||
defaultWallet = wallet;
|
|
||||||
chestBox.get(currentChest)!.defaultWallet =
|
|
||||||
wallet.number;
|
|
||||||
_myWalletProvider.readAllWallets(_currentChest);
|
|
||||||
_myWalletProvider.rebuildWidget();
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
child: SizedBox(
|
|
||||||
height: 50,
|
|
||||||
child: Row(children: <Widget>[
|
|
||||||
const SizedBox(width: 31),
|
|
||||||
CircleAvatar(
|
|
||||||
backgroundColor: Colors
|
|
||||||
.grey[walletProvider.isDefaultWallet ? 300 : 500],
|
|
||||||
child: Image.asset(
|
|
||||||
'assets/walletOptions/android-checkmark.png',
|
|
||||||
height: 25,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 22),
|
|
||||||
Text(
|
|
||||||
walletProvider.isDefaultWallet
|
|
||||||
? 'Ce portefeuille est celui par defaut'
|
|
||||||
: 'Définir comme portefeuille par défaut',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
color: walletProvider.isDefaultWallet
|
|
||||||
? Colors.grey[500]
|
|
||||||
: Colors.black)),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 17 * ratio),
|
SizedBox(height: 17 * ratio),
|
||||||
if (!walletProvider.isDefaultWallet)
|
if (!walletProvider.isDefaultWallet)
|
||||||
InkWell(
|
deleteWallet(context, walletProvider, _myWalletProvider,
|
||||||
key: const Key('deleteWallet'),
|
_currentChest)
|
||||||
onTap: !walletProvider.isDefaultWallet
|
|
||||||
? () async {
|
|
||||||
await walletProvider.deleteWallet(
|
|
||||||
context, wallet);
|
|
||||||
WidgetsBinding.instance!.addPostFrameCallback((_) {
|
|
||||||
_myWalletProvider.listWallets =
|
|
||||||
_myWalletProvider
|
|
||||||
.readAllWallets(_currentChest);
|
|
||||||
_myWalletProvider.rebuildWidget();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
child: Row(children: <Widget>[
|
|
||||||
const SizedBox(width: 30),
|
|
||||||
Image.asset(
|
|
||||||
'assets/walletOptions/trash.png',
|
|
||||||
height: 45,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 19),
|
|
||||||
const Text('Supprimer ce portefeuille',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20, color: Color(0xffD80000))),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
]);
|
]);
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
|
@ -456,4 +132,329 @@ class WalletOptions extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget avatar(WalletOptionsProvider walletProvider) {
|
||||||
|
return Stack(
|
||||||
|
children: <Widget>[
|
||||||
|
InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
File newAvatar =
|
||||||
|
await (walletProvider.changeAvatar());
|
||||||
|
wallet.imageFile = newAvatar;
|
||||||
|
walletProvider.reloadBuild();
|
||||||
|
},
|
||||||
|
child: wallet.imageFile == null
|
||||||
|
? Image.asset(
|
||||||
|
'assets/avatars/${wallet.imageName}',
|
||||||
|
width: 110,
|
||||||
|
)
|
||||||
|
: Image.file(
|
||||||
|
wallet.imageFile!,
|
||||||
|
width: 110,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
right: 0,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
File newAvatar =
|
||||||
|
await (walletProvider.changeAvatar());
|
||||||
|
wallet.imageFile = newAvatar;
|
||||||
|
walletProvider.reloadBuild();
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/walletOptions/camera.png',
|
||||||
|
height: 40,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget walletName(WalletOptionsProvider walletProvider,
|
||||||
|
WalletOptionsProvider _walletOptions) {
|
||||||
|
int _nbrLinesName = 1;
|
||||||
|
_walletOptions.nameController.text.length >= 15
|
||||||
|
? _nbrLinesName = 2
|
||||||
|
: _nbrLinesName = 1;
|
||||||
|
if (_walletOptions.nameController.text.length >= 26 && isTall) {
|
||||||
|
_nbrLinesName = 3;
|
||||||
|
}
|
||||||
|
bool _isNewNameValid = false;
|
||||||
|
if (_isNewNameValid == false) {
|
||||||
|
_walletOptions.nameController.text = wallet.name!;
|
||||||
|
} else {
|
||||||
|
wallet.name = _walletOptions.nameController.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SizedBox(
|
||||||
|
width: 260,
|
||||||
|
child: Stack(children: <Widget>[
|
||||||
|
TextField(
|
||||||
|
key: const Key('walletName'),
|
||||||
|
autofocus: false,
|
||||||
|
focusNode: walletProvider.walletNameFocus,
|
||||||
|
enabled: walletProvider.isEditing,
|
||||||
|
controller: walletProvider.nameController,
|
||||||
|
maxLines: _nbrLinesName,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
border: InputBorder.none,
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
enabledBorder: InputBorder.none,
|
||||||
|
disabledBorder: InputBorder.none,
|
||||||
|
contentPadding: EdgeInsets.all(15.0),
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: isTall ? 27 : 23,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
fontFamily: 'Monospace'),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
right: 0,
|
||||||
|
child: InkWell(
|
||||||
|
key: const Key('renameWallet'),
|
||||||
|
onTap: () async {
|
||||||
|
_isNewNameValid =
|
||||||
|
walletProvider.editWalletName(wallet.id(), isCesium: false);
|
||||||
|
await Future.delayed(const Duration(milliseconds: 30));
|
||||||
|
walletProvider.walletNameFocus.requestFocus();
|
||||||
|
},
|
||||||
|
child: ClipRRect(
|
||||||
|
child: Image.asset(
|
||||||
|
walletProvider.isEditing
|
||||||
|
? 'assets/walletOptions/android-checkmark.png'
|
||||||
|
: 'assets/walletOptions/edit.png',
|
||||||
|
width: 20,
|
||||||
|
height: 20),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget balance(WalletOptionsProvider walletProvider) {
|
||||||
|
return Column(children: <Widget>[
|
||||||
|
FutureBuilder(
|
||||||
|
future: walletProvider.getBalance(walletProvider.pubkey.text),
|
||||||
|
builder: (BuildContext context, AsyncSnapshot<num?> _balance) {
|
||||||
|
if (_balance.connectionState != ConnectionState.done ||
|
||||||
|
_balance.hasError) {
|
||||||
|
return Text('',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: isTall ? 20 : 18,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
return ImageFiltered(
|
||||||
|
imageFilter: ImageFilter.blur(
|
||||||
|
sigmaX: walletProvider.isBalanceBlur ? 6 : 0,
|
||||||
|
sigmaY: walletProvider.isBalanceBlur ? 5 : 0),
|
||||||
|
child: Text(
|
||||||
|
_balance.data.toString() + ' DU',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: isTall ? 20 : 18,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
InkWell(
|
||||||
|
key: const Key('displayBalance'),
|
||||||
|
onTap: () {
|
||||||
|
walletProvider.bluringBalance();
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
walletProvider.isBalanceBlur
|
||||||
|
? 'assets/walletOptions/icon_oeuil.png'
|
||||||
|
: 'assets/walletOptions/icon_oeuil_close.png',
|
||||||
|
height: 35,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget pubkeyWidget(WalletOptionsProvider walletProvider, BuildContext ctx) {
|
||||||
|
final String shortPubkey =
|
||||||
|
walletProvider.getShortPubkey(walletProvider.pubkey.text);
|
||||||
|
return GestureDetector(
|
||||||
|
key: const Key('copyPubkey'),
|
||||||
|
onTap: () {
|
||||||
|
Clipboard.setData(ClipboardData(text: walletProvider.pubkey.text));
|
||||||
|
walletProvider.snackCopyKey(ctx);
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
height: 50,
|
||||||
|
child: Row(children: <Widget>[
|
||||||
|
const SizedBox(width: 30),
|
||||||
|
Image.asset(
|
||||||
|
'assets/walletOptions/key.png',
|
||||||
|
height: 45,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 20),
|
||||||
|
Text("${shortPubkey.split(':')[0]}:",
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 22,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
fontFamily: 'Monospace',
|
||||||
|
color: Colors.black)),
|
||||||
|
Text(shortPubkey.split(':')[1],
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 22,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
fontFamily: 'Monospace')),
|
||||||
|
const SizedBox(width: 15),
|
||||||
|
SizedBox(
|
||||||
|
height: 40,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
elevation: 1,
|
||||||
|
primary: orangeC, // background
|
||||||
|
onPrimary: Colors.black, // foreground
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Clipboard.setData(
|
||||||
|
ClipboardData(text: walletProvider.pubkey.text));
|
||||||
|
walletProvider.snackCopyKey(ctx);
|
||||||
|
},
|
||||||
|
child: Row(children: <Widget>[
|
||||||
|
Image.asset(
|
||||||
|
'assets/walletOptions/copy-white.png',
|
||||||
|
height: 25,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 7),
|
||||||
|
Text(
|
||||||
|
'Copier',
|
||||||
|
style: TextStyle(fontSize: 15, color: Colors.grey[50]),
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget historyWidget(
|
||||||
|
BuildContext context,
|
||||||
|
WalletsProfilesProvider _historyProvider,
|
||||||
|
WalletOptionsProvider walletProvider) {
|
||||||
|
return InkWell(
|
||||||
|
key: const Key('displayHistory'),
|
||||||
|
onTap: () {
|
||||||
|
_historyProvider.nPage = 1;
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) {
|
||||||
|
return HistoryScreen(
|
||||||
|
pubkey: walletProvider.pubkey.text,
|
||||||
|
avatar: wallet.imageFile == null
|
||||||
|
? Image.asset(
|
||||||
|
'assets/avatars/${wallet.imageName}',
|
||||||
|
width: 110,
|
||||||
|
)
|
||||||
|
: Image.file(
|
||||||
|
wallet.imageFile!,
|
||||||
|
width: 110,
|
||||||
|
));
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
height: 50,
|
||||||
|
child: Row(children: <Widget>[
|
||||||
|
const SizedBox(width: 30),
|
||||||
|
Image.asset(
|
||||||
|
'assets/walletOptions/clock.png',
|
||||||
|
height: 45,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 22),
|
||||||
|
const Text('Historique des transactions',
|
||||||
|
style: TextStyle(fontSize: 20, color: Colors.black)),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget setDefaultWallet(
|
||||||
|
WalletOptionsProvider walletProvider,
|
||||||
|
MyWalletsProvider _myWalletProvider,
|
||||||
|
WalletOptionsProvider _walletOptions,
|
||||||
|
int _currentChest) {
|
||||||
|
WalletData defaultWallet =
|
||||||
|
_myWalletProvider.getDefaultWallet(_currentChest)!;
|
||||||
|
|
||||||
|
_walletOptions.isDefaultWallet = (defaultWallet.number == wallet.id()[1]);
|
||||||
|
|
||||||
|
return InkWell(
|
||||||
|
key: const Key('setDefaultWallet'),
|
||||||
|
onTap: !walletProvider.isDefaultWallet
|
||||||
|
? () {
|
||||||
|
defaultWallet = wallet;
|
||||||
|
chestBox.get(_currentChest)!.defaultWallet = wallet.number;
|
||||||
|
_myWalletProvider.readAllWallets(_currentChest);
|
||||||
|
_myWalletProvider.rebuildWidget();
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
child: SizedBox(
|
||||||
|
height: 50,
|
||||||
|
child: Row(children: <Widget>[
|
||||||
|
const SizedBox(width: 31),
|
||||||
|
CircleAvatar(
|
||||||
|
backgroundColor:
|
||||||
|
Colors.grey[walletProvider.isDefaultWallet ? 300 : 500],
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/walletOptions/android-checkmark.png',
|
||||||
|
height: 25,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 22),
|
||||||
|
Text(
|
||||||
|
walletProvider.isDefaultWallet
|
||||||
|
? 'Ce portefeuille est celui par defaut'
|
||||||
|
: 'Définir comme portefeuille par défaut',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
color: walletProvider.isDefaultWallet
|
||||||
|
? Colors.grey[500]
|
||||||
|
: Colors.black)),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget deleteWallet(
|
||||||
|
BuildContext context,
|
||||||
|
WalletOptionsProvider walletProvider,
|
||||||
|
MyWalletsProvider _myWalletProvider,
|
||||||
|
int _currentChest) {
|
||||||
|
return InkWell(
|
||||||
|
key: const Key('deleteWallet'),
|
||||||
|
onTap: !walletProvider.isDefaultWallet
|
||||||
|
? () async {
|
||||||
|
await walletProvider.deleteWallet(context, wallet);
|
||||||
|
WidgetsBinding.instance!.addPostFrameCallback((_) {
|
||||||
|
_myWalletProvider.listWallets =
|
||||||
|
_myWalletProvider.readAllWallets(_currentChest);
|
||||||
|
_myWalletProvider.rebuildWidget();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
child: Row(children: <Widget>[
|
||||||
|
const SizedBox(width: 30),
|
||||||
|
Image.asset(
|
||||||
|
'assets/walletOptions/trash.png',
|
||||||
|
height: 45,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 19),
|
||||||
|
const Text('Supprimer ce portefeuille',
|
||||||
|
style: TextStyle(fontSize: 20, color: Color(0xffD80000))),
|
||||||
|
]),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,11 +68,12 @@ class WalletsHome extends StatelessWidget {
|
||||||
return Column(children: [
|
return Column(children: [
|
||||||
const SizedBox(height: 50),
|
const SizedBox(height: 50),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 120,
|
height: 90,
|
||||||
width: 445,
|
width: 420,
|
||||||
child: ElevatedButton.icon(
|
child: ElevatedButton.icon(
|
||||||
icon: Image.asset(
|
icon: Image.asset(
|
||||||
'assets/chests/config.png',
|
'assets/chests/config.png',
|
||||||
|
height: 60,
|
||||||
),
|
),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
elevation: 2,
|
elevation: 2,
|
||||||
|
@ -86,9 +87,9 @@ class WalletsHome extends StatelessWidget {
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
label: const Text(
|
label: const Text(
|
||||||
" Paramétrer ce coffre",
|
" Paramétrer ce coffre",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 25,
|
fontSize: 22,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
color: Color(0xff8a3c0f),
|
color: Color(0xff8a3c0f),
|
||||||
),
|
),
|
||||||
|
@ -96,10 +97,13 @@ class WalletsHome extends StatelessWidget {
|
||||||
)),
|
)),
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 120,
|
height: 90,
|
||||||
width: 445,
|
width: 420,
|
||||||
child: ElevatedButton.icon(
|
child: ElevatedButton.icon(
|
||||||
icon: Image.asset('assets/chests/miniChests.png'),
|
icon: Image.asset(
|
||||||
|
'assets/chests/miniChests.png',
|
||||||
|
height: 70,
|
||||||
|
),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
elevation: 2,
|
elevation: 2,
|
||||||
primary: floattingYellow, // background
|
primary: floattingYellow, // background
|
||||||
|
@ -112,9 +116,9 @@ class WalletsHome extends StatelessWidget {
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
label: const Text(
|
label: const Text(
|
||||||
" Changer de coffre",
|
" Changer de coffre",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 25,
|
fontSize: 22,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
color: Color(0xff8a3c0f),
|
color: Color(0xff8a3c0f),
|
||||||
),
|
),
|
||||||
|
@ -148,12 +152,20 @@ class WalletsHome extends StatelessWidget {
|
||||||
List _listWallets = _myWalletProvider.listWallets;
|
List _listWallets = _myWalletProvider.listWallets;
|
||||||
WalletData? defaultWallet =
|
WalletData? defaultWallet =
|
||||||
_myWalletProvider.getDefaultWallet(configBox.get('currentChest'));
|
_myWalletProvider.getDefaultWallet(configBox.get('currentChest'));
|
||||||
|
final double screenWidth = MediaQuery.of(context).size.width;
|
||||||
|
int nTule = 2;
|
||||||
|
|
||||||
|
if (screenWidth >= 900) {
|
||||||
|
nTule = 4;
|
||||||
|
} else if (screenWidth >= 650) {
|
||||||
|
nTule = 3;
|
||||||
|
}
|
||||||
|
|
||||||
return CustomScrollView(slivers: <Widget>[
|
return CustomScrollView(slivers: <Widget>[
|
||||||
const SliverToBoxAdapter(child: SizedBox(height: 20)),
|
const SliverToBoxAdapter(child: SizedBox(height: 20)),
|
||||||
SliverGrid.count(
|
SliverGrid.count(
|
||||||
key: const Key('listWallets'),
|
key: const Key('listWallets'),
|
||||||
crossAxisCount: 2,
|
crossAxisCount: nTule,
|
||||||
childAspectRatio: 1,
|
childAspectRatio: 1,
|
||||||
crossAxisSpacing: 0,
|
crossAxisSpacing: 0,
|
||||||
mainAxisSpacing: 0,
|
mainAxisSpacing: 0,
|
||||||
|
|
|
@ -31,7 +31,7 @@ class OnboardingStepTwelve extends StatelessWidget {
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'assets/onBoarding/plusieurs-codes-secrets-un-trousseau.png',
|
'assets/onBoarding/plusieurs-codes-secrets-un-trousseau.png',
|
||||||
height: 410 * ratio,
|
height: isTall ? 410 : 380,
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Align(
|
child: Align(
|
||||||
|
@ -57,7 +57,7 @@ class OnboardingStepTwelve extends StatelessWidget {
|
||||||
child: const Text("Générer le code secret",
|
child: const Text("Générer le code secret",
|
||||||
style: TextStyle(fontSize: 20))),
|
style: TextStyle(fontSize: 20))),
|
||||||
))),
|
))),
|
||||||
SizedBox(height: isTall ? 80 : 40),
|
const SizedBox(height: 80),
|
||||||
]),
|
]),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ class OnboardingStepFourteen extends StatelessWidget {
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
onCompleted: (_pin) async {
|
onCompleted: (_pin) async {
|
||||||
_myWalletProvider.pinCode = _pin;
|
_myWalletProvider.pinCode = _pin.toUpperCase();
|
||||||
_myWalletProvider.pinLenght = _pinLenght;
|
_myWalletProvider.pinLenght = _pinLenght;
|
||||||
log.d(_pin + ' || ' + _generateWalletProvider.pin.text);
|
log.d(_pin + ' || ' + _generateWalletProvider.pin.text);
|
||||||
if (_pin.toUpperCase() == _generateWalletProvider.pin.text) {
|
if (_pin.toUpperCase() == _generateWalletProvider.pin.text) {
|
||||||
|
@ -124,10 +124,12 @@ class OnboardingStepFourteen extends StatelessWidget {
|
||||||
await _generateWalletProvider.storeHDWChest(
|
await _generateWalletProvider.storeHDWChest(
|
||||||
generatedWallet, 'Mon portefeuille courant', context);
|
generatedWallet, 'Mon portefeuille courant', context);
|
||||||
_myWalletProvider.readAllWallets(_currentChest);
|
_myWalletProvider.readAllWallets(_currentChest);
|
||||||
scheduleMicrotask(() {
|
// scheduleMicrotask(() {
|
||||||
_walletOptions.reloadBuild();
|
_walletOptions.reloadBuild();
|
||||||
_myWalletProvider.rebuildWidget();
|
// _myWalletProvider.rebuildWidget();
|
||||||
});
|
// });
|
||||||
|
_generateWalletProvider.generatedMnemonic =
|
||||||
|
_generateWalletProvider.pin.text = '';
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
FaderTransition(
|
FaderTransition(
|
||||||
|
|
|
@ -43,8 +43,8 @@ class OnboardingStepSeven extends StatelessWidget {
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.only(bottom: 90),
|
padding: const EdgeInsets.only(bottom: 90),
|
||||||
child: common.bubbleSpeak(
|
child: common.bubbleSpeak(
|
||||||
"Moi, j’ai déjà essayé de\nmémoriser une phrase de\nrestauration, mais je n’ai\npas une mémoire\nd’éléphant.",
|
"Moi, j’ai déjà essayé de\nmémoriser une phrase de\nrestauration, mais je n’ai\npas une mémoire\nd’éléphant.",
|
||||||
),
|
isMaxWidth: false),
|
||||||
),
|
),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'assets/onBoarding/chopp-gecko.png',
|
'assets/onBoarding/chopp-gecko.png',
|
||||||
|
|
|
@ -29,7 +29,7 @@ class OnboardingStepEight extends StatelessWidget {
|
||||||
"J’ai généré votre phrase de restauration !\nTâchez de la garder bien secrète, car elle permet à quiconque la connaît d’accéder à tous vos portefeuilles.",
|
"J’ai généré votre phrase de restauration !\nTâchez de la garder bien secrète, car elle permet à quiconque la connaît d’accéder à tous vos portefeuilles.",
|
||||||
textKey: const Key('step6'),
|
textKey: const Key('step6'),
|
||||||
),
|
),
|
||||||
SizedBox(height: isTall ? 61 : 31),
|
SizedBox(height: isTall ? 70 : 40),
|
||||||
// SizedBox(height: 30),
|
// SizedBox(height: 30),
|
||||||
sentanceArray(context),
|
sentanceArray(context),
|
||||||
// ),
|
// ),
|
||||||
|
@ -63,9 +63,10 @@ class OnboardingStepEight extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget sentanceArray(BuildContext context) {
|
Widget sentanceArray(BuildContext context) {
|
||||||
return Container(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
constraints: const BoxConstraints(maxWidth: 450),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(color: Colors.black),
|
border: Border.all(color: Colors.black),
|
||||||
color: Colors.grey[300],
|
color: Colors.grey[300],
|
||||||
|
@ -116,7 +117,7 @@ Widget arrayCell(dataWord) {
|
||||||
ImageFiltered(
|
ImageFiltered(
|
||||||
imageFilter: ImageFilter.blur(sigmaX: 4, sigmaY: 4),
|
imageFilter: ImageFilter.blur(sigmaX: 4, sigmaY: 4),
|
||||||
child: Text(dataWord.split(':')[1],
|
child: Text(dataWord.split(':')[1],
|
||||||
style: const TextStyle(fontSize: 20, color: Colors.black)),
|
style: const TextStyle(fontSize: 19, color: Colors.black)),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
|
|
|
@ -115,9 +115,10 @@ Widget sentanceArray(BuildContext context) {
|
||||||
|
|
||||||
List formatedArray = _generateWalletProvider.generateWordList();
|
List formatedArray = _generateWalletProvider.generateWordList();
|
||||||
|
|
||||||
return Container(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
constraints: const BoxConstraints(maxWidth: 450),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(color: Colors.black),
|
border: Border.all(color: Colors.black),
|
||||||
color: Colors.grey[300],
|
color: Colors.grey[300],
|
||||||
|
@ -187,6 +188,11 @@ class PrintWallet extends StatelessWidget {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
leading: IconButton(
|
||||||
|
icon: const Icon(Icons.arrow_back, color: Colors.white),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
}),
|
||||||
toolbarHeight: 60 * ratio,
|
toolbarHeight: 60 * ratio,
|
||||||
title: const Text('Imprimer ce trousseau')),
|
title: const Text('Imprimer ce trousseau')),
|
||||||
body: PdfPreview(
|
body: PdfPreview(
|
||||||
|
|
|
@ -14,6 +14,7 @@ class SearchScreen extends StatelessWidget {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||||
SearchProvider _searchProvider = Provider.of<SearchProvider>(context);
|
SearchProvider _searchProvider = Provider.of<SearchProvider>(context);
|
||||||
|
final double screenHeight = MediaQuery.of(context).size.height;
|
||||||
|
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () {
|
onWillPop: () {
|
||||||
|
@ -101,7 +102,7 @@ class SearchScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(flex: 1),
|
Spacer(flex: screenHeight <= 800 ? 1 : 2),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
|
@ -440,9 +440,9 @@ void main() {
|
||||||
await goBack();
|
await goBack();
|
||||||
await deleteAllWallets();
|
await deleteAllWallets();
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
final String pincode = await (createNewKeychain('Fast wallet') as FutureOr<String>);
|
final String? pincode = await (createNewKeychain('Fast wallet'));
|
||||||
await sleep(200);
|
await sleep(200);
|
||||||
await driver!.enterText(pincode);
|
await driver!.enterText(pincode!);
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
await createDerivation();
|
await createDerivation();
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
|
|
Loading…
Reference in New Issue