Fügt grundlegendes Routing mit Routemaster hinzu und ersetzt MyApp-Struktur
This commit is contained in:
21
lib/Services/router_service.dart
Normal file
21
lib/Services/router_service.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:routemaster/routemaster.dart';
|
||||
|
||||
import '../Pages/Dashboard/dashboard.dart';
|
||||
import '../Pages/Settings/settings.dart';
|
||||
import '../Pages/Trend/trend.dart';
|
||||
import '../Pages/home_page.dart';
|
||||
|
||||
class RouterService {
|
||||
static final RouteMap routes = RouteMap(
|
||||
routes: {
|
||||
'/': (_) => TabPage(
|
||||
child: HomePage(),
|
||||
paths: const <String>['/dashboard', '/trend', '/settings'],
|
||||
),
|
||||
'/dashboard': (_) => MaterialPage(child: Dashboard()),
|
||||
'/trend': (_) => MaterialPage(child: Trend()),
|
||||
'/settings': (_) => MaterialPage(child: Settings()),
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user