mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 20:09:23 +00:00
56 lines
1.3 KiB
Dart
56 lines
1.3 KiB
Dart
/*
|
|
* This file is part of Stack Wallet.
|
|
*
|
|
* Copyright (c) 2023 Cypher Stack
|
|
* All Rights Reserved.
|
|
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
|
* Generated by Cypher Stack on 2023-05-26
|
|
*
|
|
*/
|
|
|
|
import 'dart:io';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:lottie/lottie.dart';
|
|
import '../themes/theme_providers.dart';
|
|
import '../utilities/assets.dart';
|
|
|
|
class LoadingIndicator extends ConsumerWidget {
|
|
const LoadingIndicator({
|
|
super.key,
|
|
this.width,
|
|
this.height,
|
|
});
|
|
|
|
final double? width;
|
|
final double? height;
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final assetPath = ref.watch(
|
|
themeProvider.select((value) => value.assets.loadingGif),
|
|
);
|
|
|
|
return Container(
|
|
color: Colors.transparent,
|
|
child: Center(
|
|
child: SizedBox(
|
|
width: width,
|
|
height: height,
|
|
child: assetPath != null
|
|
? Image.file(
|
|
File(
|
|
assetPath,
|
|
),
|
|
)
|
|
: Lottie.asset(
|
|
Assets.lottie.test2,
|
|
animate: true,
|
|
repeat: true,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|