1
0
Fork 0
mrtiboute/lib/classes/routes.dart

24 lines
602 B
Dart
Raw Normal View History

2022-03-31 21:34:28 +02:00
import 'package:desktopapp/widgets/pages/home.dart';
2022-03-30 21:37:32 +02:00
import 'package:desktopapp/widgets/pages/tutorial.dart';
import 'package:flutter/material.dart';
2022-03-31 21:34:28 +02:00
enum Routes { streamlabsTutorial, home }
2022-03-30 21:37:32 +02:00
2022-03-31 21:34:28 +02:00
extension RoutesExtension on Routes {
2022-03-30 21:37:32 +02:00
String get path {
switch (this) {
case Routes.streamlabsTutorial:
return '/streamlabs/tutorial';
2022-03-31 21:34:28 +02:00
case Routes.home:
return '/home';
2022-03-30 21:37:32 +02:00
}
}
}
var routes = <String, WidgetBuilder>{
2022-03-31 21:34:28 +02:00
Routes.streamlabsTutorial.path: (context) => TutorialPage(),
Routes.home.path: (context) => const HomePage(),
2022-03-30 21:37:32 +02:00
};
2022-03-31 22:04:57 +02:00
var initialRoute = Routes.home.path;