اجعل التصميم هنا اكثر اناقة
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:sms_checker/welcome_screen.dart';

// تعريف الألوان الجديدة
const Color black = Color(0xFF000000);
const Color isabelline = Color(0xFFF4F1EC);
const Color darkGoldenrod = Color(0xFFC0913F);
const Color chocolate = Color(0xFF843700);
const Color gamboge = Color(0xFFEF9C00);

void main() {
  runApp(CompanySplashApp());
}

class CompanySplashApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Vibrafone App',
      theme: ThemeData(
        primarySwatch: MaterialColor(chocolate.value, {
          50: chocolate.withOpacity(0.1),
          100: chocolate.withOpacity(0.2),
          200: chocolate.withOpacity(0.3),
          300: chocolate.withOpacity(0.4),
          400: chocolate.withOpacity(0.5),
          500: chocolate.withOpacity(0.6),
          600: chocolate.withOpacity(0.7),
          700: chocolate.withOpacity(0.8),
          800: chocolate.withOpacity(0.9),
          900: chocolate.withOpacity(1.0),
        }),
        scaffoldBackgroundColor: isabelline,
        visualDensity: VisualDensity.adaptivePlatformDensity,
        fontFamily: 'Arial',
      ),
      home: CompanySplashPage(),
      debugShowCheckedModeBanner: false,
    );
  }
}

class CompanySplashPage extends StatefulWidget {
  @override
  _CompanySplashPageState createState() => _CompanySplashPageState();
}

class _CompanySplashPageState extends State<CompanySplashPage>
    with SingleTickerProviderStateMixin {
  late AnimationController _controller;
  late Animation<double> _opacityAnimation;
  late Animation<double> _scaleAnimation;
  late Animation<Offset> _slideAnimation;
  late Animation<Color?> _colorAnimation;

  @override
  void initState() {
    super.initState();

    _controller = AnimationController(
      vsync: this,
      duration: Duration(milliseconds: 1500),
    );

    _opacityAnimation = Tween<double>(
      begin: 0.0,
      end: 1.0,
    ).animate(CurvedAnimation(parent: _controller, curve: Curves.easeIn));

    _scaleAnimation = Tween<double>(begin: 0.8, end: 1.0).animate(
      CurvedAnimation(parent: _controller, curve: Curves.fastOutSlowIn),
    );

    _slideAnimation = Tween<Offset>(
      begin: Offset(0, 0.3),
      end: Offset.zero,
    ).animate(CurvedAnimation(parent: _controller, curve: Curves.easeOut));

    _colorAnimation = ColorTween(
      begin: gamboge.withOpacity(0.5),
      end: darkGoldenrod,
    ).animate(_controller);

    _controller.forward();

    Timer(Duration(seconds: 3), () {
      Navigator.of(context).pushReplacement(
        PageRouteBuilder(
          pageBuilder:
              (context, animation, secondaryAnimation) => SplashScreen(),
          transitionsBuilder: (context, animation, secondaryAnimation, child) {
            return FadeTransition(opacity: animation, child: child);
          },
          transitionDuration: Duration(milliseconds: 800),
        ),
      );
    });
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: isabelline,
      body: Center(
        child: AnimatedBuilder(
          animation: _controller,
          builder: (context, child) {
            return Opacity(
              opacity: _opacityAnimation.value,
              child: Transform.scale(
                scale: _scaleAnimation.value,
                child: child,
              ),
            );
          },
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              // شعار الشركة مع تأثيرات متحركة
              SlideTransition(
                position: _slideAnimation,
                child: AnimatedBuilder(
                  animation: _colorAnimation,
                  builder: (context, child) {
                    return Container(
                      decoration: BoxDecoration(
                        shape: BoxShape.circle,
                        boxShadow: [
                          BoxShadow(
                            color: _colorAnimation.value!.withOpacity(0.3),
                            blurRadius: 15,
                            spreadRadius: 5,
                          ),
                        ],
                        gradient: RadialGradient(
                          colors: [
                            _colorAnimation.value!.withOpacity(0.8),
                            _colorAnimation.value!,
                          ],
                          stops: [0.5, 1.0],
                        ),
                      ),
                      padding: EdgeInsets.all(10),
                      child: ClipRRect(
                        borderRadius: BorderRadius.circular(20),
                        child: Image.asset(
                          'assets/vibrafone_logo.png',
                          width: 150,
                          height: 150,
                          fit: BoxFit.contain,
                          color: isabelline,
                          colorBlendMode: BlendMode.darken,
                        ),
                      ),
                    );
                  },
                ),
              ),
              SizedBox(height: 30),
              // اسم الشركة مع تدرج لوني
              ShaderMask(
                shaderCallback:
                    (bounds) => LinearGradient(
                      colors: [chocolate, gamboge],
                      begin: Alignment.topLeft,
                      end: Alignment.bottomRight,
                    ).createShader(bounds),
                child: Text(
                  'Vibrafone',
                  style: TextStyle(
                    fontSize: 36,
                    fontWeight: FontWeight.bold,
                    color: Colors.white,
                    fontFamily: 'Arial',
                    shadows: [
                      Shadow(
                        color: black.withOpacity(0.3),
                        blurRadius: 4,
                        offset: Offset(2, 2),
                      ),
                    ],
                  ),
                ),
              ),
              SizedBox(height: 15),
              // وصف الشركة مع حدود أنيقة
              Container(
                padding: EdgeInsets.symmetric(horizontal: 24, vertical: 12),
                decoration: BoxDecoration(
                  border: Border(
                    bottom: BorderSide(color: darkGoldenrod, width: 2),
                  ),
                ),
                child: Text(
                  'الحلول الذكية للاتصالات\nوخدمات الجوال المبتكرة',
                  textAlign: TextAlign.center,
                  style: TextStyle(
                    fontSize: 16,
                    color: black.withOpacity(0.8),
                    height: 1.5,
                    fontFamily: 'Arial',
                  ),
                ),
              ),
              SizedBox(height: 40),
              // مؤشر تقدم
              SizedBox(
                width: 150,
                child: ClipRRect(
                  borderRadius: BorderRadius.circular(10),
                  child: AnimatedBuilder(
                    animation: _controller,
                    builder: (context, child) {
                      return LinearProgressIndicator(
                        minHeight: 8,
                        backgroundColor: gamboge.withOpacity(0.2),
                        valueColor: AlwaysStoppedAnimation<Color>(
                          ColorTween(
                            begin: chocolate,
                            end: gamboge,
                          ).evaluate(_controller)!,
                        ),
                        value: _controller.value,
                      );
                    },
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}