Add initial project structure and configuration files for iOS and Android
This commit is contained in:
78
lib/config/routes.dart
Normal file
78
lib/config/routes.dart
Normal file
@@ -0,0 +1,78 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../features/auth/screens/login_screen.dart';
|
||||
// import '../features/auth/screens/forgot_password_screen.dart';
|
||||
// import '../features/auth/screens/register_screen.dart';
|
||||
import '../features/dashboard/screens/dashboard_screen.dart';
|
||||
// import '../features/accounts/screens/accounts_screen.dart';
|
||||
// import '../features/transactions/screens/transactions_screen.dart';
|
||||
// import '../features/payments/screens/payments_screen.dart';
|
||||
// import '../features/settings/screens/settings_screen.dart';
|
||||
|
||||
class AppRoutes {
|
||||
// Private constructor to prevent instantiation
|
||||
AppRoutes._();
|
||||
|
||||
// Route names
|
||||
static const String splash = '/';
|
||||
static const String login = '/login';
|
||||
static const String register = '/register';
|
||||
static const String forgotPassword = '/forgot-password';
|
||||
static const String dashboard = '/dashboard';
|
||||
static const String accounts = '/accounts';
|
||||
static const String transactions = '/transactions';
|
||||
static const String payments = '/payments';
|
||||
|
||||
// Route generator
|
||||
static Route<dynamic> generateRoute(RouteSettings settings) {
|
||||
switch (settings.name) {
|
||||
case login:
|
||||
return MaterialPageRoute(builder: (_) => const LoginScreen());
|
||||
|
||||
case register:
|
||||
// Placeholder - create the RegisterScreen class and uncomment
|
||||
// return MaterialPageRoute(builder: (_) => const RegisterScreen());
|
||||
return _errorRoute();
|
||||
|
||||
case forgotPassword:
|
||||
// Placeholder - create the ForgotPasswordScreen class and uncomment
|
||||
// return MaterialPageRoute(builder: (_) => const ForgotPasswordScreen());
|
||||
return _errorRoute();
|
||||
|
||||
case dashboard:
|
||||
return MaterialPageRoute(builder: (_) => const DashboardScreen());
|
||||
|
||||
case accounts:
|
||||
// Placeholder - create the AccountsScreen class and uncomment
|
||||
// return MaterialPageRoute(builder: (_) => const AccountsScreen());
|
||||
return _errorRoute();
|
||||
|
||||
case transactions:
|
||||
// Placeholder - create the TransactionsScreen class and uncomment
|
||||
// return MaterialPageRoute(builder: (_) => const TransactionsScreen());
|
||||
return _errorRoute();
|
||||
|
||||
case payments:
|
||||
// Placeholder - create the PaymentsScreen class and uncomment
|
||||
// return MaterialPageRoute(builder: (_) => const PaymentsScreen());
|
||||
return _errorRoute();
|
||||
|
||||
|
||||
default:
|
||||
return _errorRoute();
|
||||
}
|
||||
}
|
||||
|
||||
// Error route
|
||||
static Route<dynamic> _errorRoute() {
|
||||
return MaterialPageRoute(builder: (_) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Error'),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('Route not found!'),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user