Merge branch 'codemetrics'
This commit is contained in:
commit
a0d6bfaf22
|
@ -5,16 +5,11 @@ import 'package:gecko/models/g1_wallets_list.dart';
|
|||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:logger/logger.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
// Version of box data
|
||||
const int dataVersion = 4;
|
||||
|
||||
// Files paths
|
||||
Directory? appPath;
|
||||
|
||||
late String appVersion;
|
||||
late SharedPreferences prefs;
|
||||
const int pinLength = 5;
|
||||
const String appLang = 'english';
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ import 'package:hive_flutter/hive_flutter.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:responsive_framework/responsive_framework.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
import 'package:graphql_flutter/graphql_flutter.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
@ -61,7 +60,6 @@ Future<void> main() async {
|
|||
await initHiveForFlutter();
|
||||
await homeProvider.initHive();
|
||||
appVersion = await homeProvider.getAppVersion();
|
||||
prefs = await SharedPreferences.getInstance();
|
||||
|
||||
// Reset GraphQL cache
|
||||
// final cache = HiveStore();
|
||||
|
|
|
@ -6,7 +6,7 @@ part 'g1_wallets_list.g.dart';
|
|||
@HiveType(typeId: 2)
|
||||
class G1WalletsList {
|
||||
@HiveField(0)
|
||||
String? pubkey;
|
||||
late String address;
|
||||
|
||||
@HiveField(1)
|
||||
double? balance;
|
||||
|
@ -27,7 +27,7 @@ class G1WalletsList {
|
|||
bool? isMembre;
|
||||
|
||||
G1WalletsList({
|
||||
this.pubkey,
|
||||
required this.address,
|
||||
this.balance,
|
||||
this.id,
|
||||
this.avatar,
|
||||
|
@ -37,14 +37,14 @@ class G1WalletsList {
|
|||
});
|
||||
|
||||
G1WalletsList.fromJson(Map<String, dynamic> json) {
|
||||
pubkey = json['pubkey'];
|
||||
address = json['pubkey'];
|
||||
balance = json['balance'];
|
||||
id = json['id'] != null ? Id.fromJson(json['id']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['pubkey'] = pubkey;
|
||||
data['pubkey'] = address;
|
||||
data['balance'] = balance;
|
||||
if (id != null) {
|
||||
data['id'] = id!.toJson();
|
||||
|
|
|
@ -17,7 +17,7 @@ class G1WalletsListAdapter extends TypeAdapter<G1WalletsList> {
|
|||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return G1WalletsList(
|
||||
pubkey: fields[0] as String?,
|
||||
address: fields[0] as String,
|
||||
balance: fields[1] as double?,
|
||||
id: fields[2] as Id?,
|
||||
avatar: fields[3] as Image?,
|
||||
|
@ -32,7 +32,7 @@ class G1WalletsListAdapter extends TypeAdapter<G1WalletsList> {
|
|||
writer
|
||||
..writeByte(7)
|
||||
..writeByte(0)
|
||||
..write(obj.pubkey)
|
||||
..write(obj.address)
|
||||
..writeByte(1)
|
||||
..write(obj.balance)
|
||||
..writeByte(2)
|
||||
|
|
|
@ -18,40 +18,6 @@ query ($name: String!) {
|
|||
''';
|
||||
|
||||
const String getHistoryByAddressQ = r'''
|
||||
query ($address: String!) {
|
||||
account_by_pk(id: "5CQ8T4qpbYJq7uVsxGPQ5q2df7x3Wa4aRY6HUWMBYjfLZhnn") {
|
||||
transactions_issued {
|
||||
receiver_id
|
||||
amount
|
||||
created_at
|
||||
created_on
|
||||
}
|
||||
transactions_received {
|
||||
issuer_id
|
||||
amount
|
||||
created_at
|
||||
created_on
|
||||
}
|
||||
}
|
||||
}
|
||||
''';
|
||||
|
||||
const String getHistoryByAddressQ2 = r'''
|
||||
query ($address: String!) {
|
||||
{
|
||||
transaction(where: {_or: [{issuer_id: {_eq: $address}},
|
||||
{receiver_id: {_eq: $address}}]}, order_by: {created_at: desc})
|
||||
{
|
||||
amount
|
||||
created_at
|
||||
issuer_id
|
||||
receiver_id
|
||||
}
|
||||
}
|
||||
}
|
||||
''';
|
||||
|
||||
const String getHistoryByAddressQ3 = r'''
|
||||
query ($address: String!, $number: Int!, $cursor: String) {
|
||||
transaction_connection(where:
|
||||
{_or: [
|
||||
|
|
|
@ -59,8 +59,10 @@ const keyCloseTransactionScreen = Key('keyCloseTransactionScreen');
|
|||
|
||||
// Activity view
|
||||
const keyListTransactions = Key('keyListTransactions');
|
||||
const keyActivityScreen = Key('keyActivityScreen');
|
||||
|
||||
// Unlock wallet
|
||||
const keyUnlockWallet = Key('keyUnlockWallet');
|
||||
const keyPinForm = Key('keyPinForm');
|
||||
const keyPopButton = Key('keyPopButton');
|
||||
const keyCachePassword = Key('keyCachePassword');
|
||||
|
|
|
@ -8,7 +8,7 @@ import 'package:path_provider/path_provider.dart';
|
|||
|
||||
class CesiumPlusProvider with ChangeNotifier {
|
||||
TextEditingController cesiumName = TextEditingController();
|
||||
Image defaultAvatar(double? size) =>
|
||||
Image defaultAvatar(double size) =>
|
||||
Image.asset(('assets/icon_user.png'), height: size);
|
||||
|
||||
CancelToken avatarCancelToken = CancelToken();
|
||||
|
|
|
@ -212,7 +212,7 @@ class DuniterIndexer with ChangeNotifier {
|
|||
g1WalletsBox.put(
|
||||
address,
|
||||
G1WalletsList(
|
||||
pubkey: address, username: walletNameIndexer[address]));
|
||||
address: address, username: walletNameIndexer[address]));
|
||||
|
||||
// log.d(g1WalletsBox.toMap().values.first.username);
|
||||
|
||||
|
|
|
@ -231,24 +231,3 @@ class HomeProvider with ChangeNotifier {
|
|||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
class CustomRoundedButton extends CustomPainter {
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
Paint paint = Paint()
|
||||
..color = yellowC
|
||||
..style = PaintingStyle.fill;
|
||||
Path path = Path();
|
||||
path.lineTo(size.width * 0.4, 0);
|
||||
path.quadraticBezierTo(size.width * 0.5, -40, size.width * 0.6, 0);
|
||||
path.lineTo(size.width, 0);
|
||||
path.lineTo(size.width, size.height);
|
||||
path.lineTo(0, size.height);
|
||||
canvas.drawPath(path, paint);
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(covariant CustomPainter oldDelegate) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ class SearchProvider with ChangeNotifier {
|
|||
WalletsProfilesProvider('pubkey');
|
||||
|
||||
if (walletProfiles.isAddress(searchController.text)) {
|
||||
G1WalletsList wallet = G1WalletsList(pubkey: searchController.text);
|
||||
G1WalletsList wallet = G1WalletsList(address: searchController.text);
|
||||
return [wallet];
|
||||
} else {
|
||||
return [];
|
||||
|
|
|
@ -548,7 +548,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
}
|
||||
|
||||
Future<KeyPairData?> changePassword(BuildContext context, String address,
|
||||
String passOld, String? passNew) async {
|
||||
String passOld, String passNew) async {
|
||||
final account = getKeypair(address);
|
||||
MyWalletsProvider myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context, listen: false);
|
||||
|
@ -980,19 +980,6 @@ newKeySig: $newKeySig""");
|
|||
/////// 6: UI ELEMENTS (off class) /////////
|
||||
////////////////////////////////////////////
|
||||
|
||||
void snack(BuildContext context, String message, {int duration = 2}) {
|
||||
final snackBar =
|
||||
SnackBar(content: Text(message), duration: Duration(seconds: duration));
|
||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||
}
|
||||
|
||||
class AddressInfo {
|
||||
final String? address;
|
||||
double balance;
|
||||
|
||||
AddressInfo({@required this.address, this.balance = 0});
|
||||
}
|
||||
|
||||
void snackNode(BuildContext context, bool isConnected) {
|
||||
String message;
|
||||
if (!isConnected) {
|
||||
|
@ -1018,11 +1005,6 @@ String getShortPubkey(String pubkey) {
|
|||
return pubkeyShort;
|
||||
}
|
||||
|
||||
class PasswordException implements Exception {
|
||||
String cause;
|
||||
PasswordException(this.cause);
|
||||
}
|
||||
|
||||
Uint8List _int32bytes(int value) =>
|
||||
Uint8List(4)..buffer.asInt32List()[0] = value;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import 'package:provider/provider.dart';
|
|||
class WalletsProfilesProvider with ChangeNotifier {
|
||||
WalletsProfilesProvider(this.address);
|
||||
|
||||
String? address = '';
|
||||
String address = '';
|
||||
String pubkeyShort = '';
|
||||
|
||||
bool isHistoryScreen = false;
|
||||
|
@ -231,10 +231,10 @@ class WalletsProfilesProvider with ChangeNotifier {
|
|||
|
||||
Future addContact(G1WalletsList profile) async {
|
||||
// log.d(profile.username);
|
||||
if (isContact(profile.pubkey!)) {
|
||||
await contactsBox.delete(profile.pubkey);
|
||||
if (isContact(profile.address)) {
|
||||
await contactsBox.delete(profile.address);
|
||||
} else {
|
||||
await contactsBox.put(profile.pubkey, profile);
|
||||
await contactsBox.put(profile.address, profile);
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
|
|
@ -16,13 +16,13 @@ import 'package:graphql_flutter/graphql_flutter.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
|
||||
class ActivityScreen extends StatelessWidget with ChangeNotifier {
|
||||
ActivityScreen({required this.address, this.avatar, this.username, Key? key})
|
||||
: super(key: key);
|
||||
ActivityScreen({required this.address, required this.avatar, this.username})
|
||||
: super(key: keyActivityScreen);
|
||||
final ScrollController scrollController = ScrollController();
|
||||
final double avatarsSize = 80;
|
||||
final String? address;
|
||||
final String address;
|
||||
final String? username;
|
||||
final Image? avatar;
|
||||
final Image avatar;
|
||||
|
||||
FetchMore? fetchMore;
|
||||
FetchMoreOptions? opts;
|
||||
|
@ -49,7 +49,7 @@ class ActivityScreen extends StatelessWidget with ChangeNotifier {
|
|||
),
|
||||
bottomNavigationBar: homeProvider.bottomAppBar(context),
|
||||
body: Column(children: <Widget>[
|
||||
walletProfile.headerProfileView(context, address!, username),
|
||||
walletProfile.headerProfileView(context, address, username),
|
||||
historyQuery(context),
|
||||
]));
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ class ActivityScreen extends StatelessWidget with ChangeNotifier {
|
|||
children: <Widget>[
|
||||
Query(
|
||||
options: QueryOptions(
|
||||
document: gql(getHistoryByAddressQ3),
|
||||
document: gql(getHistoryByAddressQ),
|
||||
variables: <String, dynamic>{
|
||||
'address': address,
|
||||
'number': 20,
|
||||
|
@ -126,7 +126,7 @@ class ActivityScreen extends StatelessWidget with ChangeNotifier {
|
|||
|
||||
if (result.isNotLoading) {
|
||||
// log.d(result.data);
|
||||
opts = duniterIndexer.checkQueryResult(result, opts, address!);
|
||||
opts = duniterIndexer.checkQueryResult(result, opts, address);
|
||||
}
|
||||
|
||||
// Build history list
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AvatarFullscreen extends StatelessWidget {
|
||||
const AvatarFullscreen(this.avatar, {this.title, this.color, Key? key})
|
||||
: super(key: key);
|
||||
final Image? avatar;
|
||||
final String? title;
|
||||
final Color? color;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
// HomeProvider _homeProvider = Provider.of<HomeProvider>(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
backgroundColor: color ?? Colors.black,
|
||||
toolbarHeight: 60 * ratio,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.arrow_back, color: orangeC),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
}),
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text(
|
||||
title ?? 'Photo de profil',
|
||||
style: TextStyle(color: orangeC),
|
||||
),
|
||||
)),
|
||||
body: SafeArea(
|
||||
child: SizedBox.expand(
|
||||
child: Container(
|
||||
color: color ?? Colors.black,
|
||||
// alignment: Alignment.center,
|
||||
// height: MediaQuery.of(context).size.height,
|
||||
// width: MediaQuery.of(context).size.width,
|
||||
child: Image(
|
||||
image: avatar!.image,
|
||||
height: avatar!.height,
|
||||
fit: BoxFit.fitWidth),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -187,8 +187,8 @@ class CommonElements {
|
|||
}
|
||||
|
||||
class SmoothTransition extends PageRouteBuilder {
|
||||
final Widget? page;
|
||||
SmoothTransition({this.page})
|
||||
final Widget page;
|
||||
SmoothTransition({required this.page})
|
||||
: super(
|
||||
pageBuilder: (
|
||||
BuildContext context,
|
||||
|
@ -199,7 +199,7 @@ class SmoothTransition extends PageRouteBuilder {
|
|||
duration: const Duration(seconds: 5),
|
||||
tween: Tween(begin: 200, end: 200),
|
||||
builder: (BuildContext context, dynamic value, Widget? child) {
|
||||
return page!;
|
||||
return page;
|
||||
},
|
||||
),
|
||||
);
|
||||
|
|
|
@ -72,7 +72,7 @@ class ChooseWalletScreen extends StatelessWidget {
|
|||
));
|
||||
}
|
||||
|
||||
Widget myWalletsTiles(BuildContext context, int? currentChest) {
|
||||
Widget myWalletsTiles(BuildContext context, int currentChest) {
|
||||
MyWalletsProvider myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context);
|
||||
// SubstrateSdk _sub = Provider.of<SubstrateSdk>(context, listen: false);
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
// import 'package:gecko/models/home.dart';
|
||||
// import 'package:provider/provider.dart';
|
||||
|
||||
class TransactionCommentScreen extends StatelessWidget {
|
||||
TextEditingController tplController = TextEditingController();
|
||||
|
||||
TransactionCommentScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
// HomeProvider _homeProvider = Provider.of<HomeProvider>(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text('confirmPayment'.tr()),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
const SizedBox(height: 20),
|
||||
TextField(
|
||||
enabled: true,
|
||||
controller: tplController,
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
decoration: const InputDecoration(
|
||||
contentPadding: EdgeInsets.all(15.0),
|
||||
),
|
||||
style: const TextStyle(
|
||||
fontSize: 22.0,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w400)),
|
||||
const SizedBox(height: 20),
|
||||
]),
|
||||
));
|
||||
}
|
||||
}
|
|
@ -17,9 +17,8 @@ import 'package:provider/provider.dart';
|
|||
import 'package:gecko/globals.dart';
|
||||
|
||||
class UnlockingWallet extends StatelessWidget {
|
||||
UnlockingWallet({Key? keyUnlockWallet, required this.wallet})
|
||||
: super(key: keyUnlockWallet);
|
||||
WalletData? wallet;
|
||||
UnlockingWallet({required this.wallet}) : super(key: keyUnlockWallet);
|
||||
WalletData wallet;
|
||||
late int currentChestNumber;
|
||||
late ChestData currentChest;
|
||||
bool canUnlock = true;
|
||||
|
@ -39,7 +38,7 @@ class UnlockingWallet extends StatelessWidget {
|
|||
currentChestNumber = configBox.get('currentChest');
|
||||
currentChest = chestBox.get(currentChestNumber)!;
|
||||
|
||||
int pinLenght = walletOptions.getPinLenght(wallet!.number);
|
||||
int pinLenght = walletOptions.getPinLenght(wallet.number);
|
||||
errorController = StreamController<ErrorAnimationType>();
|
||||
|
||||
return Scaffold(
|
||||
|
|
|
@ -77,7 +77,7 @@ class ContactsScreen extends StatelessWidget {
|
|||
leading: cesiumPlusProvider
|
||||
.defaultAvatar(avatarSize),
|
||||
title: Row(children: <Widget>[
|
||||
Text(getShortPubkey(g1Wallet.pubkey!),
|
||||
Text(getShortPubkey(g1Wallet.address),
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontFamily: 'Monospace',
|
||||
|
@ -98,14 +98,14 @@ class ContactsScreen extends StatelessWidget {
|
|||
MainAxisAlignment.center,
|
||||
children: [
|
||||
balance(context,
|
||||
g1Wallet.pubkey!, 16),
|
||||
g1Wallet.address, 16),
|
||||
]),
|
||||
]),
|
||||
),
|
||||
]),
|
||||
subtitle: Row(children: <Widget>[
|
||||
duniterIndexer.getNameByAddress(
|
||||
context, g1Wallet.pubkey!)
|
||||
context, g1Wallet.address)
|
||||
]),
|
||||
dense: false,
|
||||
isThreeLine: false,
|
||||
|
@ -114,15 +114,15 @@ class ContactsScreen extends StatelessWidget {
|
|||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
walletsProfilesClass.address =
|
||||
g1Wallet.pubkey;
|
||||
g1Wallet.address;
|
||||
return WalletViewScreen(
|
||||
address: g1Wallet.pubkey,
|
||||
address: g1Wallet.address,
|
||||
username: g1WalletsBox
|
||||
.get(g1Wallet.pubkey)
|
||||
.get(g1Wallet.address)
|
||||
?.id
|
||||
?.username,
|
||||
avatar: g1WalletsBox
|
||||
.get(g1Wallet.pubkey)
|
||||
.get(g1Wallet.address)
|
||||
?.avatar,
|
||||
);
|
||||
}),
|
||||
|
|
|
@ -144,76 +144,6 @@ class OnboardingStepSix extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
Widget sentanceArray(BuildContext context) {
|
||||
GenerateWalletsProvider generateWalletProvider =
|
||||
Provider.of<GenerateWalletsProvider>(context);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 3),
|
||||
child: Container(
|
||||
constraints: const BoxConstraints(maxWidth: 450),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.black),
|
||||
color: const Color(0xffeeeedd),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10),
|
||||
)),
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: FutureBuilder(
|
||||
future: generateWalletProvider.generateWordList(context),
|
||||
builder: (BuildContext context, AsyncSnapshot<List> data) {
|
||||
if (!data.hasData) {
|
||||
return const Text('');
|
||||
} else {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Row(children: <Widget>[
|
||||
arrayCell(data.data![0]),
|
||||
arrayCell(data.data![1]),
|
||||
arrayCell(data.data![2]),
|
||||
arrayCell(data.data![3]),
|
||||
]),
|
||||
const SizedBox(height: 15),
|
||||
Row(children: <Widget>[
|
||||
arrayCell(data.data![4]),
|
||||
arrayCell(data.data![5]),
|
||||
arrayCell(data.data![6]),
|
||||
arrayCell(data.data![7]),
|
||||
]),
|
||||
const SizedBox(height: 15),
|
||||
Row(children: <Widget>[
|
||||
arrayCell(data.data![8]),
|
||||
arrayCell(data.data![9]),
|
||||
arrayCell(data.data![10]),
|
||||
arrayCell(data.data![11]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget arrayCell(dataWord) {
|
||||
return SizedBox(
|
||||
width: 100,
|
||||
child: Column(children: <Widget>[
|
||||
Text(
|
||||
dataWord.split(':')[0],
|
||||
style: const TextStyle(fontSize: 15, color: Color(0xff6b6b52)),
|
||||
),
|
||||
Text(
|
||||
dataWord.split(':')[1],
|
||||
key: keyMnemonicWord(dataWord.split(':')[0]),
|
||||
style: const TextStyle(fontSize: 20, color: Colors.black),
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Widget nextButton(BuildContext context, String text, nextScreen, bool isFast) {
|
||||
GenerateWalletsProvider generateWalletProvider =
|
||||
Provider.of<GenerateWalletsProvider>(context, listen: false);
|
||||
|
|
|
@ -94,13 +94,13 @@ class SearchResultScreen extends StatelessWidget {
|
|||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 5),
|
||||
child: ListTile(
|
||||
key: keySearchResult(g1Wallet.pubkey!),
|
||||
key: keySearchResult(g1Wallet.address),
|
||||
horizontalTitleGap: 40,
|
||||
contentPadding: const EdgeInsets.all(5),
|
||||
leading: cesiumPlusProvider
|
||||
.defaultAvatar(avatarSize),
|
||||
title: Row(children: <Widget>[
|
||||
Text(getShortPubkey(g1Wallet.pubkey!),
|
||||
Text(getShortPubkey(g1Wallet.address),
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontFamily: 'Monospace',
|
||||
|
@ -124,7 +124,7 @@ class SearchResultScreen extends StatelessWidget {
|
|||
children: [
|
||||
balance(
|
||||
context,
|
||||
g1Wallet.pubkey!,
|
||||
g1Wallet.address,
|
||||
16),
|
||||
]),
|
||||
]),
|
||||
|
@ -132,7 +132,7 @@ class SearchResultScreen extends StatelessWidget {
|
|||
]),
|
||||
subtitle: Row(children: <Widget>[
|
||||
duniterIndexer.getNameByAddress(
|
||||
context, g1Wallet.pubkey!)
|
||||
context, g1Wallet.address)
|
||||
]),
|
||||
dense: false,
|
||||
isThreeLine: false,
|
||||
|
@ -141,15 +141,15 @@ class SearchResultScreen extends StatelessWidget {
|
|||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
walletsProfilesClass.address =
|
||||
g1Wallet.pubkey;
|
||||
g1Wallet.address;
|
||||
return WalletViewScreen(
|
||||
address: g1Wallet.pubkey,
|
||||
address: g1Wallet.address,
|
||||
username: g1WalletsBox
|
||||
.get(g1Wallet.pubkey)
|
||||
.get(g1Wallet.address)
|
||||
?.id
|
||||
?.username,
|
||||
avatar: g1WalletsBox
|
||||
.get(g1Wallet.pubkey)
|
||||
.get(g1Wallet.address)
|
||||
?.avatar,
|
||||
);
|
||||
}),
|
||||
|
|
|
@ -35,10 +35,10 @@ class TransactionInProgress extends StatelessWidget {
|
|||
|
||||
// sub.spawnBlock();
|
||||
|
||||
log.d(walletViewProvider.address!);
|
||||
log.d(walletViewProvider.address);
|
||||
|
||||
final from = fromAddress ?? myWalletProvider.getDefaultWallet().name!;
|
||||
final to = toAddress ?? getShortPubkey(walletViewProvider.address!);
|
||||
final to = toAddress ?? getShortPubkey(walletViewProvider.address);
|
||||
final amount = walletViewProvider.payAmount.text;
|
||||
String actionName = '';
|
||||
final bool isUdUnit = configBox.get('isUdUnit') ?? false;
|
||||
|
|
|
@ -26,7 +26,7 @@ class WalletViewScreen extends StatelessWidget {
|
|||
const WalletViewScreen(
|
||||
{required this.address, this.username, this.avatar, Key? key})
|
||||
: super(key: key);
|
||||
final String? address;
|
||||
final String address;
|
||||
final String? username;
|
||||
final Image? avatar;
|
||||
final double buttonSize = 100;
|
||||
|
@ -39,7 +39,7 @@ class WalletViewScreen extends StatelessWidget {
|
|||
Provider.of<WalletsProfilesProvider>(context, listen: false);
|
||||
CesiumPlusProvider cesiumPlusProvider =
|
||||
Provider.of<CesiumPlusProvider>(context, listen: false);
|
||||
walletProfile.address = address!;
|
||||
walletProfile.address = address;
|
||||
SubstrateSdk sub = Provider.of<SubstrateSdk>(context, listen: false);
|
||||
HomeProvider homeProvider =
|
||||
Provider.of<HomeProvider>(context, listen: false);
|
||||
|
@ -68,10 +68,10 @@ class WalletViewScreen extends StatelessWidget {
|
|||
});
|
||||
// G1WalletsList(pubkey: pubkey!, username: username);
|
||||
await walletProfile.addContact(
|
||||
newContact ?? G1WalletsList(pubkey: address!));
|
||||
newContact ?? G1WalletsList(address: address));
|
||||
},
|
||||
icon: Icon(
|
||||
walletProfile.isContact(address!)
|
||||
walletProfile.isContact(address)
|
||||
? Icons.add_reaction_rounded
|
||||
: Icons.add_reaction_outlined,
|
||||
size: 35,
|
||||
|
@ -85,13 +85,13 @@ class WalletViewScreen extends StatelessWidget {
|
|||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return QrCodeFullscreen(
|
||||
walletProfile.address!,
|
||||
walletProfile.address,
|
||||
);
|
||||
}),
|
||||
);
|
||||
},
|
||||
child: QrImageWidget(
|
||||
data: walletProfile.address!,
|
||||
data: walletProfile.address,
|
||||
version: QrVersions.auto,
|
||||
size: 80,
|
||||
),
|
||||
|
@ -107,7 +107,7 @@ class WalletViewScreen extends StatelessWidget {
|
|||
bottomNavigationBar: homeProvider.bottomAppBar(context),
|
||||
body: SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
walletProfile.headerProfileView(context, address!, username),
|
||||
walletProfile.headerProfileView(context, address, username),
|
||||
SizedBox(height: isTall ? 10 : 0),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
|
||||
Column(children: <Widget>[
|
||||
|
@ -150,7 +150,7 @@ class WalletViewScreen extends StatelessWidget {
|
|||
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||
WalletData? defaultWallet = myWalletProvider.getDefaultWallet();
|
||||
return FutureBuilder(
|
||||
future: sub.certState(defaultWallet.address!, address!),
|
||||
future: sub.certState(defaultWallet.address!, address),
|
||||
builder: (context, AsyncSnapshot<Map<String, int>> snapshot) {
|
||||
if (snapshot.data == null) return const SizedBox();
|
||||
String duration = '';
|
||||
|
@ -217,7 +217,7 @@ class WalletViewScreen extends StatelessWidget {
|
|||
context,
|
||||
"areYouSureYouWantToCertify".tr(
|
||||
args: [
|
||||
getShortPubkey(address!)
|
||||
getShortPubkey(address)
|
||||
]));
|
||||
|
||||
if (result ?? false) {
|
||||
|
@ -243,10 +243,9 @@ class WalletViewScreen extends StatelessWidget {
|
|||
final acc = sub.getCurrentWallet();
|
||||
sub.certify(
|
||||
acc.address!,
|
||||
walletViewProvider.address!,
|
||||
walletViewProvider.address,
|
||||
pin ??
|
||||
myWalletProvider.pinCode);
|
||||
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
|
@ -334,7 +333,7 @@ class WalletViewScreen extends StatelessWidget {
|
|||
splashColor: yellowC,
|
||||
onTap: sub.nodeConnected
|
||||
? () {
|
||||
paymentPopup(context, address!);
|
||||
paymentPopup(context, address);
|
||||
}
|
||||
: null,
|
||||
child: const Padding(
|
||||
|
|
39
pubspec.lock
39
pubspec.lock
|
@ -7,14 +7,28 @@ packages:
|
|||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "47.0.0"
|
||||
version: "46.0.0"
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.7.0"
|
||||
version: "4.6.0"
|
||||
analyzer_plugin:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer_plugin
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.10.0"
|
||||
ansicolor:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ansicolor
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -253,6 +267,20 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
csslib:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: csslib
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.17.2"
|
||||
dart_code_metrics:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: dart_code_metrics
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.17.1"
|
||||
dart_style:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -535,6 +563,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
html:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: html
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.15.0"
|
||||
http:
|
||||
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.11+30
|
||||
version: 0.0.11+31
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
@ -67,6 +67,7 @@ dev_dependencies:
|
|||
sdk: flutter
|
||||
integration_test:
|
||||
sdk: flutter
|
||||
dart_code_metrics: ^4.17.1
|
||||
|
||||
flutter_icons:
|
||||
android: true
|
||||
|
|
Loading…
Reference in New Issue