fix: 添加 Flutter 路由配置
- 添加 initialRoute 和命名路由配置 - 配置 /、/login、/main 路由 - 修复首页路由缺失问题
This commit is contained in:
@@ -115,6 +115,12 @@ class MyApp extends StatelessWidget {
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
],
|
||||
builder: (context, child) => ShadAppBuilder(child: child!),
|
||||
initialRoute: '/',
|
||||
routes: {
|
||||
'/': (context) => _buildHome(),
|
||||
'/login': (context) => const LoginPage(),
|
||||
'/main': (context) => const MainPage(),
|
||||
},
|
||||
home: _buildHome(),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user