Merge pull request #91 from cypherstack/testing

Testing
This commit is contained in:
julian-CStack 2022-09-25 13:23:25 -06:00 committed by GitHub
commit 1c889fd054
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 6 deletions

View file

@ -56,10 +56,23 @@ class WordTableItem extends ConsumerWidget {
textAlign: TextAlign.center,
style: isDesktop
? STextStyles.desktopTextExtraSmall(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.textDark,
color: selectedWord == word
? Theme.of(context)
.extension<StackColors>()!
.textSelectedWordTableItem
: Theme.of(context)
.extension<StackColors>()!
.textDark,
)
: STextStyles.baseXS(context),
: STextStyles.baseXS(context).copyWith(
color: selectedWord == word
? Theme.of(context)
.extension<StackColors>()!
.textSelectedWordTableItem
: Theme.of(context)
.extension<StackColors>()!
.textDark,
),
),
],
),

View file

@ -2443,7 +2443,11 @@ class NamecoinWallet extends CoinServiceAPI {
for (final out in tx["vout"] as List) {
if (prevOut == out["n"]) {
final address = out["scriptPubKey"]["addresses"][0] as String?;
String? address = out["scriptPubKey"]["address"] as String?;
if (address == null && out["scriptPubKey"]["addresses"] != null) {
address = out["scriptPubKey"]["addresses"][0] as String?;
}
if (address != null) {
sendersArray.add(address);
}
@ -2454,7 +2458,10 @@ class NamecoinWallet extends CoinServiceAPI {
Logging.instance.log("sendersArray: $sendersArray", level: LogLevel.Info);
for (final output in txObject["vout"] as List) {
final address = output["scriptPubKey"]["addresses"][0] as String?;
String? address = output["scriptPubKey"]["address"] as String?;
if (address == null && output["scriptPubKey"]["addresses"] != null) {
address = output["scriptPubKey"]["addresses"][0] as String?;
}
if (address != null) {
recipientsArray.add(address);
}
@ -2519,7 +2526,10 @@ class NamecoinWallet extends CoinServiceAPI {
// add up received tx value
for (final output in txObject["vout"] as List) {
final address = output["scriptPubKey"]["addresses"][0];
String? address = output["scriptPubKey"]["address"] as String?;
if (address == null && output["scriptPubKey"]["addresses"] != null) {
address = output["scriptPubKey"]["addresses"][0] as String?;
}
if (address != null) {
final value = (Decimal.parse(output["value"].toString()) *
Decimal.fromInt(Constants.satsPerCoin))

View file

@ -174,6 +174,7 @@ abstract class StackColorTheme {
Color get loadingOverlayTextColor;
Color get myStackContactIconBG;
Color get textConfirmTotalAmount;
Color get textSelectedWordTableItem;
}
class CoinThemeColor {

View file

@ -301,4 +301,6 @@ class DarkColors extends StackColorTheme {
Color get myStackContactIconBG => const Color(0x88747778);
@override
Color get textConfirmTotalAmount => const Color(0xFF003921);
@override
Color get textSelectedWordTableItem => const Color(0xFF00297A);
}

View file

@ -301,4 +301,6 @@ class LightColors extends StackColorTheme {
Color get myStackContactIconBG => textFieldDefaultBG;
@override
Color get textConfirmTotalAmount => const Color(0xFF232323);
@override
Color get textSelectedWordTableItem => const Color(0xFF232323);
}

View file

@ -169,6 +169,7 @@ class StackColors extends ThemeExtension<StackColors> {
final Color loadingOverlayTextColor;
final Color myStackContactIconBG;
final Color textConfirmTotalAmount;
final Color textSelectedWordTableItem;
StackColors({
required this.themeType,
@ -300,6 +301,7 @@ class StackColors extends ThemeExtension<StackColors> {
required this.loadingOverlayTextColor,
required this.myStackContactIconBG,
required this.textConfirmTotalAmount,
required this.textSelectedWordTableItem,
});
factory StackColors.fromStackColorTheme(StackColorTheme colorTheme) {
@ -435,6 +437,7 @@ class StackColors extends ThemeExtension<StackColors> {
loadingOverlayTextColor: colorTheme.loadingOverlayTextColor,
myStackContactIconBG: colorTheme.myStackContactIconBG,
textConfirmTotalAmount: colorTheme.textConfirmTotalAmount,
textSelectedWordTableItem: colorTheme.textSelectedWordTableItem,
);
}
@ -569,6 +572,7 @@ class StackColors extends ThemeExtension<StackColors> {
Color? loadingOverlayTextColor,
Color? myStackContactIconBG,
Color? textConfirmTotalAmount,
Color? textSelectedWordTableItem,
}) {
return StackColors(
themeType: themeType ?? this.themeType,
@ -736,6 +740,8 @@ class StackColors extends ThemeExtension<StackColors> {
myStackContactIconBG: myStackContactIconBG ?? this.myStackContactIconBG,
textConfirmTotalAmount:
textConfirmTotalAmount ?? this.textConfirmTotalAmount,
textSelectedWordTableItem:
textSelectedWordTableItem ?? this.textSelectedWordTableItem,
);
}
@ -1388,6 +1394,11 @@ class StackColors extends ThemeExtension<StackColors> {
other.textConfirmTotalAmount,
t,
)!,
textSelectedWordTableItem: Color.lerp(
textSelectedWordTableItem,
other.textSelectedWordTableItem,
t,
)!,
);
}