mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-02-02 19:26:37 +00:00
update a few more assets and added missing background asset to theme class
This commit is contained in:
parent
fae467440c
commit
aae766cdba
5 changed files with 71 additions and 39 deletions
|
@ -2033,6 +2033,7 @@ class ThemeAssets {
|
|||
final String namecoinImageSecondary;
|
||||
final String particlImageSecondary;
|
||||
final String? loadingGif;
|
||||
final String? background;
|
||||
|
||||
// todo: add all assets expected in json
|
||||
|
||||
|
@ -2088,6 +2089,7 @@ class ThemeAssets {
|
|||
required this.namecoinImageSecondary,
|
||||
required this.particlImageSecondary,
|
||||
required this.loadingGif,
|
||||
required this.background,
|
||||
});
|
||||
|
||||
factory ThemeAssets.fromJson({
|
||||
|
@ -2199,6 +2201,9 @@ class ThemeAssets {
|
|||
loadingGif: json["assets"]["loadingGif"] is String
|
||||
? "$applicationThemesDirectoryPath/$internalThemeUuid/${json["assets"]["loadingGif"] as String}"
|
||||
: null,
|
||||
background: json["assets"]["background"] is String
|
||||
? "$applicationThemesDirectoryPath/$internalThemeUuid/${json["assets"]["background"] as String}"
|
||||
: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
||||
import 'package:stackwallet/themes/theme_providers.dart';
|
||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||
|
||||
class Background extends StatelessWidget {
|
||||
class Background extends ConsumerWidget {
|
||||
const Background({
|
||||
Key? key,
|
||||
required this.child,
|
||||
|
@ -14,17 +16,17 @@ class Background extends StatelessWidget {
|
|||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
Color? color;
|
||||
|
||||
bool shouldPad = false;
|
||||
|
||||
switch (Theme.of(context).extension<StackColors>()!.themeType) {
|
||||
case ThemeType.oceanBreeze:
|
||||
switch (Theme.of(context).extension<StackColors>()!.themeId) {
|
||||
case "ocean_breeze":
|
||||
shouldPad = true;
|
||||
color = null;
|
||||
break;
|
||||
case ThemeType.fruitSorbet:
|
||||
case "fruit_sorbet":
|
||||
color = null;
|
||||
break;
|
||||
default:
|
||||
|
@ -32,7 +34,11 @@ class Background extends StatelessWidget {
|
|||
break;
|
||||
}
|
||||
|
||||
final bgAsset = Assets.svg.background(context);
|
||||
final bgAsset = ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.background,
|
||||
),
|
||||
);
|
||||
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
|
@ -52,8 +58,10 @@ class Background extends StatelessWidget {
|
|||
bottom: MediaQuery.of(context).size.height * (1 / 12),
|
||||
)
|
||||
: const EdgeInsets.all(0),
|
||||
child: SvgPicture.asset(
|
||||
bgAsset!,
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
bgAsset!,
|
||||
),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||
import 'dart:io';
|
||||
|
||||
class LoadingIndicator extends StatelessWidget {
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
import 'package:stackwallet/themes/theme_providers.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
|
||||
class LoadingIndicator extends ConsumerWidget {
|
||||
const LoadingIndicator({
|
||||
Key? key,
|
||||
this.width,
|
||||
|
@ -15,11 +17,10 @@ class LoadingIndicator extends StatelessWidget {
|
|||
final double? height;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isChan = Theme.of(context).extension<StackColors>()!.themeType ==
|
||||
ThemeType.chan ||
|
||||
Theme.of(context).extension<StackColors>()!.themeType ==
|
||||
ThemeType.darkChans;
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final assetPath = ref.watch(
|
||||
themeProvider.select((value) => value.assets.loadingGif),
|
||||
);
|
||||
|
||||
return Container(
|
||||
color: Colors.transparent,
|
||||
|
@ -27,10 +28,10 @@ class LoadingIndicator extends StatelessWidget {
|
|||
child: SizedBox(
|
||||
width: width,
|
||||
height: height,
|
||||
child: isChan
|
||||
? Image(
|
||||
image: AssetImage(
|
||||
Assets.gif.stacyPlain,
|
||||
child: assetPath != null
|
||||
? Image.file(
|
||||
File(
|
||||
assetPath,
|
||||
),
|
||||
)
|
||||
: Lottie.asset(
|
||||
|
|
|
@ -1,14 +1,23 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'dart:io';
|
||||
|
||||
class BuyNavIcon extends StatelessWidget {
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:stackwallet/themes/theme_providers.dart';
|
||||
|
||||
class BuyNavIcon extends ConsumerWidget {
|
||||
const BuyNavIcon({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SvgPicture.asset(
|
||||
Assets.svg.buy(context),
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.buy,
|
||||
),
|
||||
),
|
||||
),
|
||||
width: 24,
|
||||
height: 24,
|
||||
);
|
||||
|
|
|
@ -1,14 +1,23 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'dart:io';
|
||||
|
||||
class ExchangeNavIcon extends StatelessWidget {
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:stackwallet/themes/theme_providers.dart';
|
||||
|
||||
class ExchangeNavIcon extends ConsumerWidget {
|
||||
const ExchangeNavIcon({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SvgPicture.asset(
|
||||
Assets.svg.exchange(context),
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.buy,
|
||||
),
|
||||
),
|
||||
),
|
||||
width: 24,
|
||||
height: 24,
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue