forked from lxm_tools/flutter-picgo
feature:增加两个设置界面跳转
This commit is contained in:
17
lib/page/pb_setting.dart
Normal file
17
lib/page/pb_setting.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PBSettingPage extends StatelessWidget {
|
||||
|
||||
static const routeName = '/setting/pb';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('图床设置'),
|
||||
centerTitle: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
17
lib/page/picgo_setting.dart
Normal file
17
lib/page/picgo_setting.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PicGoSettingPage extends StatelessWidget {
|
||||
|
||||
static const routeName = '/setting/picgo';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('PicGo设置'),
|
||||
centerTitle: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:package_info/package_info.dart';
|
||||
|
||||
import '../route/route.dart';
|
||||
|
||||
class SettingPage extends StatefulWidget {
|
||||
static const routeName = '/setting';
|
||||
|
||||
@@ -64,9 +66,15 @@ class _SettingPageState extends State<SettingPage> {
|
||||
// 菜单列表
|
||||
ListTile(
|
||||
title: Text('图床设置'),
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, PBSettingPagePath);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: Text('PicGo设置'),
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, PicGoSettingPagePath);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -3,13 +3,24 @@ import 'package:flutter/material.dart';
|
||||
import '../page/main_tabs.dart';
|
||||
import '../page/album.dart';
|
||||
import '../page/setting.dart';
|
||||
import '../page/pb_setting.dart';
|
||||
import '../page/picgo_setting.dart';
|
||||
|
||||
final routes = {
|
||||
MainTabsPage.routeName: (BuildContext context) => MainTabsPage(),
|
||||
AlbumPage.routeName: (BuildContext context) => AlbumPage(),
|
||||
SettingPage.routeName: (BuildContext context) => SettingPage(),
|
||||
PBSettingPage.routeName: (BuildContext context) => PBSettingPage(),
|
||||
PicGoSettingPage.routeName: (BuildContext context) => PicGoSettingPage(),
|
||||
};
|
||||
|
||||
// path map
|
||||
const MainTabsPagePath = MainTabsPage.routeName;
|
||||
const AlbumPagePath = AlbumPage.routeName;
|
||||
const SettingPagePath = SettingPage.routeName;
|
||||
const PBSettingPagePath = PBSettingPage.routeName;
|
||||
const PicGoSettingPagePath = PicGoSettingPage.routeName;
|
||||
|
||||
/*
|
||||
* 实现命名路由传参
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user