Merge branch 'main' of github.com:cake-tech/cake_wallet into release-4.2.4

This commit is contained in:
M 2021-07-22 13:33:52 +03:00
commit 051057ca44
11 changed files with 34 additions and 18 deletions

BIN
assets/images/moonpay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -2,23 +2,20 @@ import 'package:flutter/material.dart';
import 'package:cake_wallet/buy/buy_provider_description.dart';
Image getBuyProviderIcon(BuyProviderDescription providerDescription,
{bool isWhiteIconColor = false}) {
{Color iconColor = Colors.black}) {
final _wyreIcon =
Image.asset('assets/images/wyre-icon.png', width: 36, height: 36);
final _moonPayWhiteIcon =
Image.asset('assets/images/moonpay-icon.png', color: Colors.white,
final _moonPayIcon =
Image.asset('assets/images/moonpay-icon.png', color: iconColor,
width: 36, height: 34);
final _moonPayBlackIcon =
Image.asset('assets/images/moonpay-icon.png', color: Colors.black,
width: 36, height: 34);
if (providerDescription != null) {
switch (providerDescription) {
case BuyProviderDescription.wyre:
return _wyreIcon;
case BuyProviderDescription.moonPay:
return isWhiteIconColor ? _moonPayWhiteIcon : _moonPayBlackIcon;
return _moonPayIcon;
default:
return null;
}

View file

@ -27,9 +27,10 @@ class BuyListItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
final isSelected = selectedProvider?.description == provider.description;
final iconColor = isSelected ? Colors.white : Colors.black;
final providerIcon = getBuyProviderIcon(provider.description,
isWhiteIconColor: isSelected);
iconColor: iconColor);
final backgroundColor = isSelected
? Palette.greyBlueCraiola

View file

@ -1,9 +1,6 @@
import 'package:cake_wallet/buy/buy_provider_description.dart';
import 'package:cake_wallet/buy/get_buy_provider_icon.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/store/settings_store.dart';
class OrderRow extends StatelessWidget {
OrderRow({
@ -22,11 +19,10 @@ class OrderRow extends StatelessWidget {
@override
Widget build(BuildContext context) {
final currentTheme = getIt.get<SettingsStore>().currentTheme;
final isWhiteIconColor = currentTheme.type != ThemeType.light;
final iconColor =
Theme.of(context).primaryTextTheme.display4.backgroundColor;
final providerIcon = getBuyProviderIcon(provider,
isWhiteIconColor: isWhiteIconColor);
final providerIcon = getBuyProviderIcon(provider, iconColor: iconColor);
return InkWell(
onTap: onTap,

View file

@ -7,6 +7,7 @@ class SettingsLinkProviderCell extends StandardListRow {
SettingsLinkProviderCell(
{@required String title,
@required this.icon,
this.iconColor,
@required this.link,
@required this.linkTitle})
: super(title: title, isSelected: false, onTap: (BuildContext context) => _launchUrl(link) );
@ -14,10 +15,11 @@ class SettingsLinkProviderCell extends StandardListRow {
final String icon;
final String link;
final String linkTitle;
final Color iconColor;
@override
Widget buildLeading(BuildContext context) =>
icon != null ? Image.asset(icon) : null;
icon != null ? Image.asset(icon, color: iconColor) : null;
@override
Widget buildTrailing(BuildContext context) => Text(linkTitle,

View file

@ -19,6 +19,9 @@ class SupportPage extends BasePage {
@override
Widget body(BuildContext context) {
final iconColor =
Theme.of(context).accentTextTheme.display4.backgroundColor;
return SectionStandardList(
sectionCount: 1,
itemCounter: (int _) => supportViewModel.items.length,
@ -34,6 +37,7 @@ class SupportPage extends BasePage {
return SettingsLinkProviderCell(
title: item.title,
icon: item.icon,
iconColor: item.hasIconColor ? iconColor : null,
link: item.link,
linkTitle: item.linkTitle);
}

View file

@ -113,6 +113,7 @@ class BrightTheme extends ThemeBase {
),
display4: TextStyle(
color: Palette.darkBlueCraiola, // template title (send page)
backgroundColor: Colors.white, // icon color on order row (moonpay)
decorationColor: Palette.niagara // receive amount text (exchange page)
),
subtitle: TextStyle(
@ -179,6 +180,7 @@ class BrightTheme extends ThemeBase {
),
display4: TextStyle(
color: Palette.darkGray, // switch background (settings page)
backgroundColor: Colors.black, // icon color on support page (moonpay, github)
decorationColor: Colors.white.withOpacity(0.4) // hint text (exchange page)
),
body1: TextStyle(

View file

@ -112,6 +112,7 @@ class DarkTheme extends ThemeBase {
),
display4: TextStyle(
color: PaletteDark.cyanBlue, // template title (send page)
backgroundColor: Colors.white, // icon color on order row (moonpay)
decorationColor: PaletteDark.darkCyanBlue // receive amount text (exchange page)
),
subtitle: TextStyle(
@ -178,6 +179,7 @@ class DarkTheme extends ThemeBase {
),
display4: TextStyle(
color: PaletteDark.deepVioletBlue, // switch background (settings page)
backgroundColor: Colors.white, // icon color on support page (moonpay, github)
decorationColor: PaletteDark.lightBlueGrey // hint text (exchange page)
),
body1: TextStyle(

View file

@ -113,6 +113,7 @@ class LightTheme extends ThemeBase {
),
display4: TextStyle(
color: Palette.darkBlueCraiola, // template title (send page)
backgroundColor: Colors.black, // icon color on order row (moonpay)
decorationColor: Palette.niagara // receive amount text (exchange page)
),
subtitle: TextStyle(
@ -178,6 +179,7 @@ class LightTheme extends ThemeBase {
),
display4: TextStyle(
color: Palette.darkGray, // switch background (settings page)
backgroundColor: Colors.black, // icon color on support page (moonpay, github)
decorationColor: Colors.white.withOpacity(0.4) // hint text (exchange page)
),
body1: TextStyle(

View file

@ -1,15 +1,18 @@
import 'package:flutter/foundation.dart';
import 'package:cake_wallet/view_model/settings/settings_list_item.dart';
import 'package:flutter/material.dart';
class LinkListItem extends SettingsListItem {
LinkListItem(
{@required String title,
@required this.link,
@required this.linkTitle,
this.icon})
this.icon,
this.hasIconColor = false})
: super(title);
final String icon;
final String link;
final String linkTitle;
final bool hasIconColor;
}

View file

@ -31,6 +31,7 @@ abstract class SupportViewModelBase with Store {
LinkListItem(
title: 'GitHub',
icon: 'assets/images/github.png',
hasIconColor: true,
linkTitle: S.current.apk_update,
link: 'https://github.com/cake-tech/cake_wallet/releases'),
LinkListItem(
@ -52,7 +53,13 @@ abstract class SupportViewModelBase with Store {
title: 'Wyre',
icon: 'assets/images/wyre.png',
linkTitle: S.current.submit_request,
link: 'https://wyre-support.zendesk.com/hc/en-us/requests/new')
link: 'https://wyre-support.zendesk.com/hc/en-us/requests/new'),
LinkListItem(
title: 'MoonPay',
icon: 'assets/images/moonpay.png',
hasIconColor: true,
linkTitle: S.current.submit_request,
link: 'https://support.moonpay.com/hc/en-gb/requests/new')
];
}
static const url = 'https://cakewallet.com/guide/';