- Add LoginScreen with form validation and error handling - Add Api.login() method with LoginResponse model - Add login route to AppRouter - Update SplashScreen to check auth status and route to login if needed - Store auth token in Api service for authenticated requests - Fix restaurant selection to work with authenticated users
23 lines
864 B
Dart
23 lines
864 B
Dart
import "package:flutter/material.dart";
|
|
|
|
import "../screens/login_screen.dart";
|
|
import "../screens/order_home_screen.dart";
|
|
import "../screens/restaurant_select_screen.dart";
|
|
import "../screens/service_point_select_screen.dart";
|
|
import "../screens/splash_screen.dart";
|
|
|
|
class AppRoutes {
|
|
static const String splash = "/";
|
|
static const String login = "/login";
|
|
static const String restaurantSelect = "/restaurants";
|
|
static const String servicePointSelect = "/service-points";
|
|
static const String orderHome = "/order";
|
|
|
|
static Map<String, WidgetBuilder> get routes => {
|
|
splash: (_) => const SplashScreen(),
|
|
login: (_) => const LoginScreen(),
|
|
restaurantSelect: (_) => const RestaurantSelectScreen(),
|
|
servicePointSelect: (_) => const ServicePointSelectScreen(),
|
|
orderHome: (_) => const OrderHomeScreen(),
|
|
};
|
|
}
|