2021-01-26 21:00:26 +01:00
|
|
|
import 'dart:io';
|
2022-12-09 06:23:47 +01:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
2021-11-08 23:12:25 +01:00
|
|
|
import 'package:flutter/material.dart';
|
2021-11-14 19:21:20 +01:00
|
|
|
import 'package:gecko/models/chest_data.dart';
|
2021-11-26 08:56:20 +01:00
|
|
|
import 'package:gecko/models/g1_wallets_list.dart';
|
2021-11-14 19:21:20 +01:00
|
|
|
import 'package:gecko/models/wallet_data.dart';
|
2022-09-05 08:35:24 +02:00
|
|
|
import 'package:hive_flutter/hive_flutter.dart';
|
2021-04-02 11:45:59 +02:00
|
|
|
import 'package:logger/logger.dart';
|
2021-01-26 21:00:26 +01:00
|
|
|
|
2022-05-24 16:51:40 +02:00
|
|
|
// Version of box data
|
2022-12-07 23:10:28 +01:00
|
|
|
const int dataVersion = 6;
|
2022-05-24 16:51:40 +02:00
|
|
|
|
2021-12-23 15:13:58 +01:00
|
|
|
late String appVersion;
|
|
|
|
const int pinLength = 5;
|
2022-05-04 19:00:09 +02:00
|
|
|
const String appLang = 'english';
|
2021-12-23 15:13:58 +01:00
|
|
|
|
2021-12-23 12:36:09 +01:00
|
|
|
late Box<WalletData> walletBox;
|
|
|
|
late Box<ChestData> chestBox;
|
|
|
|
late Box configBox;
|
|
|
|
late Box<G1WalletsList> g1WalletsBox;
|
2022-08-14 20:02:02 +02:00
|
|
|
late Box<G1WalletsList> contactsBox;
|
2022-02-19 23:51:12 +01:00
|
|
|
// late Box keystoreBox;
|
2022-05-28 19:13:30 +02:00
|
|
|
late Directory imageDirectory;
|
2021-03-08 00:32:18 +01:00
|
|
|
|
2022-05-19 07:00:25 +02:00
|
|
|
// String cesiumPod = "https://g1.data.le-sou.org";
|
|
|
|
String cesiumPod = "https://g1.data.presles.fr";
|
2021-11-26 08:56:20 +01:00
|
|
|
// String cesiumPod = "https://g1.data.e-is.pro";
|
2021-03-28 21:37:12 +02:00
|
|
|
|
2021-03-08 00:32:18 +01:00
|
|
|
// Responsive ratios
|
2021-12-23 12:36:09 +01:00
|
|
|
late bool isTall;
|
|
|
|
late double ratio;
|
2021-04-02 11:45:59 +02:00
|
|
|
|
2022-05-30 14:48:12 +02:00
|
|
|
// Contexts
|
|
|
|
late BuildContext homeContext;
|
|
|
|
|
2021-04-02 11:45:59 +02:00
|
|
|
// Logger
|
2022-09-12 12:38:32 +02:00
|
|
|
final log = Logger();
|
2021-11-08 23:12:25 +01:00
|
|
|
|
|
|
|
// Colors
|
2022-09-12 12:38:32 +02:00
|
|
|
const Color orangeC = Color(0xffd07316);
|
|
|
|
const Color yellowC = Color(0xffFFD68E);
|
|
|
|
const Color floattingYellow = Color(0xffEFEFBF);
|
|
|
|
const Color backgroundColor = Color(0xFFF5F5F5);
|
2022-05-04 19:00:09 +02:00
|
|
|
|
|
|
|
// Substrate settings
|
2022-09-12 12:38:32 +02:00
|
|
|
const String currencyName = 'ĞD';
|
2022-05-20 15:15:29 +02:00
|
|
|
|
|
|
|
// Debug
|
|
|
|
const debugPin = true;
|
2022-06-14 21:55:33 +02:00
|
|
|
|
|
|
|
String indexerEndpoint = '';
|
2022-09-12 12:04:08 +02:00
|
|
|
late double balanceRatio;
|
|
|
|
late int udValue;
|
2022-12-03 08:44:44 +01:00
|
|
|
|
|
|
|
// Indexer
|
|
|
|
late DateTime startBlockchainTime;
|
2023-02-02 15:45:01 +01:00
|
|
|
bool startBlockchainInitialized = false;
|
2022-12-08 01:18:09 +01:00
|
|
|
|
|
|
|
late int currentUdIndex;
|
2022-12-09 06:23:47 +01:00
|
|
|
|
2022-12-10 06:09:05 +01:00
|
|
|
final Map<int, String> monthsInYear = {
|
|
|
|
1: "month1".tr(),
|
|
|
|
2: "month2".tr(),
|
|
|
|
3: "month3".tr(),
|
|
|
|
4: "month4".tr(),
|
|
|
|
5: "month5".tr(),
|
|
|
|
6: "month6".tr(),
|
|
|
|
7: "month7".tr(),
|
|
|
|
8: "month8".tr(),
|
|
|
|
9: "month9".tr(),
|
|
|
|
10: "month10".tr(),
|
|
|
|
11: "month11".tr(),
|
|
|
|
12: "month12".tr()
|
|
|
|
};
|