import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../main.dart';
import '../routs/rout_name.dart';

class AuthGuard extends GetMiddleware {
  @override
  RouteSettings? redirect(String? route) {
    // Replace this check with your real logic (GetX storage, AuthController, etc)
    bool isLoggedIn = pref?.getBool('isLogin') ?? false;
    if (!isLoggedIn) {
      return const RouteSettings(name: RoutName.login);
    }
    return null; // Allow navigation if logged in
  }
}
