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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -11,6 +11,7 @@ abstract class Assets {
static const socials = _SOCIALS(); static const socials = _SOCIALS();
static const exchange = _EXCHANGE(); static const exchange = _EXCHANGE();
static const buy = _BUY(); static const buy = _BUY();
static const gif = _GIF();
static Future<void> precache(BuildContext context) async { static Future<void> precache(BuildContext context) async {
final assets = [ final assets = [
@ -383,12 +384,16 @@ class _ANIMATIONS {
const _ANIMATIONS(); const _ANIMATIONS();
String get test2 => "assets/lottie/test2.json"; String get test2 => "assets/lottie/test2.json";
}
class _GIF {
const _GIF();
String plain(Coin coin) { 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) { 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 # basic
- assets/lottie/test2.json - assets/lottie/test2.json
# coin animations # coin gifs
- assets/lottie/coins/bitcoin/ - assets/gif/coins/bitcoin/
- assets/lottie/coins/bitcoincash/ - assets/gif/coins/bitcoincash/
- assets/lottie/coins/dogecoin/ - assets/gif/coins/dogecoin/
- assets/lottie/coins/epicCash/ - assets/gif/coins/epicCash/
- assets/lottie/coins/ethereum/ - assets/gif/coins/ethereum/
- assets/lottie/coins/firo/ - assets/gif/coins/firo/
- assets/lottie/coins/litecoin/ - assets/gif/coins/litecoin/
- assets/lottie/coins/monero/ - assets/gif/coins/monero/
- assets/lottie/coins/namecoin/ - assets/gif/coins/namecoin/
- assets/lottie/coins/particl/ - assets/gif/coins/particl/
- assets/lottie/coins/wownero/ - assets/gif/coins/wownero/
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware. # https://flutter.dev/assets-and-images/#resolution-aware.