use gifs instead of lottie animations for static animated assets

This commit is contained in:
julian 2023-03-17 15:44:37 -06:00
parent 38e5182fb4
commit c88338f9ad
52 changed files with 46 additions and 49 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -63,6 +63,8 @@ class CreateOrRestoreWalletView extends StatelessWidget {
coin: coin,
width:
isDesktop ? 324 : MediaQuery.of(context).size.width / 1.6,
height:
isDesktop ? null : MediaQuery.of(context).size.width / 1.6,
),
const SizedBox(
height: 32,
@ -103,6 +105,9 @@ class CreateOrRestoreWalletView extends StatelessWidget {
width: isDesktop
? 324
: MediaQuery.of(context).size.width / 1.6,
height: isDesktop
? null
: MediaQuery.of(context).size.width / 1.6,
),
const Spacer(
flex: 2,

View file

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart';
import 'package:lottie/lottie.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/theme/color_theme.dart';
@ -26,8 +25,10 @@ class CoinImage extends ConsumerWidget {
return SizedBox(
width: width,
height: height,
child: Lottie.asset(
Assets.lottie.plain(coin),
child: Image(
image: AssetImage(
Assets.gif.plain(coin),
),
),
);
} else {

View file

@ -169,6 +169,7 @@ class _NameYourWalletViewState extends ConsumerState<NameYourWalletView> {
CoinImage(
coin: coin,
height: 100,
width: 100,
),
SizedBox(
height: isDesktop ? 0 : 16,

View file

@ -286,6 +286,7 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
CoinImage(
coin: coin,
height: 100,
width: 100,
),
SizedBox(
height: isDesktop ? 0 : 16,

View file

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:lottie/lottie.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
@ -71,8 +70,10 @@ class _RestoringDialogState extends State<BuildingTransactionDialog>
),
if (Theme.of(context).extension<StackColors>()!.themeType ==
ThemeType.chan)
Lottie.asset(
Assets.lottie.kiss(widget.coin),
Image(
image: AssetImage(
Assets.gif.kiss(widget.coin),
),
),
if (Theme.of(context).extension<StackColors>()!.themeType !=
ThemeType.chan)
@ -110,8 +111,10 @@ class _RestoringDialogState extends State<BuildingTransactionDialog>
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
Lottie.asset(
Assets.lottie.kiss(widget.coin),
Image(
image: AssetImage(
Assets.gif.kiss(widget.coin),
),
),
Text(
"Generating transaction",

View file

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:lottie/lottie.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
@ -68,8 +67,10 @@ class _RestoringDialogState extends State<SendingTransactionDialog>
),
Theme.of(context).extension<StackColors>()!.themeType ==
ThemeType.chan
? Lottie.asset(
Assets.lottie.kiss(widget.coin),
? Image(
image: AssetImage(
Assets.gif.kiss(widget.coin),
),
)
: RotationTransition(
turns: _spinAnimation,
@ -98,8 +99,10 @@ class _RestoringDialogState extends State<SendingTransactionDialog>
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
Lottie.asset(
Assets.lottie.kiss(widget.coin),
Image(
image: AssetImage(
Assets.gif.kiss(widget.coin),
),
),
Text(
"Sending transaction",

View file

@ -11,6 +11,7 @@ abstract class Assets {
static const socials = _SOCIALS();
static const exchange = _EXCHANGE();
static const buy = _BUY();
static const gif = _GIF();
static Future<void> precache(BuildContext context) async {
final assets = [
@ -383,12 +384,16 @@ class _ANIMATIONS {
const _ANIMATIONS();
String get test2 => "assets/lottie/test2.json";
}
class _GIF {
const _GIF();
String plain(Coin coin) {
return "assets/lottie/coins/${coin.mainNetVersion.name}/plain.lottie.json";
return "assets/gif/coins/${coin.mainNetVersion.name}/plain.gif";
}
String kiss(Coin coin) {
return "assets/lottie/coins/${coin.mainNetVersion.name}/kiss.lottie.json";
return "assets/gif/coins/${coin.mainNetVersion.name}/kiss.gif";
}
}

View file

@ -363,18 +363,18 @@ flutter:
# basic
- assets/lottie/test2.json
# coin animations
- assets/lottie/coins/bitcoin/
- assets/lottie/coins/bitcoincash/
- assets/lottie/coins/dogecoin/
- assets/lottie/coins/epicCash/
- assets/lottie/coins/ethereum/
- assets/lottie/coins/firo/
- assets/lottie/coins/litecoin/
- assets/lottie/coins/monero/
- assets/lottie/coins/namecoin/
- assets/lottie/coins/particl/
- assets/lottie/coins/wownero/
# coin gifs
- assets/gif/coins/bitcoin/
- assets/gif/coins/bitcoincash/
- assets/gif/coins/dogecoin/
- assets/gif/coins/epicCash/
- assets/gif/coins/ethereum/
- assets/gif/coins/firo/
- assets/gif/coins/litecoin/
- assets/gif/coins/monero/
- assets/gif/coins/namecoin/
- assets/gif/coins/particl/
- assets/gif/coins/wownero/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.