141 lines
5.9 KiB
Dart
141 lines
5.9 KiB
Dart
import 'package:animated_text_kit/animated_text_kit.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:shimmer/shimmer.dart'; // Added for a premium shimmer effect
|
|
import 'package:Intaleq/constant/colors.dart';
|
|
import 'package:Intaleq/constant/info.dart';
|
|
import 'package:Intaleq/constant/style.dart';
|
|
|
|
import 'constant/box_name.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) {
|
|
// Using SafeArea to prevent UI overlap with system notches or bars
|
|
return SafeArea(
|
|
child: Scaffold(
|
|
body: Container(
|
|
// The gradient background is maintained from your original design.
|
|
decoration: const BoxDecoration(
|
|
gradient: LinearGradient(
|
|
begin: Alignment.topCenter,
|
|
end: Alignment.bottomCenter,
|
|
colors: [
|
|
AppColor.primaryColor,
|
|
AppColor.secondaryColor,
|
|
],
|
|
),
|
|
),
|
|
// Using a Stack to layer the main content and the footer.
|
|
child: Stack(
|
|
children: [
|
|
// Main animated content (logo and titles) centered on the screen.
|
|
Center(
|
|
child: GetBuilder<SplashScreenController>(
|
|
builder: (_) {
|
|
// The initial animation is preserved for the overall entrance
|
|
return ScaleTransition(
|
|
scale: splashScreenController.animation,
|
|
child: FadeTransition(
|
|
opacity: splashScreenController.animation,
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
// Logo remains the same
|
|
Image.asset(
|
|
'assets/images/logo.gif',
|
|
width: Get.width * 0.35,
|
|
),
|
|
const SizedBox(height: 24),
|
|
// IMPROVEMENT: Added a Shimmer effect for a more dynamic title
|
|
Shimmer.fromColors(
|
|
baseColor: AppColor.writeColor,
|
|
highlightColor: Colors.grey.shade400,
|
|
child: Text(
|
|
AppInformation.appName,
|
|
style: AppStyle.headTitle.copyWith(
|
|
color: AppColor.writeColor,
|
|
fontSize: 48,
|
|
fontWeight: FontWeight.bold,
|
|
shadows: [
|
|
const Shadow(
|
|
blurRadius: 10.0,
|
|
color: Colors.black26,
|
|
offset: Offset(2.0, 2.0),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(height: 12),
|
|
// IMPROVEMENT: Using AnimatedTextKit for an engaging tagline
|
|
AnimatedTextKit(
|
|
animatedTexts: [
|
|
TyperAnimatedText(
|
|
'Your Journey Begins Here'.tr,
|
|
textStyle: AppStyle.title.copyWith(
|
|
color: AppColor.writeColor.withOpacity(0.8),
|
|
fontSize: 18,
|
|
),
|
|
speed: const Duration(milliseconds: 100),
|
|
),
|
|
],
|
|
isRepeatingAnimation: false,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
|
|
// Footer section for progress bar and version info.
|
|
Align(
|
|
alignment: Alignment.bottomCenter,
|
|
child: Padding(
|
|
padding:
|
|
const EdgeInsets.only(bottom: 40.0, left: 40, right: 40),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
// Using ClipRRect for cleaner rounded corners on the progress bar
|
|
ClipRRect(
|
|
borderRadius: BorderRadius.circular(10),
|
|
child: Obx(() => LinearProgressIndicator(
|
|
value: splashScreenController.progress.value,
|
|
backgroundColor:
|
|
AppColor.writeColor.withOpacity(0.2),
|
|
valueColor: const AlwaysStoppedAnimation<Color>(
|
|
AppColor.writeColor),
|
|
minHeight:
|
|
5, // Slightly thicker for better visibility
|
|
)),
|
|
),
|
|
const SizedBox(height: 20),
|
|
Text(
|
|
'Version: ${box.read(BoxName.packagInfo) ?? '1.0.0'}',
|
|
style: AppStyle.subtitle.copyWith(
|
|
color: AppColor.writeColor.withOpacity(0.7),
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|