diff --git a/lib/models/buy/response_objects/crypto.dart b/lib/models/buy/response_objects/crypto.dart index 3248d864d..1d47b963f 100644 --- a/lib/models/buy/response_objects/crypto.dart +++ b/lib/models/buy/response_objects/crypto.dart @@ -11,15 +11,11 @@ class Crypto { /// Crypto contract address final String? contractAddress; - /// Crypto logo url - final String image; - Crypto({ required this.ticker, required this.name, required this.network, required this.contractAddress, - required this.image, }); factory Crypto.fromJson(Map json) { @@ -29,7 +25,6 @@ class Crypto { name: "${json['name']}", network: "${json['network']}", contractAddress: "${json['contractAddress']}", - image: "${json['image']}", ); } catch (e) { rethrow; @@ -42,7 +37,6 @@ class Crypto { "name": name, "network": network, "contractAddress": contractAddress, - "image": image, }; return map; @@ -51,14 +45,12 @@ class Crypto { Crypto copyWith({ String? ticker, String? name, - String? image, }) { return Crypto( ticker: ticker ?? this.ticker, name: name ?? this.name, network: network ?? this.network, contractAddress: contractAddress ?? this.contractAddress, - image: image ?? this.image, ); } diff --git a/lib/models/buy/response_objects/fiat.dart b/lib/models/buy/response_objects/fiat.dart index af565a19e..a8b0913ba 100644 --- a/lib/models/buy/response_objects/fiat.dart +++ b/lib/models/buy/response_objects/fiat.dart @@ -13,15 +13,11 @@ class Fiat { /// Fiat name final Decimal max_amount; - /// Fiat logo url - final String image; - Fiat( {required this.ticker, required this.name, required this.min_amount, - required this.max_amount, - required this.image}); + required this.max_amount}); factory Fiat.fromJson(Map json) { try { @@ -30,7 +26,6 @@ class Fiat { name: "${json['name']}", // TODO nameFromTicker min_amount: Decimal.parse("${json['min_amount'] ?? 0}"), max_amount: Decimal.parse("${json['max_amount'] ?? 0}"), - image: "${json['image']}", ); } catch (e) { rethrow; @@ -43,7 +38,6 @@ class Fiat { "name": name, "min_amount": min_amount, "max_amount": max_amount, - "image": image, }; return map; @@ -54,14 +48,12 @@ class Fiat { String? name, Decimal? min_amount, Decimal? max_amount, - String? image, }) { return Fiat( ticker: ticker ?? this.ticker, name: name ?? this.name, min_amount: min_amount ?? this.min_amount, max_amount: max_amount ?? this.max_amount, - image: image ?? this.image, ); } diff --git a/lib/pages/buy_view/sub_widgets/crypto_selection_view.dart b/lib/pages/buy_view/sub_widgets/crypto_selection_view.dart index 70b63964e..2d0fe3095 100644 --- a/lib/pages/buy_view/sub_widgets/crypto_selection_view.dart +++ b/lib/pages/buy_view/sub_widgets/crypto_selection_view.dart @@ -11,7 +11,6 @@ import 'package:stackwallet/widgets/background.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/icon_widgets/x_icon.dart'; -import 'package:stackwallet/widgets/loading_indicator.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:stackwallet/widgets/stack_text_field.dart'; import 'package:stackwallet/widgets/textfield_icon_button.dart'; @@ -200,15 +199,7 @@ class _CryptoSelectionViewState extends State { SizedBox( width: 24, height: 24, - child: _coins[index].image.isNotEmpty - ? SvgPicture.network( - _coins[index].image, - width: 24, - height: 24, - placeholderBuilder: (_) => - const LoadingIndicator(), - ) - : getIconForTicker(_coins[index].ticker)), + child: getIconForTicker(_coins[index].ticker)), const SizedBox( width: 10, ), diff --git a/lib/pages/buy_view/sub_widgets/fiat_selection_view.dart b/lib/pages/buy_view/sub_widgets/fiat_selection_view.dart index 14417cdef..307595c64 100644 --- a/lib/pages/buy_view/sub_widgets/fiat_selection_view.dart +++ b/lib/pages/buy_view/sub_widgets/fiat_selection_view.dart @@ -12,7 +12,6 @@ import 'package:stackwallet/widgets/background.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/icon_widgets/x_icon.dart'; -import 'package:stackwallet/widgets/loading_indicator.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:stackwallet/widgets/stack_text_field.dart'; import 'package:stackwallet/widgets/textfield_icon_button.dart'; @@ -206,34 +205,26 @@ class _FiatSelectionViewState extends State { SizedBox( width: 48, height: 24, - child: _fiats[index].image.isNotEmpty - ? SvgPicture.network( - _fiats[index].image, - width: 24, - height: 24, - placeholderBuilder: (_) => - const LoadingIndicator(), - ) - : Text( - format.simpleCurrencySymbol( - _fiats[index].ticker.toUpperCase()), - style: STextStyles.currencyTicker(context) - .apply( - fontSizeFactor: (1 / - format - .simpleCurrencySymbol( - _fiats[index] - .ticker - .toUpperCase()) - .length * // Couldn't get pow() working here - format - .simpleCurrencySymbol( - _fiats[index] - .ticker - .toUpperCase()) - .length)), - textAlign: TextAlign.center, - ), + child: Text( + format.simpleCurrencySymbol( + _fiats[index].ticker.toUpperCase()), + style: STextStyles.currencyTicker(context) + .apply( + fontSizeFactor: (1 / + format + .simpleCurrencySymbol( + _fiats[index] + .ticker + .toUpperCase()) + .length * // Couldn't get pow() working here + format + .simpleCurrencySymbol( + _fiats[index] + .ticker + .toUpperCase()) + .length)), + textAlign: TextAlign.center, + ), ), const SizedBox( width: 10,