mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
fixes for updated dart version, localization file updates
This commit is contained in:
parent
223f1675db
commit
d817911187
5 changed files with 72 additions and 44 deletions
|
@ -8,7 +8,7 @@ class BiometricAuth {
|
|||
try {
|
||||
final authenticated = await _flutterLocalAuthenticationPlugin.authenticate();
|
||||
return authenticated;
|
||||
} on PlatformException catch (e) {
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
return false;
|
||||
|
@ -18,11 +18,7 @@ class BiometricAuth {
|
|||
bool canAuthenticate;
|
||||
try {
|
||||
canAuthenticate = await _flutterLocalAuthenticationPlugin.canAuthenticate();
|
||||
|
||||
// Setup TouchID Allowable Reuse duration
|
||||
// It works only in iOS and macOS, but it's safe to call it even on other platforms.
|
||||
await _flutterLocalAuthenticationPlugin.setTouchIDAuthenticationAllowableReuseDuration(30);
|
||||
} on Exception catch (error) {
|
||||
} catch (error) {
|
||||
print("Exception checking support. $error");
|
||||
canAuthenticate = false;
|
||||
}
|
||||
|
|
47
lib/lightning/lightning.dart
Normal file
47
lib/lightning/lightning.dart
Normal file
|
@ -0,0 +1,47 @@
|
|||
import 'package:cake_wallet/bitcoin/bitcoin.dart';
|
||||
import 'package:cw_core/unspent_transaction_output.dart';
|
||||
import 'package:cw_core/wallet_credentials.dart';
|
||||
import 'package:cw_core/wallet_info.dart';
|
||||
import 'package:cw_core/transaction_priority.dart';
|
||||
import 'package:cw_core/output_info.dart';
|
||||
import 'package:cw_core/unspent_coins_info.dart';
|
||||
import 'package:cw_core/wallet_service.dart';
|
||||
import 'package:cw_core/receive_page_option.dart';
|
||||
import 'package:cw_core/crypto_amount_format.dart';
|
||||
import 'package:cake_wallet/view_model/send/output.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import 'package:cw_bitcoin/electrum_wallet.dart';
|
||||
import 'package:cw_bitcoin/bitcoin_unspent.dart';
|
||||
import 'package:cw_bitcoin/bitcoin_mnemonic.dart';
|
||||
import 'package:cw_bitcoin/bitcoin_transaction_priority.dart';
|
||||
import 'package:cw_bitcoin/bitcoin_wallet_creation_credentials.dart';
|
||||
import 'package:cw_bitcoin/bitcoin_amount_format.dart';
|
||||
import 'package:cw_bitcoin/bitcoin_address_record.dart';
|
||||
import 'package:cw_bitcoin/bitcoin_transaction_credentials.dart';
|
||||
import 'package:cw_lightning/lightning_wallet_service.dart';
|
||||
import 'package:cw_lightning/lightning_receive_page_option.dart';
|
||||
|
||||
part 'cw_lightning.dart';
|
||||
|
||||
Lightning? lightning = CWLightning();
|
||||
|
||||
abstract class Lightning {
|
||||
String formatterLightningAmountToString({required int amount});
|
||||
double formatterLightningAmountToDouble({required int amount});
|
||||
int formatterStringDoubleToLightningAmount(String amount);
|
||||
WalletService createLightningWalletService(
|
||||
Box<WalletInfo> walletInfoSource, Box<UnspentCoinsInfo> unspentCoinSource);
|
||||
List<ReceivePageOption> getLightningReceivePageOptions();
|
||||
String satsToLightningString(int sats);
|
||||
ReceivePageOption getOptionInvoice();
|
||||
ReceivePageOption getOptionOnchain();
|
||||
String bitcoinAmountToLightningString({required int amount});
|
||||
int bitcoinAmountToLightningAmount({required int amount});
|
||||
double bitcoinDoubleToLightningDouble({required double amount});
|
||||
double lightningDoubleToBitcoinDouble({required double amount});
|
||||
}
|
||||
|
|
@ -754,47 +754,47 @@ class HaMaterialLocalizations extends GlobalMaterialLocalizations {
|
|||
|
||||
@override
|
||||
// TODO: implement collapsedHint
|
||||
String get collapsedHint => throw UnimplementedError();
|
||||
String get collapsedHint => "collapsedHint";
|
||||
|
||||
@override
|
||||
// TODO: implement expandedHint
|
||||
String get expandedHint => throw UnimplementedError();
|
||||
String get expandedHint => "expandedHint";
|
||||
|
||||
@override
|
||||
// TODO: implement expansionTileCollapsedHint
|
||||
String get expansionTileCollapsedHint => throw UnimplementedError();
|
||||
String get expansionTileCollapsedHint => "expansionTileCollapsedHint";
|
||||
|
||||
@override
|
||||
// TODO: implement expansionTileCollapsedTapHint
|
||||
String get expansionTileCollapsedTapHint => throw UnimplementedError();
|
||||
String get expansionTileCollapsedTapHint => "expansionTileCollapsedTapHint";
|
||||
|
||||
@override
|
||||
// TODO: implement expansionTileExpandedHint
|
||||
String get expansionTileExpandedHint => throw UnimplementedError();
|
||||
String get expansionTileExpandedHint => "expansionTileExpandedHint";
|
||||
|
||||
@override
|
||||
// TODO: implement expansionTileExpandedTapHint
|
||||
String get expansionTileExpandedTapHint => throw UnimplementedError();
|
||||
String get expansionTileExpandedTapHint => "expansionTileExpandedTapHint";
|
||||
|
||||
@override
|
||||
// TODO: implement scanTextButtonLabel
|
||||
String get scanTextButtonLabel => throw UnimplementedError();
|
||||
String get scanTextButtonLabel => "scanTextButtonLabel";
|
||||
|
||||
@override
|
||||
// TODO: implement lookUpButtonLabel
|
||||
String get lookUpButtonLabel => throw UnimplementedError();
|
||||
String get lookUpButtonLabel => "lookUpButtonLabel";
|
||||
|
||||
@override
|
||||
// TODO: implement menuDismissLabel
|
||||
String get menuDismissLabel => throw UnimplementedError();
|
||||
String get menuDismissLabel => "menuDismissLabel";
|
||||
|
||||
@override
|
||||
// TODO: implement searchWebButtonLabel
|
||||
String get searchWebButtonLabel => throw UnimplementedError();
|
||||
String get searchWebButtonLabel => "searchWebButtonLabel";
|
||||
|
||||
@override
|
||||
// TODO: implement shareButtonLabel
|
||||
String get shareButtonLabel => throw UnimplementedError();
|
||||
String get shareButtonLabel => "shareButtonLabel";
|
||||
}
|
||||
|
||||
/// Cupertino Support
|
||||
|
|
|
@ -1002,21 +1002,21 @@ String get todayLabel => 'Oyọ';
|
|||
|
||||
@override
|
||||
// TODO: implement clearButtonLabel
|
||||
String get clearButtonLabel => throw UnimplementedError();
|
||||
String get clearButtonLabel => "clearButtonLabel";
|
||||
|
||||
@override
|
||||
// TODO: implement lookUpButtonLabel
|
||||
String get lookUpButtonLabel => throw UnimplementedError();
|
||||
String get lookUpButtonLabel => "lookUpButtonLabel";
|
||||
|
||||
@override
|
||||
// TODO: implement menuDismissLabel
|
||||
String get menuDismissLabel => throw UnimplementedError();
|
||||
String get menuDismissLabel => "menuDismissLabel";
|
||||
|
||||
@override
|
||||
// TODO: implement searchWebButtonLabel
|
||||
String get searchWebButtonLabel => throw UnimplementedError();
|
||||
String get searchWebButtonLabel => "searchWebButtonLabel";
|
||||
|
||||
@override
|
||||
// TODO: implement shareButtonLabel
|
||||
String get shareButtonLabel => throw UnimplementedError();
|
||||
String get shareButtonLabel => "shareButtonLabel";
|
||||
}
|
||||
|
|
|
@ -1,29 +1,14 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
abstract class ComparableCopy<T> {
|
||||
/// Compares this object to another object.
|
||||
///
|
||||
/// Returns a value like a [Comparator] when comparing `this` to [other].
|
||||
/// That is, it returns a negative integer if `this` is ordered before [other],
|
||||
/// a positive integer if `this` is ordered after [other],
|
||||
/// and zero if `this` and [other] are ordered together.
|
||||
///
|
||||
/// The [other] argument must be a value that is comparable to this object.
|
||||
int compareTo(T other);
|
||||
|
||||
/// A [Comparator] that compares one comparable to another.
|
||||
///
|
||||
/// It returns the result of `a.compareTo(b)`.
|
||||
/// The call may fail at run-time
|
||||
/// if `a` is not comparable to the type of `b`.
|
||||
///
|
||||
/// This utility function is used as the default comparator
|
||||
/// for ordering collections, for example in the [List] sort function.
|
||||
static int compare(ComparableCopy a, ComparableCopy b) => a.compareTo(b);
|
||||
extension Compare<T> on Comparable<T> {
|
||||
bool operator <=(T other) => compareTo(other) <= 0;
|
||||
bool operator >=(T other) => compareTo(other) >= 0;
|
||||
bool operator <(T other) => compareTo(other) < 0;
|
||||
bool operator >(T other) => compareTo(other) > 0;
|
||||
}
|
||||
|
||||
|
||||
class Annotation extends ComparableCopy<Annotation> {
|
||||
class Annotation implements Comparable<Annotation> {
|
||||
Annotation({required this.range, required this.style});
|
||||
|
||||
final TextRange range;
|
||||
|
@ -33,7 +18,7 @@ class Annotation extends ComparableCopy<Annotation> {
|
|||
int compareTo(Annotation other) => range.start.compareTo(other.range.start);
|
||||
}
|
||||
|
||||
class TextAnnotation extends ComparableCopy<TextAnnotation> {
|
||||
class TextAnnotation implements Comparable<TextAnnotation> {
|
||||
TextAnnotation({required this.text, required this.style});
|
||||
|
||||
final TextStyle style;
|
||||
|
|
Loading…
Reference in a new issue