Skip to content

Commit

Permalink
precache chan theme selector
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-CStack committed Mar 17, 2023
1 parent 864375e commit 9f64393
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/utilities/assets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/theme/color_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';

abstract class Assets {
static const svg = _SVG();
Expand All @@ -15,15 +16,19 @@ abstract class Assets {

static Future<void> precache(BuildContext context) async {
final assets = [
svg.iconFor(coin: Coin.dogecoin),
svg.stack(context),
svg.personaEasy(context),
svg.personaIncognito(context),
svg.iconFor(coin: Coin.dogecoin),
...Coin.values.map(
(e) => svg.imageFor(context: context, coin: e),
),
];

if (Util.isDesktop) {
assets.add(svg.themeChan);
}

final futures = assets.map(
(e) => precachePicture(
ExactAssetPicture(
Expand Down

0 comments on commit 9f64393

Please sign in to comment.