Wallpaper-Genie/lib/page/splash/splash_view.dart
xuhang-x 3bf5f4fa10 1
2024-07-26 18:41:05 +08:00

57 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:wallpaperx/generated/assets.dart';
import 'package:wallpaperx/page/splash/splash_controller.dart';
class SplashView extends StatelessWidget {
const SplashView({super.key});
@override
Widget build(BuildContext context) {
Get.put(SplashController());
return Scaffold(
body: Container(
decoration: const BoxDecoration(
color: Colors.black,
image: DecorationImage(
image: AssetImage(Assets.imagesSplashBackground),
fit: BoxFit.cover,
),
),
child: SafeArea(
child: _buildProgress(),
),
),
);
}
Widget _buildProgress() {
return Container(
alignment: Alignment.center,
margin: const EdgeInsets.only(bottom: 40).h,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
SizedBox(
width: 0.5.sw,
child: LinearProgressIndicator(
backgroundColor: Colors.grey,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
borderRadius: BorderRadius.circular(8).r,
),
),
14.verticalSpace,
Text(
'Resource Loading...',
style: TextStyle(
color: Colors.white,
fontSize: 12.sp,
),
),
],
),
);
}
}