2022-08-26 08:11:35 +00:00
|
|
|
import 'dart:math';
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:lottie/lottie.dart';
|
|
|
|
import 'package:stackwallet/utilities/assets.dart';
|
2023-02-23 17:25:32 +00:00
|
|
|
import 'package:stackwallet/utilities/theme/color_theme.dart';
|
2022-09-22 23:48:50 +00:00
|
|
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
2022-11-25 19:24:01 +00:00
|
|
|
import 'package:stackwallet/widgets/background.dart';
|
2023-02-23 17:25:32 +00:00
|
|
|
import 'package:stackwallet/widgets/conditional_parent.dart';
|
|
|
|
import 'package:stackwallet/widgets/rounded_container.dart';
|
2022-08-26 08:11:35 +00:00
|
|
|
|
|
|
|
class LoadingView extends StatelessWidget {
|
|
|
|
const LoadingView({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
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
|
|
|
|
|
|
|
final isChan = Theme.of(context).extension<StackColors>()!.themeType ==
|
|
|
|
ThemeType.chan ||
|
|
|
|
Theme.of(context).extension<StackColors>()!.themeType ==
|
|
|
|
ThemeType.darkChans;
|
|
|
|
|
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(
|
|
|
|
condition:
|
|
|
|
Theme.of(context).extension<StackColors>()!.themeType ==
|
|
|
|
ThemeType.oledBlack,
|
|
|
|
builder: (child) => RoundedContainer(
|
|
|
|
color: const Color(0xFFDEDEDE),
|
|
|
|
radiusMultiplier: 100,
|
|
|
|
width: width * 1.35,
|
|
|
|
height: width * 1.35,
|
|
|
|
child: child,
|
|
|
|
),
|
|
|
|
child: SizedBox(
|
|
|
|
width: width,
|
2023-03-21 15:29:58 +00:00
|
|
|
child: isChan
|
|
|
|
? Image(
|
|
|
|
image: AssetImage(
|
|
|
|
Assets.gif.stacyPlain,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
: 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
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|