mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 21:47:55 +00:00
42 lines
1.3 KiB
Dart
42 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_app/features/home/home_view.dart';
|
|
import 'package:syncrow_app/features/profile/profile_view.dart';
|
|
import 'package:syncrow_app/features/scene/scene_view.dart';
|
|
import 'package:syncrow_app/features/smart/smart_view.dart';
|
|
import 'package:syncrow_app/features/splash/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 HomePage(), settings: settings);
|
|
|
|
case Routes.profileRoute:
|
|
return MaterialPageRoute(
|
|
builder: (_) => const ProfilePage(), settings: settings);
|
|
|
|
case Routes.sceneRoute:
|
|
return MaterialPageRoute(
|
|
builder: (_) => const ScenePage(), settings: settings);
|
|
|
|
case Routes.smartRoute:
|
|
return MaterialPageRoute(
|
|
builder: (_) => const SmartPage(), settings: settings);
|
|
|
|
default:
|
|
return MaterialPageRoute(
|
|
builder: (_) => Scaffold(
|
|
body: Center(child: Text('No route defined for ${settings.name}')),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
}
|