codemetrics: apply check-unused-files and check-unused-code
This commit is contained in:
parent
d927ccea39
commit
0728bc6aba
|
@ -5,16 +5,11 @@ import 'package:gecko/models/g1_wallets_list.dart';
|
||||||
import 'package:gecko/models/wallet_data.dart';
|
import 'package:gecko/models/wallet_data.dart';
|
||||||
import 'package:hive_flutter/hive_flutter.dart';
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
import 'package:logger/logger.dart';
|
import 'package:logger/logger.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
|
||||||
|
|
||||||
// Version of box data
|
// Version of box data
|
||||||
const int dataVersion = 4;
|
const int dataVersion = 4;
|
||||||
|
|
||||||
// Files paths
|
|
||||||
Directory? appPath;
|
|
||||||
|
|
||||||
late String appVersion;
|
late String appVersion;
|
||||||
late SharedPreferences prefs;
|
|
||||||
const int pinLength = 5;
|
const int pinLength = 5;
|
||||||
const String appLang = 'english';
|
const String appLang = 'english';
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,6 @@ import 'package:hive_flutter/hive_flutter.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:responsive_framework/responsive_framework.dart';
|
import 'package:responsive_framework/responsive_framework.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
|
||||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||||
import 'package:graphql_flutter/graphql_flutter.dart';
|
import 'package:graphql_flutter/graphql_flutter.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
@ -61,7 +60,6 @@ Future<void> main() async {
|
||||||
await initHiveForFlutter();
|
await initHiveForFlutter();
|
||||||
await homeProvider.initHive();
|
await homeProvider.initHive();
|
||||||
appVersion = await homeProvider.getAppVersion();
|
appVersion = await homeProvider.getAppVersion();
|
||||||
prefs = await SharedPreferences.getInstance();
|
|
||||||
|
|
||||||
// Reset GraphQL cache
|
// Reset GraphQL cache
|
||||||
// final cache = HiveStore();
|
// final cache = HiveStore();
|
||||||
|
|
|
@ -18,40 +18,6 @@ query ($name: String!) {
|
||||||
''';
|
''';
|
||||||
|
|
||||||
const String getHistoryByAddressQ = r'''
|
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) {
|
query ($address: String!, $number: Int!, $cursor: String) {
|
||||||
transaction_connection(where:
|
transaction_connection(where:
|
||||||
{_or: [
|
{_or: [
|
||||||
|
|
|
@ -231,24 +231,3 @@ class HomeProvider with ChangeNotifier {
|
||||||
notifyListeners();
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -980,19 +980,6 @@ newKeySig: $newKeySig""");
|
||||||
/////// 6: UI ELEMENTS (off class) /////////
|
/////// 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) {
|
void snackNode(BuildContext context, bool isConnected) {
|
||||||
String message;
|
String message;
|
||||||
if (!isConnected) {
|
if (!isConnected) {
|
||||||
|
@ -1018,11 +1005,6 @@ String getShortPubkey(String pubkey) {
|
||||||
return pubkeyShort;
|
return pubkeyShort;
|
||||||
}
|
}
|
||||||
|
|
||||||
class PasswordException implements Exception {
|
|
||||||
String cause;
|
|
||||||
PasswordException(this.cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
Uint8List _int32bytes(int value) =>
|
Uint8List _int32bytes(int value) =>
|
||||||
Uint8List(4)..buffer.asInt32List()[0] = value;
|
Uint8List(4)..buffer.asInt32List()[0] = value;
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ class ActivityScreen extends StatelessWidget with ChangeNotifier {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Query(
|
Query(
|
||||||
options: QueryOptions(
|
options: QueryOptions(
|
||||||
document: gql(getHistoryByAddressQ3),
|
document: gql(getHistoryByAddressQ),
|
||||||
variables: <String, dynamic>{
|
variables: <String, dynamic>{
|
||||||
'address': address,
|
'address': address,
|
||||||
'number': 20,
|
'number': 20,
|
||||||
|
|
|
@ -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),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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),
|
|
||||||
]),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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) {
|
Widget nextButton(BuildContext context, String text, nextScreen, bool isFast) {
|
||||||
GenerateWalletsProvider generateWalletProvider =
|
GenerateWalletsProvider generateWalletProvider =
|
||||||
Provider.of<GenerateWalletsProvider>(context, listen: false);
|
Provider.of<GenerateWalletsProvider>(context, listen: false);
|
||||||
|
|
Loading…
Reference in New Issue