mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
Move to precompiled SVGs (#3072)
* add compile script * merge * move to CakeImageWidget * add precompiled .vec * fix double declaration * move .svg * add to ci * add svgs
This commit is contained in:
@@ -3,6 +3,7 @@ import 'dart:math';
|
||||
import 'package:cake_wallet/entities/new_ui_entities/list_item/list_item_regular_row.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/new_list_row/new_list_section.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
@@ -67,8 +68,8 @@ class _AboutPageState extends State<AboutPage> {
|
||||
SizedBox(),
|
||||
GestureDetector(
|
||||
onTap: _easterEgg,
|
||||
child: SvgPicture.asset(
|
||||
"assets/new-ui/cake_squircle_icon.svg",
|
||||
child: CakeImageWidget(
|
||||
imageUrl: "assets/new-ui/cake_squircle_icon.svg",
|
||||
width: 128,
|
||||
height: 128,
|
||||
),
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:cake_wallet/new-ui/widgets/new_primary_button.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/monero_account_list/account_list_item.dart';
|
||||
@@ -447,8 +448,8 @@ class _AccountCreationModalState extends State<AccountCreationModal> {
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||
borderRadius: BorderRadius.circular(5)),
|
||||
child: SvgPicture.asset(
|
||||
"assets/new-ui/randomize.svg",
|
||||
child: CakeImageWidget(
|
||||
imageUrl: "assets/new-ui/randomize.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary, BlendMode.srcIn),
|
||||
),
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:cake_wallet/new-ui/widgets/coins_page/cards/balance_card.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/long_press_menu.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/utils/address_formatter.dart';
|
||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
@@ -423,7 +424,8 @@ class AddressRow extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
if (selected) SvgPicture.asset("assets/new-ui/checkmark.svg")
|
||||
if (selected) CakeImageWidget(
|
||||
imageUrl: "assets/new-ui/checkmark.svg")
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -462,7 +464,8 @@ class ShowHiddenButton extends StatelessWidget {
|
||||
Text(S.of(context).show_hidden_addresses),
|
||||
RotatedBox(
|
||||
quarterTurns: 1,
|
||||
child: SvgPicture.asset("assets/new-ui/dropdown_arrow.svg"))
|
||||
child:CakeImageWidget(
|
||||
imageUrl: "assets/new-ui/dropdown_arrow.svg"))
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/viewmodels/lightning_username/lightning_username_bloc.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/new_primary_button.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/themes/core/theme_store.dart';
|
||||
import 'package:cw_core/generate_name.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -164,7 +165,8 @@ class LightningUsernameInfo extends StatelessWidget {
|
||||
return Column(
|
||||
spacing: 24,
|
||||
children: [
|
||||
SvgPicture.asset(isLightMode
|
||||
CakeImageWidget(
|
||||
imageUrl: isLightMode
|
||||
? "assets/new-ui/lightning_username_setup_light.svg"
|
||||
: "assets/new-ui/lightning_username_setup.svg"),
|
||||
Row(
|
||||
@@ -219,7 +221,8 @@ class LightningUsernameEditor extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
spacing: 12,
|
||||
children: [
|
||||
SvgPicture.asset(isLightMode
|
||||
CakeImageWidget(
|
||||
imageUrl: isLightMode
|
||||
? "assets/new-ui/lightning_username_setup_light.svg"
|
||||
: "assets/new-ui/lightning_username_setup.svg"),
|
||||
if (isSetup)
|
||||
@@ -254,7 +257,8 @@ class LightningUsernameEditor extends StatelessWidget {
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: onRandomizeButtonTap,
|
||||
child: SvgPicture.asset("assets/new-ui/randomize.svg",
|
||||
child: CakeImageWidget(
|
||||
imageUrl: "assets/new-ui/randomize.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary, BlendMode.srcIn)),
|
||||
),
|
||||
|
||||
@@ -19,6 +19,7 @@ import 'package:cake_wallet/new-ui/widgets/send_page/send_confirm_sheet.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/send_page/send_memo_input.dart';
|
||||
import 'package:cake_wallet/reactions/wallet_connect.dart';
|
||||
import 'package:cake_wallet/src/widgets/bottom_sheet/token_selection_bottom_sheet.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/new_list_row/list_item_regular_row_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/standard_checkbox.dart';
|
||||
import 'package:cake_wallet/store/app_store.dart';
|
||||
@@ -290,7 +291,7 @@ class _NewSendPageState extends State<NewSendPage> {
|
||||
if (widget.sendViewModel.outputs.length > 1)
|
||||
ModernButton(
|
||||
size: 36,
|
||||
icon: SvgPicture.asset(
|
||||
icon: CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/remove_recipient.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary,
|
||||
@@ -321,7 +322,7 @@ class _NewSendPageState extends State<NewSendPage> {
|
||||
if (widget.mode.helpContent != null)
|
||||
ModernButton(
|
||||
size: 36,
|
||||
icon: SvgPicture.asset(
|
||||
icon: CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/help.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary, BlendMode.srcIn),
|
||||
@@ -1336,7 +1337,7 @@ class SendHelpPage extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset(content.imagePath),
|
||||
CakeImageWidget(imageUrl:content.imagePath),
|
||||
Text(
|
||||
content.description,
|
||||
textAlign: TextAlign.center,
|
||||
|
||||
@@ -25,6 +25,7 @@ import 'package:cake_wallet/src/screens/exchange/widgets/present_provider_picker
|
||||
import 'package:cake_wallet/src/screens/send/widgets/extract_address_from_parsed.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
import 'package:cake_wallet/utils/debounce.dart';
|
||||
import 'package:cake_wallet/utils/payment_request.dart';
|
||||
@@ -458,7 +459,7 @@ class _NewSwapPageState extends State<NewSwapPage> {
|
||||
title: S.of(context).swap,
|
||||
leadingIcon: Icon(Icons.close),
|
||||
onLeadingPressed: Navigator.of(context).maybePop,
|
||||
trailingIcon: SvgPicture.asset(
|
||||
trailingIcon: CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/options.svg",
|
||||
colorFilter:
|
||||
ColorFilter.mode(Theme.of(context).colorScheme.primary, BlendMode.srcIn),
|
||||
@@ -737,9 +738,7 @@ class SwapProviderPreview extends StatelessWidget {
|
||||
spacing: 12,
|
||||
children: [
|
||||
if (provider != null)
|
||||
provider.description.image.toLowerCase().endsWith("svg")
|
||||
? SvgPicture.asset(provider.description.image, width: 28, height: 28)
|
||||
: Image.asset(provider.description.image, width: 28, height: 28),
|
||||
CakeImageWidget(imageUrl:provider.description.image,width:28,height:28),
|
||||
if (provider == null) CupertinoActivityIndicator(),
|
||||
Text(
|
||||
provider?.title ?? "${S.of(context).finding_provider}...",
|
||||
@@ -762,7 +761,7 @@ class SwapProviderPreview extends StatelessWidget {
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
),
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/chooser.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.onSurfaceVariant, BlendMode.srcIn),
|
||||
@@ -927,17 +926,17 @@ class SwapAmountBoxState extends State<SwapAmountBox> {
|
||||
currencyToShow,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
RotatedBox(
|
||||
quarterTurns: 2,
|
||||
child: SvgPicture.asset(
|
||||
"assets/new-ui/dropdown_arrow.svg",
|
||||
width: 4,
|
||||
height: 4,
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary, BlendMode.srcIn),
|
||||
)),
|
||||
SizedBox(width: 4),
|
||||
SizedBox(width:10),
|
||||
RotatedBox(
|
||||
quarterTurns: 2,
|
||||
child: CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/dropdown_arrow.svg",
|
||||
width: 4,
|
||||
height: 4,
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary, BlendMode.srcIn),
|
||||
)),
|
||||
SizedBox(width:4),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -1040,7 +1039,7 @@ class SwapAmountBoxState extends State<SwapAmountBox> {
|
||||
),
|
||||
RotatedBox(
|
||||
quarterTurns: 2,
|
||||
child: SvgPicture.asset(
|
||||
child: CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/dropdown_arrow.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
(addressEmpty && widget.isReceiverCard)
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'dart:io';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/new_primary_button.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -144,8 +145,8 @@ class VersionNumberHeader extends StatelessWidget {
|
||||
spacing: 8,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
"assets/images/cake_logo_dark.svg",
|
||||
CakeImageWidget(
|
||||
imageUrl: "assets/images/cake_logo_dark.svg",
|
||||
height: 32,
|
||||
width: 32,
|
||||
colorFilter:
|
||||
@@ -174,8 +175,8 @@ class ChangelogItemWidget extends StatelessWidget {
|
||||
spacing: 12,
|
||||
children: [
|
||||
if (item.iconFilename.isNotEmpty)
|
||||
SvgPicture.asset(
|
||||
"$changelogIconLocation/${item.iconFilename}.svg",
|
||||
CakeImageWidget(
|
||||
imageUrl: "$changelogIconLocation/${item.iconFilename}.svg",
|
||||
height: 36,
|
||||
width: 36,
|
||||
colorFilter: ColorFilter.mode(Theme.of(context).colorScheme.primary, BlendMode.srcIn),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/new_list_row/new_simple_checkbox.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
@@ -63,7 +64,7 @@ class CoinControlListItem extends StatelessWidget {
|
||||
children: [
|
||||
Text(amount, style: TextStyle(fontSize:14,fontWeight: FontWeight.w400,color: Theme.of(context).colorScheme.onSurface),),
|
||||
if(address.toLowerCase().contains("mweb")) // hack carried over from old ui, we really should just have a boolean in the object
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/address-type-picker-icons/mweb.svg",
|
||||
width: 18,
|
||||
height: 18,
|
||||
@@ -71,7 +72,7 @@ class CoinControlListItem extends StatelessWidget {
|
||||
Theme.of(context).colorScheme.onSurfaceVariant, BlendMode.srcIn),
|
||||
),
|
||||
if(isSilentPayment)
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/address-type-picker-icons/silent.svg",
|
||||
width: 18,
|
||||
height: 18,
|
||||
@@ -100,7 +101,7 @@ class CoinControlListItem extends StatelessWidget {
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
),
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/arrow_right.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.onSurfaceVariant, BlendMode.srcIn),
|
||||
@@ -119,7 +120,7 @@ class CoinControlListItem extends StatelessWidget {
|
||||
}
|
||||
|
||||
if(isFrozen) {
|
||||
return SvgPicture.asset("assets/new-ui/frozen.svg");
|
||||
return CakeImageWidget(imageUrl:"assets/new-ui/frozen.svg");
|
||||
}
|
||||
|
||||
return NewSimpleCheckbox(value: isSending, onChanged: (value){onCheckBoxTap?.call();});
|
||||
|
||||
@@ -13,7 +13,7 @@ class CoinActionButton extends StatelessWidget {
|
||||
required this.action,
|
||||
});
|
||||
|
||||
final SvgPicture icon;
|
||||
final Widget icon;
|
||||
final String label;
|
||||
final VoidCallback action;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:cake_wallet/new-ui/modal_navigator.dart';
|
||||
import 'package:cake_wallet/new-ui/pages/send_page.dart';
|
||||
import 'package:cake_wallet/new-ui/pages/swap_page.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/utils/feature_flag.dart';
|
||||
import 'package:cake_wallet/utils/payment_request.dart';
|
||||
import 'package:cake_wallet/view_model/send/send_view_model.dart';
|
||||
@@ -38,7 +39,7 @@ class CoinActionRow extends StatelessWidget {
|
||||
spacing: MediaQuery.of(context).size.width * 0.05,
|
||||
children: [
|
||||
CoinActionButton(
|
||||
icon: SvgPicture.asset(
|
||||
icon: CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/send.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary,
|
||||
@@ -57,6 +58,7 @@ class CoinActionRow extends StatelessWidget {
|
||||
|
||||
CupertinoScaffold.showCupertinoModalBottomSheet(
|
||||
context: context,
|
||||
isDismissible: true,
|
||||
barrierColor: Colors.black.withAlpha(60),
|
||||
builder: (context) {
|
||||
return Material(
|
||||
@@ -75,7 +77,7 @@ class CoinActionRow extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
CoinActionButton(
|
||||
icon: SvgPicture.asset(
|
||||
icon: CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/receive.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary,
|
||||
@@ -108,7 +110,7 @@ class CoinActionRow extends StatelessWidget {
|
||||
),
|
||||
if (showSwap)
|
||||
CoinActionButton(
|
||||
icon: SvgPicture.asset(
|
||||
icon: CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/exchange.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary,
|
||||
@@ -134,7 +136,7 @@ class CoinActionRow extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
CoinActionButton(
|
||||
icon: SvgPicture.asset(
|
||||
icon: CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/scan.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary,
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:cake_wallet/new-ui/pages/send_page.dart';
|
||||
import 'package:cake_wallet/new-ui/pages/swap_page.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/modern_button.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/utils/payment_request.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cw_core/unspent_coin_type.dart';
|
||||
@@ -99,7 +100,7 @@ class AssetDetailsModal extends StatelessWidget {
|
||||
color: Colors.white),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: SvgPicture.asset(
|
||||
child: CakeImageWidget(imageUrl:
|
||||
chainIconPath,
|
||||
width: 18,
|
||||
height: 18,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:cake_wallet/new-ui/widgets/coins_page/assets_history/asset_details_modal.dart';
|
||||
import 'package:cake_wallet/src/screens/wallet_connect/utils/string_parsing.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cw_core/wallet_base.dart';
|
||||
@@ -115,8 +116,8 @@ class AssetTile extends StatelessWidget {
|
||||
color: Colors.white),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2.0),
|
||||
child: SvgPicture.asset(
|
||||
chainIconPath,
|
||||
child: CakeImageWidget(
|
||||
imageUrl: chainIconPath,
|
||||
width: 12,
|
||||
height: 12,
|
||||
colorFilter:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/line_tab_switcher.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
@@ -58,8 +59,11 @@ class AssetsTopBar extends StatelessWidget {
|
||||
child: Row(
|
||||
spacing: 4.0,
|
||||
children: [
|
||||
SvgPicture.asset("assets/new-ui/options_slider.svg", colorFilter: ColorFilter.mode(Theme.of(context).colorScheme.primary,BlendMode.srcIn)),
|
||||
Text(
|
||||
CakeImageWidget(
|
||||
imageUrl: "assets/new-ui/options_slider.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary, BlendMode.srcIn)),
|
||||
Text(
|
||||
S.of(context).tokens,
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.primary),
|
||||
)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:cake_wallet/new-ui/widgets/coins_page/assets_history/history_tile_base.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cw_core/transaction_direction.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -61,7 +62,7 @@ class HistoryTile extends StatelessWidget {
|
||||
if (asset == CryptoCurrency.btcln) {
|
||||
return Stack(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/images/lightning-icon.svg",
|
||||
width: 34,
|
||||
height: 34,
|
||||
@@ -73,7 +74,7 @@ class HistoryTile extends StatelessWidget {
|
||||
width: 16,
|
||||
height: 16,
|
||||
decoration: BoxDecoration(color: Theme.of(context).colorScheme.onInverseSurface, shape: BoxShape.circle),
|
||||
child: SvgPicture.asset(
|
||||
child: CakeImageWidget(imageUrl:
|
||||
_getDirectionIconToken(),
|
||||
colorFilter: ColorFilter.mode(
|
||||
direction == TransactionDirection.outgoing
|
||||
@@ -92,7 +93,7 @@ class HistoryTile extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
return SvgPicture.asset(_getDirectionIcon(),
|
||||
return CakeImageWidget(imageUrl:_getDirectionIcon(),
|
||||
colorFilter: ColorFilter.mode(
|
||||
direction == TransactionDirection.outgoing
|
||||
? Theme.of(context).colorScheme.inverseSurface.withAlpha(175)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cw_core/card_design.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -81,8 +82,8 @@ class BalanceCard extends StatelessWidget {
|
||||
? ClipRSuperellipse(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
key: ValueKey(design.imagePath),
|
||||
child: SvgPicture.asset(
|
||||
design.imagePath,
|
||||
child: CakeImageWidget(
|
||||
imageUrl: design.imagePath,
|
||||
width: width,
|
||||
height: height,
|
||||
fit: BoxFit.fill,
|
||||
@@ -234,8 +235,8 @@ class BalanceCard extends StatelessWidget {
|
||||
switchInCurve: Curves.easeInOut,
|
||||
switchOutCurve: Curves.easeInOut,
|
||||
child: design.backgroundType == CardDesignBackgroundTypes.svgIcon
|
||||
? SvgPicture.asset(
|
||||
design.imagePath,
|
||||
? CakeImageWidget(
|
||||
imageUrl: design.imagePath,
|
||||
key: const ValueKey('svgIcon'),
|
||||
height: iconWidth,
|
||||
width: iconWidth,
|
||||
@@ -262,12 +263,13 @@ class BalanceCard extends StatelessWidget {
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: onCustomizeTapped,
|
||||
child: SizedBox(
|
||||
child: Container(
|
||||
height: 40,
|
||||
width: 40,
|
||||
child: Center(
|
||||
child: SvgPicture.asset(
|
||||
"assets/new-ui/3dots_vertical.svg",
|
||||
child: CakeImageWidget(
|
||||
imageUrl: "assets/new-ui/3dots_vertical.svg",
|
||||
alignment: Alignment.topRight,
|
||||
colorFilter:
|
||||
ColorFilter.mode(design.colors.textColorSecondary, BlendMode.srcIn),
|
||||
),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
@@ -32,7 +33,7 @@ class MwebAd extends StatelessWidget {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/settings_row_icons/mweb.svg",
|
||||
width: 24,
|
||||
height: 24,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
@@ -37,9 +38,9 @@ class ChainIcon extends StatelessWidget {
|
||||
scale: done ? 1 : 0.8,
|
||||
child: AnimatedSwitcher(
|
||||
duration: Duration(milliseconds: 150),
|
||||
child: SvgPicture.asset(
|
||||
child: CakeImageWidget(
|
||||
imageUrl: iconPath,
|
||||
key: ValueKey(progress >= 1),
|
||||
iconPath,
|
||||
width: 36,
|
||||
height: 36,
|
||||
colorFilter: ColorFilter.mode(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -47,9 +48,8 @@ class LightningSwitcher extends StatelessWidget {
|
||||
duration: Duration(milliseconds: 150),
|
||||
transitionBuilder: (child, animation) =>
|
||||
FadeTransition(opacity: animation, child: child),
|
||||
child: SvgPicture.asset(
|
||||
child: CakeImageWidget(imageUrl:'assets/new-ui/switcher-bitcoin.svg',
|
||||
key: ValueKey(lightningMode),
|
||||
'assets/new-ui/switcher-bitcoin.svg',
|
||||
width: 32,
|
||||
height: 32,
|
||||
colorFilter: ColorFilter.mode(
|
||||
@@ -64,9 +64,8 @@ class LightningSwitcher extends StatelessWidget {
|
||||
duration: Duration(milliseconds: 150),
|
||||
transitionBuilder: (child, animation) =>
|
||||
FadeTransition(opacity: animation, child: child),
|
||||
child: SvgPicture.asset(
|
||||
child: CakeImageWidget(imageUrl: 'assets/new-ui/switcher-lightning.svg',
|
||||
key: ValueKey(lightningMode),
|
||||
'assets/new-ui/switcher-lightning.svg',
|
||||
width: 32,
|
||||
height: 32,
|
||||
colorFilter: ColorFilter.mode(
|
||||
|
||||
@@ -139,14 +139,14 @@ class SyncBar extends StatelessWidget {
|
||||
|
||||
Widget? _getIcon(BuildContext context, Type status) {
|
||||
if (status == LostConnectionSyncStatus || status == FailedSyncStatus) {
|
||||
return SvgPicture.asset(
|
||||
return CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/offline.svg",
|
||||
colorFilter: ColorFilter.mode(Theme.of(context).colorScheme.error, BlendMode.srcIn),
|
||||
);
|
||||
}
|
||||
|
||||
if (failStatuses.contains(status)) {
|
||||
return SvgPicture.asset(
|
||||
return CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/warning.svg",
|
||||
colorFilter: ColorFilter.mode(Theme.of(context).colorScheme.error, BlendMode.srcIn),
|
||||
);
|
||||
@@ -155,18 +155,18 @@ class SyncBar extends StatelessWidget {
|
||||
final List<Widget> children = [];
|
||||
|
||||
if (dashboardViewModel.isTorEnabled) {
|
||||
children.add(SvgPicture.asset("assets/new-ui/tor_sync.svg",
|
||||
children.add(CakeImageWidget(imageUrl:"assets/new-ui/tor_sync.svg",
|
||||
colorFilter: ColorFilter.mode(Color(0xFF8A38F5), BlendMode.srcIn)));
|
||||
}
|
||||
if (dashboardViewModel.hasMweb) {
|
||||
children.add(SvgPicture.asset(
|
||||
children.add(CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/mweb_sync.svg",
|
||||
colorFilter:
|
||||
ColorFilter.mode(Theme.of(context).colorScheme.onSurfaceVariant, BlendMode.srcIn),
|
||||
));
|
||||
}
|
||||
if (dashboardViewModel.hasSilentPayments) {
|
||||
children.add(SvgPicture.asset(
|
||||
children.add(CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/silent_sync.svg",
|
||||
colorFilter: ColorFilter.mode(Color(0xFFEFBA5E), BlendMode.srcIn),
|
||||
));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:cake_wallet/new-ui/widgets/modern_button.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cw_core/wallet_info.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -45,7 +46,7 @@ class WalletInfoBar extends StatelessWidget {
|
||||
? const SizedBox.shrink(key: ValueKey("empty"))
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(right: 8),
|
||||
child: SvgPicture.asset(
|
||||
child: CakeImageWidget(imageUrl:
|
||||
hardwareWalletIcon!,
|
||||
key: ValueKey("hardware_wallet_icon"),
|
||||
width: 24,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
||||
@@ -36,7 +37,8 @@ class DropdownRow extends StatelessWidget {
|
||||
duration: Duration(milliseconds: 300),
|
||||
turns: expanded ? 0.0 : 0.5,
|
||||
curve: Curves.easeOut,
|
||||
child: SvgPicture.asset(
|
||||
child: CakeImageWidget(
|
||||
imageUrl:
|
||||
"assets/new-ui/dropdown_arrow.svg",
|
||||
colorFilter:
|
||||
ColorFilter.mode(Theme.of(context).colorScheme.primary, BlendMode.srcIn),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
@@ -73,7 +74,8 @@ class _KeyboardHideButtonState extends State<KeyboardHideButton> {
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: SvgPicture.asset(
|
||||
child: CakeImageWidget(
|
||||
imageUrl:
|
||||
"assets/new-ui/hide_keyboard.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.onPrimary, BlendMode.srcIn),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
||||
@@ -74,7 +75,8 @@ class _LongPressMenuState extends State<LongPressMenu> {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
spacing: 8,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(
|
||||
imageUrl:
|
||||
item.iconPath,
|
||||
height: 20,
|
||||
width: 20,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
||||
@@ -22,7 +23,8 @@ class ModalHeader extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset(iconPath, width: 36, height: 36),
|
||||
CakeImageWidget(
|
||||
imageUrl: iconPath, width: 36, height: 36),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
@@ -41,8 +42,8 @@ class ModernButton extends StatelessWidget {
|
||||
final resolvedBackgroundColor =
|
||||
backgroundColor ?? Theme.of(context).colorScheme.surfaceContainer;
|
||||
final Widget resolvedIcon = svgPath != null
|
||||
? SvgPicture.asset(
|
||||
svgPath!,
|
||||
? CakeImageWidget(
|
||||
imageUrl: svgPath!,
|
||||
width: resolvedIconSize,
|
||||
height: resolvedIconSize,
|
||||
fit: BoxFit.contain,
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:cake_wallet/new-ui/widgets/new_primary_button.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/new_list_row/new_simple_checkbox.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
@@ -216,7 +217,7 @@ class PickerSliderButton<Item> extends StatelessWidget {
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
fontWeight: FontWeight.w400)),
|
||||
if(isSelected) SvgPicture.asset(
|
||||
if(isSelected) CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/arrow_right.svg",
|
||||
colorFilter:
|
||||
ColorFilter.mode(Theme.of(context).colorScheme.primary, BlendMode.srcIn),)
|
||||
@@ -229,7 +230,7 @@ class PickerSliderButton<Item> extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
isSelected? NewSimpleCheckbox(value: true, onChanged: (val){}):
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/arrow_right.svg",
|
||||
colorFilter:
|
||||
ColorFilter.mode(Theme.of(context).colorScheme.primary, BlendMode.srcIn),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_address_type_selector.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/receive_option_view_model.dart';
|
||||
import 'package:cw_core/receive_page_option.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -51,10 +52,9 @@ class ReceiveAddressTypeDisplay extends StatelessWidget {
|
||||
spacing: 12.0,
|
||||
children: [
|
||||
if (iconPath != null)
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:iconPath,
|
||||
width: 24,
|
||||
height: 24,
|
||||
iconPath!,
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary,
|
||||
BlendMode.srcIn,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/rounded_checkbox.dart';
|
||||
import 'package:cake_wallet/src/widgets/section_divider.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/receive_option_view_model.dart';
|
||||
@@ -159,7 +160,7 @@ class _ReceiveAddressTypeSelectorState extends State<ReceiveAddressTypeSelector>
|
||||
ReceiveAddressTypeSelector.otherOptionsExpandDuration,
|
||||
turns: _otherOptionsExpanded ? 0.0 : 0.5,
|
||||
curve: Curves.easeOut,
|
||||
child: SvgPicture.asset("assets/new-ui/dropdown_arrow.svg"))
|
||||
child: CakeImageWidget(imageUrl:"assets/new-ui/dropdown_arrow.svg"))
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -279,7 +280,7 @@ class ReceiveAddressTypeRow extends StatelessWidget {
|
||||
Row(
|
||||
children: [
|
||||
if (iconPath != null)
|
||||
SvgPicture.asset(iconPath!, width: iconSize, height: iconSize,colorFilter: ColorFilter.mode(Theme.of(context).colorScheme.onSurfaceVariant,BlendMode.srcIn),)
|
||||
CakeImageWidget(imageUrl:iconPath!, width: iconSize, height: iconSize,colorFilter: ColorFilter.mode(Theme.of(context).colorScheme.onSurfaceVariant,BlendMode.srcIn),)
|
||||
else
|
||||
Container(width: iconSize, height: iconSize),
|
||||
Padding(
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/new_primary_button.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
@@ -100,7 +101,7 @@ class _ReceiveAmountModalState extends State<ReceiveAmountModal> {
|
||||
),
|
||||
RotatedBox(
|
||||
quarterTurns: 2,
|
||||
child: SvgPicture.asset("assets/new-ui/dropdown_arrow.svg"))
|
||||
child: CakeImageWidget(imageUrl:"assets/new-ui/dropdown_arrow.svg"))
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:cake_wallet/entities/auto_generate_subaddress_status.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
@@ -55,7 +56,7 @@ class ReceiveInfoBox extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 10,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
iconPath,
|
||||
width: 16,
|
||||
height: 16,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
@@ -22,10 +23,9 @@ class ReceiveLabelWidget extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ClipRect(
|
||||
child: SvgPicture.asset(
|
||||
child: CakeImageWidget(imageUrl:"assets/new-ui/label.svg",
|
||||
width: 24,
|
||||
height: 24,
|
||||
"assets/new-ui/label.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.onSurfaceVariant, BlendMode.srcIn),
|
||||
)),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
||||
@@ -29,7 +30,7 @@ class ReceiveLargeAmountPreview extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 12,
|
||||
children: [
|
||||
SvgPicture.asset("assets/new-ui/send.svg",
|
||||
CakeImageWidget(imageUrl:"assets/new-ui/send.svg",
|
||||
width: 24,
|
||||
height: 24,
|
||||
colorFilter: ColorFilter.mode(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:cake_wallet/di.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/themes/core/theme_store.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
@@ -35,7 +36,7 @@ class ReceiveQrCode extends StatelessWidget {
|
||||
AnimatedOpacity(
|
||||
duration: Duration(milliseconds: 300),
|
||||
opacity: largeQrMode ? 1 : 0,
|
||||
child: SvgPicture.asset(
|
||||
child: CakeImageWidget(imageUrl:
|
||||
isLightMode
|
||||
? "assets/new-ui/cakewallet-wordmark-light.svg"
|
||||
: "assets/new-ui/cakewallet-wordmark.svg",
|
||||
@@ -98,7 +99,7 @@ class ReceiveQrCode extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 4,
|
||||
children: [
|
||||
SvgPicture.asset("assets/new-ui/payjoin.svg"),
|
||||
CakeImageWidget(imageUrl: "assets/new-ui/payjoin.svg"),
|
||||
Text(S.of(context).payjoin_enabled)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -32,7 +33,7 @@ class ReceiveTokenDisplay extends StatelessWidget {
|
||||
child: Row(
|
||||
spacing:4,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/chain_badges/${walletTypeToString(addressListViewModel.wallet.type).toLowerCase()}.svg",
|
||||
width: 16,
|
||||
height: 16,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
||||
@@ -17,9 +18,8 @@ class FloatingIconButton extends StatelessWidget {
|
||||
onTap: onPressed,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: SvgPicture.asset(
|
||||
child: CakeImageWidget(imageUrl:iconPath,
|
||||
width: 22, height: 22,
|
||||
iconPath,
|
||||
colorFilter: ColorFilter.mode(Theme
|
||||
.of(context)
|
||||
.colorScheme
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:cake_wallet/new-ui/widgets/new_primary_button.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/send_page/l2_send_external_modal.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/send_page/send_address_input.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/new_list_row/new_simple_checkbox.dart';
|
||||
import 'package:cake_wallet/view_model/contact_list/contact_list_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/send/send_view_model.dart';
|
||||
@@ -251,7 +252,7 @@ class _L2ActionWalletSelectorState extends State<L2ActionWalletSelector> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 10,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/send_from_external.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary, BlendMode.srcIn),
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/new_primary_button.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/utils/address_formatter.dart';
|
||||
import 'package:cake_wallet/view_model/send/send_view_model.dart';
|
||||
import 'package:cw_core/payment_uris.dart';
|
||||
@@ -65,7 +66,7 @@ class _L2SendExternalModalState extends State<L2SendExternalModal> {
|
||||
spacing: 12,
|
||||
children: [
|
||||
if(widget.sendViewModel.walletType == WalletType.bitcoin)
|
||||
SvgPicture.asset("assets/new-ui/lightning_deposit_help.svg", height: 36),
|
||||
CakeImageWidget(imageUrl:"assets/new-ui/lightning_deposit_help.svg", height: 36),
|
||||
Text(
|
||||
S.of(context).bitcoin_lightning_deposit,
|
||||
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 20),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:cake_wallet/new-ui/widgets/send_page/floating_icon_button.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
@@ -111,7 +112,7 @@ class _NewSendAmountInputState extends State<NewSendAmountInput> {
|
||||
Image.asset(widget.currencyIconPath, width: 24, height: 24),
|
||||
Text(widget.currency),
|
||||
if (widget.hasPicker)
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/chooser.svg",
|
||||
width: 12,
|
||||
height: 12,
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:cake_wallet/core/execution_state.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/confirm_swiper.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/new_primary_button.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/view_model/send/send_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/send/send_view_model_state.dart';
|
||||
import 'package:cw_core/wallet_info.dart';
|
||||
@@ -9,6 +10,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:vector_graphics/vector_graphics.dart';
|
||||
|
||||
class SendConfirmBottomWidget extends StatelessWidget {
|
||||
const SendConfirmBottomWidget({super.key, required this.sendViewModel});
|
||||
@@ -120,7 +122,7 @@ class TransactionErrorActions extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 8,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/warning.svg",
|
||||
height: 24,
|
||||
width: 24,
|
||||
@@ -191,7 +193,7 @@ class HardwareWalletConfirmationMessage extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(spacing: 8, children: [
|
||||
if (hardwareWalletIcon != null)
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
hardwareWalletIcon!,
|
||||
width: 36,
|
||||
height: 36,
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/animated_dropdown.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/send_page/send_confirm_bottom_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/utils/address_formatter.dart';
|
||||
import 'package:cake_wallet/view_model/send/send_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/send/send_view_model_state.dart';
|
||||
@@ -118,7 +119,7 @@ class SendTransactionDetails extends StatelessWidget {
|
||||
spacing: 8,
|
||||
children: [
|
||||
if (resolvedIconPath.toLowerCase().endsWith(".svg"))
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
resolvedIconPath,
|
||||
width: 28,
|
||||
height: 28,
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/new_primary_button.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/send_page/send_address_input.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -51,8 +52,8 @@ class _RefundAddressModalState extends State<RefundAddressModal> {
|
||||
child: Column(
|
||||
spacing: 24,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
"assets/new-ui/refund_address.svg",
|
||||
CakeImageWidget(
|
||||
imageUrl:"assets/new-ui/refund_address.svg.vec",
|
||||
colorFilter:
|
||||
ColorFilter.mode(Theme.of(context).colorScheme.primary, BlendMode.srcIn),
|
||||
),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/send_page/send_address_input.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/new_list_row/new_simple_checkbox.dart';
|
||||
import 'package:cake_wallet/view_model/exchange/exchange_view_model.dart';
|
||||
import 'package:cw_core/currency_for_wallet_type.dart';
|
||||
@@ -152,7 +153,7 @@ class _SwapAddressSelectionModalState extends State<SwapAddressSelectionModal> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 10,
|
||||
children: [
|
||||
SvgPicture.asset("assets/new-ui/send_from_external.svg",
|
||||
CakeImageWidget(imageUrl:"assets/new-ui/send_from_external.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.primary, BlendMode.srcIn)),
|
||||
Text(S.of(context).send_from_external,
|
||||
@@ -271,7 +272,7 @@ class _SwapAddressSelectionModalRowState extends State<SwapAddressSelectionModal
|
||||
duration: Duration(milliseconds: 200),
|
||||
curve: Curves.easeOutCubic,
|
||||
turns: _isExpanded ? 0 : 0.5,
|
||||
child: SvgPicture.asset(
|
||||
child:CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/dropdown_arrow.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.onSurfaceVariant, BlendMode.srcIn),
|
||||
@@ -315,7 +316,7 @@ class _SwapAddressSelectionModalRowState extends State<SwapAddressSelectionModal
|
||||
child: Row(
|
||||
spacing: 12,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/account.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/new_primary_button.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
||||
@@ -23,7 +24,7 @@ class SwapProviderInitialPreferenceModal extends StatelessWidget {
|
||||
child: Column(
|
||||
spacing: 12,
|
||||
children: [
|
||||
SvgPicture.asset("assets/new-ui/exchange_providers.svg"),
|
||||
CakeImageWidget(imageUrl:"assets/new-ui/exchange_providers.svg"),
|
||||
Text(
|
||||
"${S.of(context).swap_provider_initial_desc} Cake Wallet.",
|
||||
textAlign: TextAlign.center,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:io';
|
||||
import 'dart:ui';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:cake_wallet/entities/new_main_actions.dart';
|
||||
@@ -214,7 +215,7 @@ class _NEWNewMainNavBarState extends State<NewMainNavBar> {
|
||||
builder: (context, value, child) {
|
||||
return Container(
|
||||
height: NewMainNavBar.barHeight,
|
||||
child: SvgPicture.asset(
|
||||
child: CakeImageWidget(imageUrl:
|
||||
visibleActions[i].image,
|
||||
width: iconWidth,
|
||||
height: iconHeight,
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
|
||||
import 'package:cake_wallet/src/screens/nodes/widgets/node_form.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
import 'package:cake_wallet/src/widgets/scrollable_with_bottom_section.dart';
|
||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||
@@ -89,7 +90,7 @@ class _NodeCreateOrEditPageState extends State<NodeCreateOrEditPage> {
|
||||
title: widget.editingNode != null ? S.current.edit_node : S.current.node_new,
|
||||
leadingIcon: Icon(Icons.arrow_back_ios_new),
|
||||
onLeadingPressed: Navigator.of(context).pop,
|
||||
trailingIcon: SvgPicture.asset(
|
||||
trailingIcon: CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/scan.svg",width:24,height:24,
|
||||
colorFilter: ColorFilter.mode(Theme.of(context).colorScheme.primary, BlendMode.srcIn),
|
||||
),
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cw_core/utils/print_verbose.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart' as qr;
|
||||
@@ -42,7 +44,7 @@ class QrImage extends StatelessWidget {
|
||||
backgroundColor: backgroundColor,
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
),
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
imagePath,
|
||||
width: logoSize * 0.8,
|
||||
height: logoSize * 0.8,
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import 'package:cw_core/utils/print_verbose.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:vector_graphics/vector_graphics.dart';
|
||||
|
||||
class CakeImageWidget extends StatelessWidget {
|
||||
const CakeImageWidget({
|
||||
@@ -11,8 +14,8 @@ class CakeImageWidget extends StatelessWidget {
|
||||
this.loadingWidget,
|
||||
this.errorWidget,
|
||||
this.color,
|
||||
this.borderRadius = 24.0,
|
||||
this.colorFilter,
|
||||
this.borderRadius = 24.0, this.alignment, this.allowDrawingOutsideViewBox,
|
||||
});
|
||||
|
||||
final String? imageUrl;
|
||||
@@ -22,8 +25,10 @@ class CakeImageWidget extends StatelessWidget {
|
||||
final Widget? loadingWidget;
|
||||
final Widget? errorWidget;
|
||||
final Color? color;
|
||||
final double borderRadius;
|
||||
final ColorFilter? colorFilter;
|
||||
final AlignmentGeometry? alignment;
|
||||
final bool? allowDrawingOutsideViewBox;
|
||||
final double borderRadius;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -38,21 +43,36 @@ class CakeImageWidget extends StatelessWidget {
|
||||
|
||||
Widget imageWidget;
|
||||
if (isAsset) {
|
||||
imageWidget = isSvg
|
||||
? SvgPicture.asset(
|
||||
imageUrl!,
|
||||
height: height,
|
||||
width: width,
|
||||
colorFilter: effectiveColorFilter,
|
||||
fit: fit ?? BoxFit.contain,
|
||||
)
|
||||
: Image.asset(
|
||||
imageUrl!,
|
||||
height: height,
|
||||
width: width,
|
||||
fit: fit,
|
||||
color: color,
|
||||
);
|
||||
if (isSvg) {
|
||||
imageWidget = SvgPicture(AssetBytesLoader("${imageUrl}.vec"),
|
||||
height: height,
|
||||
width: width,
|
||||
alignment: alignment ?? Alignment.center,
|
||||
allowDrawingOutsideViewBox: allowDrawingOutsideViewBox ?? false,
|
||||
colorFilter:
|
||||
effectiveColorFilter,
|
||||
fit: fit ?? BoxFit.contain, errorBuilder: (context, e, trace) {
|
||||
return SvgPicture.asset(
|
||||
imageUrl!,
|
||||
height: height,
|
||||
alignment: alignment ?? Alignment.center,
|
||||
allowDrawingOutsideViewBox: allowDrawingOutsideViewBox ?? false,
|
||||
width: width,
|
||||
errorBuilder: (_, __, ___) => SizedBox(height: height, width: width),
|
||||
colorFilter:
|
||||
effectiveColorFilter,
|
||||
fit: fit ?? BoxFit.contain,
|
||||
);
|
||||
});
|
||||
} else {
|
||||
imageWidget = Image.asset(
|
||||
imageUrl!,
|
||||
height: height,
|
||||
width: width,
|
||||
fit: fit,
|
||||
color: color,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
imageWidget = isSvg
|
||||
? SvgPicture.network(
|
||||
@@ -60,6 +80,8 @@ class CakeImageWidget extends StatelessWidget {
|
||||
height: height,
|
||||
width: width,
|
||||
colorFilter: effectiveColorFilter,
|
||||
alignment: alignment ?? Alignment.center,
|
||||
allowDrawingOutsideViewBox: allowDrawingOutsideViewBox ?? false,
|
||||
fit: fit ?? BoxFit.contain,
|
||||
placeholderBuilder: (_) {
|
||||
return loadingWidget ?? const Center(child: CircularProgressIndicator());
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/new_list_row/list_Item_style_wrapper.dart';
|
||||
import 'package:cake_wallet/src/widgets/new_list_row/new_simple_checkbox.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -52,7 +53,7 @@ class _ListItemCheckboxWidgetState extends State<ListItemCheckboxWidget> {
|
||||
children: [
|
||||
if (widget.iconPath != null)
|
||||
widget.iconPath!.toLowerCase().endsWith("svg")
|
||||
? SvgPicture.asset(widget.iconPath!, height: 24, width: 24)
|
||||
? CakeImageWidget(imageUrl:widget.iconPath!, height: 24, width: 24)
|
||||
: Image.asset(
|
||||
widget.iconPath!,
|
||||
width: 24,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/new_list_row/list_Item_style_wrapper.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
@@ -59,17 +60,7 @@ class ListItemRegularRowWidget extends StatelessWidget {
|
||||
if(iconPath != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 12.0),
|
||||
child: iconPath!.split(".").last.toLowerCase() == "svg"
|
||||
? SvgPicture.asset(
|
||||
iconPath!,
|
||||
width: 24,
|
||||
height: 24,
|
||||
)
|
||||
: Image.asset(
|
||||
iconPath!,
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
child: CakeImageWidget(imageUrl: iconPath!, width: 24,height: 24,)
|
||||
),
|
||||
Flexible(
|
||||
child: Column(
|
||||
@@ -100,14 +91,14 @@ class ListItemRegularRowWidget extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
if(trailingIconPath != null)
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
trailingIconPath!,
|
||||
height: trailingIconSize ?? 18,
|
||||
width:trailingIconSize ?? 18,
|
||||
colorFilter: ColorFilter.mode(foregroundColor ?? Theme.of(context).colorScheme.onSurfaceVariant,BlendMode.srcIn),
|
||||
)
|
||||
else if(showArrow)
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/arrow_forward.svg",
|
||||
height: 14,
|
||||
color: theme.colorScheme.onSurfaceVariant
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/new_list_row/list_Item_style_wrapper.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
@@ -41,7 +42,7 @@ class ListItemSelectorWidget extends StatelessWidget {
|
||||
options[selectedIndex],
|
||||
style: labelStyle,
|
||||
),
|
||||
SvgPicture.asset(
|
||||
CakeImageWidget(imageUrl:
|
||||
"assets/new-ui/chooser.svg",
|
||||
colorFilter:
|
||||
ColorFilter.mode(theme.colorScheme.onSurfaceVariant, BlendMode.srcIn),
|
||||
|
||||
Reference in New Issue
Block a user