mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-18 18:21:08 +00:00
Merge remote-tracking branch 'cypherstack/windows' into windows
This commit is contained in:
commit
2d95161275
8 changed files with 14 additions and 13 deletions
|
@ -1297,7 +1297,7 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
final priceData =
|
final priceData =
|
||||||
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
|
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
|
||||||
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
|
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
|
||||||
final locale = await Devicelocale.currentLocale;
|
final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
|
||||||
final String worthNow = Format.localizedStringAsFixed(
|
final String worthNow = Format.localizedStringAsFixed(
|
||||||
value:
|
value:
|
||||||
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
||||||
|
|
|
@ -1174,7 +1174,7 @@ class BitcoinCashWallet extends CoinServiceAPI {
|
||||||
final priceData =
|
final priceData =
|
||||||
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
|
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
|
||||||
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
|
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
|
||||||
final locale = await Devicelocale.currentLocale;
|
final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
|
||||||
final String worthNow = Format.localizedStringAsFixed(
|
final String worthNow = Format.localizedStringAsFixed(
|
||||||
value:
|
value:
|
||||||
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
||||||
|
|
|
@ -1064,7 +1064,7 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
final priceData =
|
final priceData =
|
||||||
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
|
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
|
||||||
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
|
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
|
||||||
final locale = await Devicelocale.currentLocale;
|
final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
|
||||||
final String worthNow = Format.localizedStringAsFixed(
|
final String worthNow = Format.localizedStringAsFixed(
|
||||||
value:
|
value:
|
||||||
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
||||||
|
|
|
@ -883,7 +883,7 @@ class FiroWallet extends CoinServiceAPI {
|
||||||
@override
|
@override
|
||||||
Future<void> updateSentCachedTxData(Map<String, dynamic> txData) async {
|
Future<void> updateSentCachedTxData(Map<String, dynamic> txData) async {
|
||||||
final currentPrice = await firoPrice;
|
final currentPrice = await firoPrice;
|
||||||
final locale = await Devicelocale.currentLocale;
|
final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
|
||||||
final String worthNow = Format.localizedStringAsFixed(
|
final String worthNow = Format.localizedStringAsFixed(
|
||||||
value:
|
value:
|
||||||
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
||||||
|
@ -2756,7 +2756,7 @@ class FiroWallet extends CoinServiceAPI {
|
||||||
var price = await firoPrice;
|
var price = await firoPrice;
|
||||||
var builtHex = txb.build();
|
var builtHex = txb.build();
|
||||||
// return builtHex;
|
// return builtHex;
|
||||||
final locale = await Devicelocale.currentLocale;
|
final locale =Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
|
||||||
return {
|
return {
|
||||||
"transaction": builtHex,
|
"transaction": builtHex,
|
||||||
"txid": txId,
|
"txid": txId,
|
||||||
|
@ -2810,7 +2810,7 @@ class FiroWallet extends CoinServiceAPI {
|
||||||
final currentPrice = await firoPrice;
|
final currentPrice = await firoPrice;
|
||||||
// Grab the most recent information on all the joinsplits
|
// Grab the most recent information on all the joinsplits
|
||||||
|
|
||||||
final locale = await Devicelocale.currentLocale;
|
final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
|
||||||
final updatedJSplit = await getJMintTransactions(cachedElectrumXClient,
|
final updatedJSplit = await getJMintTransactions(cachedElectrumXClient,
|
||||||
joinsplits, _prefs.currency, coin, currentPrice, locale!);
|
joinsplits, _prefs.currency, coin, currentPrice, locale!);
|
||||||
|
|
||||||
|
@ -3249,7 +3249,7 @@ class FiroWallet extends CoinServiceAPI {
|
||||||
final currentPrice = await firoPrice;
|
final currentPrice = await firoPrice;
|
||||||
final List<Map<String, dynamic>> midSortedArray = [];
|
final List<Map<String, dynamic>> midSortedArray = [];
|
||||||
|
|
||||||
final locale = await Devicelocale.currentLocale;
|
final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
|
||||||
|
|
||||||
Logging.instance.log("refresh the txs", level: LogLevel.Info);
|
Logging.instance.log("refresh the txs", level: LogLevel.Info);
|
||||||
for (final txObject in allTransactions) {
|
for (final txObject in allTransactions) {
|
||||||
|
@ -4324,7 +4324,7 @@ class FiroWallet extends CoinServiceAPI {
|
||||||
currency,
|
currency,
|
||||||
coin,
|
coin,
|
||||||
currentPrice,
|
currentPrice,
|
||||||
(await Devicelocale.currentLocale)!);
|
(Platform.isWindows ? "en_US" : await Devicelocale.currentLocale)!);
|
||||||
Logging.instance.log(spendTxs, level: LogLevel.Info);
|
Logging.instance.log(spendTxs, level: LogLevel.Info);
|
||||||
for (var element in spendTxs) {
|
for (var element in spendTxs) {
|
||||||
transactionMap[element.txid] = element;
|
transactionMap[element.txid] = element;
|
||||||
|
@ -4375,7 +4375,7 @@ class FiroWallet extends CoinServiceAPI {
|
||||||
final lelantusEntry = await _getLelantusEntry();
|
final lelantusEntry = await _getLelantusEntry();
|
||||||
final anonymitySets = await fetchAnonymitySets();
|
final anonymitySets = await fetchAnonymitySets();
|
||||||
final locktime = await getBlockHead(electrumXClient);
|
final locktime = await getBlockHead(electrumXClient);
|
||||||
final locale = await Devicelocale.currentLocale;
|
final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
|
||||||
|
|
||||||
ReceivePort receivePort = await getIsolate({
|
ReceivePort receivePort = await getIsolate({
|
||||||
"function": "createJoinSplit",
|
"function": "createJoinSplit",
|
||||||
|
|
|
@ -1299,7 +1299,7 @@ class LitecoinWallet extends CoinServiceAPI {
|
||||||
final priceData =
|
final priceData =
|
||||||
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
|
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
|
||||||
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
|
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
|
||||||
final locale = await Devicelocale.currentLocale;
|
final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
|
||||||
final String worthNow = Format.localizedStringAsFixed(
|
final String worthNow = Format.localizedStringAsFixed(
|
||||||
value:
|
value:
|
||||||
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
||||||
|
|
|
@ -1287,7 +1287,7 @@ class NamecoinWallet extends CoinServiceAPI {
|
||||||
final priceData =
|
final priceData =
|
||||||
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
|
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
|
||||||
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
|
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
|
||||||
final locale = await Devicelocale.currentLocale;
|
final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
|
||||||
final String worthNow = Format.localizedStringAsFixed(
|
final String worthNow = Format.localizedStringAsFixed(
|
||||||
value:
|
value:
|
||||||
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
||||||
|
|
|
@ -1200,7 +1200,7 @@ class ParticlWallet extends CoinServiceAPI {
|
||||||
final priceData =
|
final priceData =
|
||||||
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
|
await _priceAPI.getPricesAnd24hChange(baseCurrency: _prefs.currency);
|
||||||
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
|
Decimal currentPrice = priceData[coin]?.item1 ?? Decimal.zero;
|
||||||
final locale = await Devicelocale.currentLocale;
|
final locale = Platform.isWindows ? "en_US" : await Devicelocale.currentLocale;
|
||||||
final String worthNow = Format.localizedStringAsFixed(
|
final String worthNow = Format.localizedStringAsFixed(
|
||||||
value:
|
value:
|
||||||
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
((currentPrice * Decimal.fromInt(txData["recipientAmt"] as int)) /
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'dart:io';
|
||||||
import 'package:devicelocale/devicelocale.dart';
|
import 'package:devicelocale/devicelocale.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
@ -7,7 +8,7 @@ class LocaleService extends ChangeNotifier {
|
||||||
String get locale => _locale;
|
String get locale => _locale;
|
||||||
|
|
||||||
Future<void> loadLocale({bool notify = true}) async {
|
Future<void> loadLocale({bool notify = true}) async {
|
||||||
_locale = await Devicelocale.currentLocale ?? "en_US";
|
_locale =Platform.isWindows ? "en_US" : await Devicelocale.currentLocale ?? "en_US";
|
||||||
if (notify) {
|
if (notify) {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue