第一次提交
This commit is contained in:
21
lib/routes/index.dart
Normal file
21
lib/routes/index.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
// 管理路由
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mydearest/pages/main/index.dart';
|
||||
import 'package:mydearest/pages/login/index.dart';
|
||||
|
||||
// 返回APP根组件
|
||||
Widget getRootWidget() {
|
||||
return MaterialApp(
|
||||
routes: getRootRoutes(),
|
||||
);
|
||||
// 真正的项目都是使用的命名路由
|
||||
}
|
||||
|
||||
// 返回路由表
|
||||
Map<String, Widget Function(BuildContext)> getRootRoutes() {
|
||||
return {
|
||||
"/": (context) => MainPage(), // 主页路由
|
||||
"/login": (context) => LoginPage(), // 登录页路由
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user