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, textAlign: TextAlign.center,
style: isDesktop style: isDesktop
? STextStyles.desktopTextExtraSmall(context).copyWith( ? STextStyles.desktopTextExtraSmall(context).copyWith(
color: color: selectedWord == word
Theme.of(context).extension<StackColors>()!.textDark, ? 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) { for (final out in tx["vout"] as List) {
if (prevOut == out["n"]) { 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) { if (address != null) {
sendersArray.add(address); sendersArray.add(address);
} }
@ -2454,7 +2458,10 @@ class NamecoinWallet extends CoinServiceAPI {
Logging.instance.log("sendersArray: $sendersArray", level: LogLevel.Info); Logging.instance.log("sendersArray: $sendersArray", level: LogLevel.Info);
for (final output in txObject["vout"] as List) { 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) { if (address != null) {
recipientsArray.add(address); recipientsArray.add(address);
} }
@ -2519,7 +2526,10 @@ class NamecoinWallet extends CoinServiceAPI {
// add up received tx value // add up received tx value
for (final output in txObject["vout"] as List) { 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) { if (address != null) {
final value = (Decimal.parse(output["value"].toString()) * final value = (Decimal.parse(output["value"].toString()) *
Decimal.fromInt(Constants.satsPerCoin)) Decimal.fromInt(Constants.satsPerCoin))

View file

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

View file

@ -301,4 +301,6 @@ class DarkColors extends StackColorTheme {
Color get myStackContactIconBG => const Color(0x88747778); Color get myStackContactIconBG => const Color(0x88747778);
@override @override
Color get textConfirmTotalAmount => const Color(0xFF003921); 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; Color get myStackContactIconBG => textFieldDefaultBG;
@override @override
Color get textConfirmTotalAmount => const Color(0xFF232323); 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 loadingOverlayTextColor;
final Color myStackContactIconBG; final Color myStackContactIconBG;
final Color textConfirmTotalAmount; final Color textConfirmTotalAmount;
final Color textSelectedWordTableItem;
StackColors({ StackColors({
required this.themeType, required this.themeType,
@ -300,6 +301,7 @@ class StackColors extends ThemeExtension<StackColors> {
required this.loadingOverlayTextColor, required this.loadingOverlayTextColor,
required this.myStackContactIconBG, required this.myStackContactIconBG,
required this.textConfirmTotalAmount, required this.textConfirmTotalAmount,
required this.textSelectedWordTableItem,
}); });
factory StackColors.fromStackColorTheme(StackColorTheme colorTheme) { factory StackColors.fromStackColorTheme(StackColorTheme colorTheme) {
@ -435,6 +437,7 @@ class StackColors extends ThemeExtension<StackColors> {
loadingOverlayTextColor: colorTheme.loadingOverlayTextColor, loadingOverlayTextColor: colorTheme.loadingOverlayTextColor,
myStackContactIconBG: colorTheme.myStackContactIconBG, myStackContactIconBG: colorTheme.myStackContactIconBG,
textConfirmTotalAmount: colorTheme.textConfirmTotalAmount, textConfirmTotalAmount: colorTheme.textConfirmTotalAmount,
textSelectedWordTableItem: colorTheme.textSelectedWordTableItem,
); );
} }
@ -569,6 +572,7 @@ class StackColors extends ThemeExtension<StackColors> {
Color? loadingOverlayTextColor, Color? loadingOverlayTextColor,
Color? myStackContactIconBG, Color? myStackContactIconBG,
Color? textConfirmTotalAmount, Color? textConfirmTotalAmount,
Color? textSelectedWordTableItem,
}) { }) {
return StackColors( return StackColors(
themeType: themeType ?? this.themeType, themeType: themeType ?? this.themeType,
@ -736,6 +740,8 @@ class StackColors extends ThemeExtension<StackColors> {
myStackContactIconBG: myStackContactIconBG ?? this.myStackContactIconBG, myStackContactIconBG: myStackContactIconBG ?? this.myStackContactIconBG,
textConfirmTotalAmount: textConfirmTotalAmount:
textConfirmTotalAmount ?? this.textConfirmTotalAmount, textConfirmTotalAmount ?? this.textConfirmTotalAmount,
textSelectedWordTableItem:
textSelectedWordTableItem ?? this.textSelectedWordTableItem,
); );
} }
@ -1388,6 +1394,11 @@ class StackColors extends ThemeExtension<StackColors> {
other.textConfirmTotalAmount, other.textConfirmTotalAmount,
t, t,
)!, )!,
textSelectedWordTableItem: Color.lerp(
textSelectedWordTableItem,
other.textSelectedWordTableItem,
t,
)!,
); );
} }