mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 09:45:22 +00:00
47 lines
1.5 KiB
Dart
47 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_app/features/auth/view/auth_view.dart';
|
|
import 'package:syncrow_app/features/home/view/home_view.dart';
|
|
import 'package:syncrow_app/features/profile/view/profile_view.dart';
|
|
import 'package:syncrow_app/features/scene/view/scene_view.dart';
|
|
import 'package:syncrow_app/features/smart/view/smart_view.dart';
|
|
import 'package:syncrow_app/features/splash/view/splash_view.dart';
|
|
|
|
import 'routing_constants.dart';
|
|
|
|
class Router {
|
|
static Route<dynamic> generateRoute(RouteSettings settings) {
|
|
switch (settings.name) {
|
|
case Routes.splash:
|
|
return MaterialPageRoute(
|
|
builder: (_) => const SplashView(), settings: settings);
|
|
|
|
case Routes.homeRoute:
|
|
return MaterialPageRoute(
|
|
builder: (_) => const HomeView(), settings: settings);
|
|
|
|
case Routes.profileRoute:
|
|
return MaterialPageRoute(
|
|
builder: (_) => const ProfileView(), settings: settings);
|
|
|
|
case Routes.sceneRoute:
|
|
return MaterialPageRoute(
|
|
builder: (_) => const SceneView(), settings: settings);
|
|
|
|
case Routes.smartRoute:
|
|
return MaterialPageRoute(
|
|
builder: (_) => const SmartPage(), settings: settings);
|
|
|
|
case Routes.authRoute:
|
|
return MaterialPageRoute(
|
|
builder: (_) => const AuthView(), settings: settings);
|
|
|
|
default:
|
|
return MaterialPageRoute(
|
|
builder: (_) => Scaffold(
|
|
body: Center(child: Text('No route defined for ${settings.name}')),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
}
|