This commit is contained in:
Hamza-Ayed
2024-12-24 17:55:20 +03:00
parent 0fc3ce010b
commit 7751866428
9 changed files with 280 additions and 171 deletions

View File

@@ -17,69 +17,109 @@ class SplashScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
// Get.put(LocationBackgroundController());
return Scaffold(
backgroundColor:
AppColor.secondaryColor, // Set your desired background color
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GetBuilder<SplashScreenController>(
builder: (_) {
return AnimatedBuilder(
animation: splashScreenController.animationController,
builder: (BuildContext context, Widget? child) {
return Transform.scale(
scale:
splashScreenController.animationController.value < 0.5
? splashScreenController.zoomInAnimation.value
: splashScreenController.zoomOutAnimation.value,
child: Image.asset(
'assets/images/logo.gif',
width: Get.width * .5,
body: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
AppColor.primaryColor,
// AppColor.primaryColor,
AppColor.secondaryColor,
AppColor.secondaryColor,
],
),
),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GetBuilder<SplashScreenController>(
builder: (_) {
return ScaleTransition(
scale: splashScreenController.animation,
child: FadeTransition(
opacity: splashScreenController.animation,
child: Column(
children: [
DefaultTextStyle(
style: AppStyle.headTitle.copyWith(
color: AppColor.primaryColor,
fontSize: 48,
fontWeight: FontWeight.bold,
),
child: AnimatedTextKit(
animatedTexts: [
WavyAnimatedText(
AppInformation.appName,
speed: const Duration(milliseconds: 200),
),
],
isRepeatingAnimation: false,
onFinished: () {
// Trigger any additional animations here
},
),
),
const SizedBox(height: 20),
DefaultTextStyle(
style: AppStyle.title.copyWith(
color: AppColor.writeColor.withOpacity(0.8),
fontSize: 18,
),
child: AnimatedTextKit(
animatedTexts: [
TyperAnimatedText(
'Your Journey Begins Here'.tr,
speed: const Duration(milliseconds: 100),
),
],
isRepeatingAnimation: false,
),
),
],
),
);
},
);
},
),
const SizedBox(
height: 30,
),
AnimatedTextKit(animatedTexts: [
TypewriterAnimatedText(
'Welcome to ${AppInformation.appName}',
textStyle:
AppStyle.headTitle2.copyWith(color: AppColor.writeColor),
speed: const Duration(milliseconds: 200),
),
);
},
),
], isRepeatingAnimation: true),
const SizedBox(
height: 20,
),
AnimatedTextKit(animatedTexts: [
TypewriterAnimatedText(
'Powered By ${AppInformation.appName}',
textStyle:
AppStyle.title.copyWith(color: AppColor.primaryColor),
speed: const Duration(milliseconds: 200),
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 40, vertical: 20),
child: Column(
children: [
Obx(() => LinearProgressIndicator(
value: splashScreenController.progress.value,
backgroundColor: AppColor.writeColor.withOpacity(0.2),
valueColor: AlwaysStoppedAnimation<Color>(
AppColor.primaryColor),
minHeight: 3,
)),
const SizedBox(height: 16),
Text(
'Version: ${box.read(BoxName.packagInfo) ?? '1.0.0'}',
style: AppStyle.subtitle.copyWith(
color: AppColor.writeColor.withOpacity(0.6),
),
),
const SizedBox(height: 20),
],
),
),
], isRepeatingAnimation: true),
const SizedBox(
height: 100,
),
],
],
),
),
),
bottomNavigationBar: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
box.read(BoxName.packagInfo) ?? '1.4.54',
style: AppStyle.subtitle,
bottomNavigationBar: Padding(
padding: const EdgeInsets.only(bottom: 16.0),
child: Text(
'Version: ${box.read(BoxName.packagInfo) ?? '1.0.0'}',
style: AppStyle.subtitle.copyWith(
color: AppColor.writeColor.withOpacity(0.6),
),
],
textAlign: TextAlign.center,
),
),
);
}