import 'package:medora/data/services/navigation_service.dart';
import 'package:flutter/material.dart';

class SplashScreen extends StatefulWidget {
  const SplashScreen({super.key});

  @override
  State<SplashScreen> createState() => _SplashScreenState();
}

class _SplashScreenState extends State<SplashScreen> {
  @override
  void initState() {
    super.initState();
    Future.delayed(const Duration(seconds: 3), () {
      if (!mounted) return;
      _navigateToAppropriateScreen();
    });
  }

  Future<void> _navigateToAppropriateScreen() async {
    await NavigationService.handleUserNavigation(context);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        decoration: const BoxDecoration(
          image: DecorationImage(
            image: AssetImage('images/splash_screen.jpg'),
            fit: BoxFit.cover,
          ),
        ),
      ),
    );
  }
}
