fixes for updated dart version, localization file updates

This commit is contained in:
Matthew Fosse 2024-04-16 11:34:53 -07:00
parent 223f1675db
commit d817911187
5 changed files with 72 additions and 44 deletions

View file

@ -8,7 +8,7 @@ class BiometricAuth {
try { try {
final authenticated = await _flutterLocalAuthenticationPlugin.authenticate(); final authenticated = await _flutterLocalAuthenticationPlugin.authenticate();
return authenticated; return authenticated;
} on PlatformException catch (e) { } catch (e) {
print(e); print(e);
} }
return false; return false;
@ -18,11 +18,7 @@ class BiometricAuth {
bool canAuthenticate; bool canAuthenticate;
try { try {
canAuthenticate = await _flutterLocalAuthenticationPlugin.canAuthenticate(); canAuthenticate = await _flutterLocalAuthenticationPlugin.canAuthenticate();
} catch (error) {
// 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) {
print("Exception checking support. $error"); print("Exception checking support. $error");
canAuthenticate = false; canAuthenticate = false;
} }

View 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});
}

View file

@ -754,47 +754,47 @@ class HaMaterialLocalizations extends GlobalMaterialLocalizations {
@override @override
// TODO: implement collapsedHint // TODO: implement collapsedHint
String get collapsedHint => throw UnimplementedError(); String get collapsedHint => "collapsedHint";
@override @override
// TODO: implement expandedHint // TODO: implement expandedHint
String get expandedHint => throw UnimplementedError(); String get expandedHint => "expandedHint";
@override @override
// TODO: implement expansionTileCollapsedHint // TODO: implement expansionTileCollapsedHint
String get expansionTileCollapsedHint => throw UnimplementedError(); String get expansionTileCollapsedHint => "expansionTileCollapsedHint";
@override @override
// TODO: implement expansionTileCollapsedTapHint // TODO: implement expansionTileCollapsedTapHint
String get expansionTileCollapsedTapHint => throw UnimplementedError(); String get expansionTileCollapsedTapHint => "expansionTileCollapsedTapHint";
@override @override
// TODO: implement expansionTileExpandedHint // TODO: implement expansionTileExpandedHint
String get expansionTileExpandedHint => throw UnimplementedError(); String get expansionTileExpandedHint => "expansionTileExpandedHint";
@override @override
// TODO: implement expansionTileExpandedTapHint // TODO: implement expansionTileExpandedTapHint
String get expansionTileExpandedTapHint => throw UnimplementedError(); String get expansionTileExpandedTapHint => "expansionTileExpandedTapHint";
@override @override
// TODO: implement scanTextButtonLabel // TODO: implement scanTextButtonLabel
String get scanTextButtonLabel => throw UnimplementedError(); String get scanTextButtonLabel => "scanTextButtonLabel";
@override @override
// TODO: implement lookUpButtonLabel // TODO: implement lookUpButtonLabel
String get lookUpButtonLabel => throw UnimplementedError(); String get lookUpButtonLabel => "lookUpButtonLabel";
@override @override
// TODO: implement menuDismissLabel // TODO: implement menuDismissLabel
String get menuDismissLabel => throw UnimplementedError(); String get menuDismissLabel => "menuDismissLabel";
@override @override
// TODO: implement searchWebButtonLabel // TODO: implement searchWebButtonLabel
String get searchWebButtonLabel => throw UnimplementedError(); String get searchWebButtonLabel => "searchWebButtonLabel";
@override @override
// TODO: implement shareButtonLabel // TODO: implement shareButtonLabel
String get shareButtonLabel => throw UnimplementedError(); String get shareButtonLabel => "shareButtonLabel";
} }
/// Cupertino Support /// Cupertino Support

View file

@ -1002,21 +1002,21 @@ String get todayLabel => 'Oyọ';
@override @override
// TODO: implement clearButtonLabel // TODO: implement clearButtonLabel
String get clearButtonLabel => throw UnimplementedError(); String get clearButtonLabel => "clearButtonLabel";
@override @override
// TODO: implement lookUpButtonLabel // TODO: implement lookUpButtonLabel
String get lookUpButtonLabel => throw UnimplementedError(); String get lookUpButtonLabel => "lookUpButtonLabel";
@override @override
// TODO: implement menuDismissLabel // TODO: implement menuDismissLabel
String get menuDismissLabel => throw UnimplementedError(); String get menuDismissLabel => "menuDismissLabel";
@override @override
// TODO: implement searchWebButtonLabel // TODO: implement searchWebButtonLabel
String get searchWebButtonLabel => throw UnimplementedError(); String get searchWebButtonLabel => "searchWebButtonLabel";
@override @override
// TODO: implement shareButtonLabel // TODO: implement shareButtonLabel
String get shareButtonLabel => throw UnimplementedError(); String get shareButtonLabel => "shareButtonLabel";
} }

View file

@ -1,29 +1,14 @@
import 'package:flutter/material.dart'; 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. extension Compare<T> on Comparable<T> {
/// bool operator <=(T other) => compareTo(other) <= 0;
/// It returns the result of `a.compareTo(b)`. bool operator >=(T other) => compareTo(other) >= 0;
/// The call may fail at run-time bool operator <(T other) => compareTo(other) < 0;
/// if `a` is not comparable to the type of `b`. bool operator >(T other) => compareTo(other) > 0;
///
/// 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);
} }
class Annotation implements Comparable<Annotation> {
class Annotation extends ComparableCopy<Annotation> {
Annotation({required this.range, required this.style}); Annotation({required this.range, required this.style});
final TextRange range; final TextRange range;
@ -33,7 +18,7 @@ class Annotation extends ComparableCopy<Annotation> {
int compareTo(Annotation other) => range.start.compareTo(other.range.start); 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}); TextAnnotation({required this.text, required this.style});
final TextStyle style; final TextStyle style;