127 lines
4.7 KiB
Dart
Executable File
127 lines
4.7 KiB
Dart
Executable File
import 'package:sefer_driver/constant/box_name.dart';
|
|
import 'package:animated_text_kit/animated_text_kit.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:sefer_driver/constant/colors.dart';
|
|
import 'package:sefer_driver/constant/info.dart';
|
|
import 'package:sefer_driver/constant/style.dart';
|
|
|
|
import 'controller/home/splash_screen_controlle.dart';
|
|
import 'main.dart';
|
|
|
|
class SplashScreen extends StatelessWidget {
|
|
final SplashScreenController splashScreenController =
|
|
Get.put(SplashScreenController());
|
|
|
|
SplashScreen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
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,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
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),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
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,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|