2023-05-26 21:21:16 +00:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2023-05-09 16:51:30 +00:00
|
|
|
import 'dart:io';
|
2022-08-26 08:11:35 +00:00
|
|
|
import 'dart:math';
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
2023-05-09 16:51:30 +00:00
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
2022-08-26 08:11:35 +00:00
|
|
|
import 'package:lottie/lottie.dart';
|
2024-05-23 00:37:06 +00:00
|
|
|
import '../themes/stack_colors.dart';
|
|
|
|
import '../themes/theme_providers.dart';
|
|
|
|
import '../utilities/assets.dart';
|
|
|
|
import '../widgets/background.dart';
|
|
|
|
import '../widgets/conditional_parent.dart';
|
|
|
|
import '../widgets/rounded_container.dart';
|
2022-08-26 08:11:35 +00:00
|
|
|
|
2023-05-09 16:51:30 +00:00
|
|
|
class LoadingView extends ConsumerWidget {
|
2024-05-27 23:56:22 +00:00
|
|
|
const LoadingView({super.key});
|
2022-08-26 08:11:35 +00:00
|
|
|
|
|
|
|
@override
|
2023-05-09 16:51:30 +00:00
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
2022-08-26 08:11:35 +00:00
|
|
|
final size = MediaQuery.of(context).size;
|
2023-02-23 17:25:32 +00:00
|
|
|
final width = min(size.width, size.height) * 0.5;
|
2023-03-21 15:29:58 +00:00
|
|
|
|
2023-05-09 16:51:30 +00:00
|
|
|
final assetPath = ref.watch(
|
|
|
|
themeProvider.select((value) => value.assets.loadingGif),
|
|
|
|
);
|
2023-03-21 15:29:58 +00:00
|
|
|
|
2022-11-25 19:24:01 +00:00
|
|
|
return Background(
|
|
|
|
child: Scaffold(
|
|
|
|
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
|
|
|
|
body: Container(
|
|
|
|
color: Theme.of(context).extension<StackColors>()!.background,
|
|
|
|
child: Center(
|
2023-02-23 17:25:32 +00:00
|
|
|
child: ConditionalParent(
|
2023-05-09 16:51:30 +00:00
|
|
|
condition: Theme.of(context).extension<StackColors>()!.themeId ==
|
|
|
|
"oled_black",
|
2023-02-23 17:25:32 +00:00
|
|
|
builder: (child) => RoundedContainer(
|
|
|
|
color: const Color(0xFFDEDEDE),
|
|
|
|
radiusMultiplier: 100,
|
|
|
|
width: width * 1.35,
|
|
|
|
height: width * 1.35,
|
|
|
|
child: child,
|
|
|
|
),
|
|
|
|
child: SizedBox(
|
|
|
|
width: width,
|
2023-05-09 16:51:30 +00:00
|
|
|
child: assetPath != null
|
|
|
|
? Image.file(
|
|
|
|
File(
|
|
|
|
assetPath,
|
2023-03-21 15:29:58 +00:00
|
|
|
),
|
|
|
|
)
|
|
|
|
: Lottie.asset(
|
|
|
|
Assets.lottie.test2,
|
|
|
|
animate: true,
|
|
|
|
repeat: true,
|
|
|
|
),
|
2022-11-25 19:24:01 +00:00
|
|
|
),
|
2022-08-26 08:11:35 +00:00
|
|
|
),
|
2022-11-25 19:24:01 +00:00
|
|
|
// child: Image(
|
|
|
|
// image: AssetImage(
|
|
|
|
// Assets.png.splash,
|
|
|
|
// ),
|
|
|
|
// width: MediaQuery.of(context).size.width * 0.5,
|
|
|
|
// ),
|
2022-08-26 08:11:35 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|