import '../global.css';
import { AuthProvider } from '@/utils/authContext';
import { Stack } from 'expo-router';
import { AlertProvider } from '@/components/AlertComponent';
import { NetworkProvider } from '@/utils/networkProvider';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { KeyboardProvider } from "react-native-keyboard-controller";

export default function AppLayout() {
    return (
        <SafeAreaProvider>
            <KeyboardProvider>
                <NetworkProvider>
                    <AuthProvider>
                        <AlertProvider>
                            <Stack screenOptions={{ headerShown: false, animation: 'flip' }}>
                                <Stack.Screen name="(protected)" />
                                <Stack.Screen name="login" />
                            </Stack>
                        </AlertProvider>
                    </AuthProvider>
                </NetworkProvider>
            </KeyboardProvider>
        </SafeAreaProvider>
    );
}