mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-08-06 17:48:43 +08:00
添加收藏功能
This commit is contained in:
@ -8,6 +8,9 @@ import 'package:flutter_go/views/web_page/web_view_page.dart';
|
||||
import 'package:flutter_go/views/home.dart';
|
||||
import 'package:flutter_go/views/login_page/login_page.dart';
|
||||
import 'package:flutter_go/model/user_info.dart';
|
||||
import 'package:flutter_go/views/collection_page/collection_page.dart';
|
||||
import 'package:flutter_go/views/collection_page/collection_full_page.dart';
|
||||
|
||||
|
||||
// app的首页
|
||||
var homeHandler = new Handler(
|
||||
@ -16,6 +19,20 @@ var homeHandler = new Handler(
|
||||
},
|
||||
);
|
||||
|
||||
var collectionFullHandler = new Handler(
|
||||
handlerFunc: (BuildContext context,Map<String,List<String>> params){
|
||||
bool hasLogined = params['hasLogin']?.first == 'true';
|
||||
return CollectionFullPage(hasLogined: hasLogined);
|
||||
}
|
||||
);
|
||||
|
||||
var collectionHandler = new Handler(
|
||||
handlerFunc: (BuildContext context,Map<String,List<String>> params){
|
||||
bool hasLogined = params['hasLogin']?.first == 'true';
|
||||
return CollectionPage(hasLogined: hasLogined);
|
||||
}
|
||||
);
|
||||
|
||||
var categoryHandler = new Handler(
|
||||
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
|
||||
String name = params["type"]?.first;
|
||||
|
@ -13,6 +13,8 @@ class Routes {
|
||||
static String codeView = '/code-view';
|
||||
static String webViewPage = '/web-view-page';
|
||||
static String loginPage = '/loginpage';
|
||||
static String collectionPage = '/collection-page';
|
||||
static String collectionFullPage = '/collection-full-page';
|
||||
|
||||
static void configureRoutes(Router router) {
|
||||
List widgetDemosList = new WidgetDemoList().getDemos();
|
||||
@ -20,7 +22,8 @@ class Routes {
|
||||
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
|
||||
});
|
||||
router.define(home, handler: homeHandler);
|
||||
|
||||
router.define(collectionPage,handler:collectionHandler);
|
||||
router.define(collectionFullPage,handler:collectionFullHandler);
|
||||
router.define('/category/:type', handler: categoryHandler);
|
||||
router.define('/category/error/404', handler: widgetNotFoundHandler);
|
||||
router.define(loginPage, handler: loginPageHandler);
|
||||
|
Reference in New Issue
Block a user