refactor:文档、文章、组件收藏、新增webView

This commit is contained in:
yifeng.yl
2019-01-14 20:07:22 +08:00
parent cdaaadc3f7
commit c796e82af2
12 changed files with 197 additions and 73 deletions

View File

@ -3,24 +3,32 @@ import 'package:fluro/fluro.dart';
import '../views/category.dart';
import '../widgets/404.dart';
import '../common/full_screen_code_dialog.dart';
import '../views/web_view_page.dart';
var categoryHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
String name = params["type"]?.first;
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
String name = params["type"]?.first;
return new CategoryHome(name);
},
);
return new CategoryHome(name);
},
);
var widgetNotFoundHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
return new WidgetNotFound();
}
);
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
return new WidgetNotFound();
});
var fullScreenCodeDialog = new Handler(
handlerFunc: (BuildContext context,Map<String, List<String>> params){
String path = params['filePath']?.first;
return new FullScreenCodeDialog(filePath: path,);
}
);
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
String path = params['filePath']?.first;
return new FullScreenCodeDialog(
filePath: path,
);
});
var webViewPageHand = new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
String title = params['title']?.first;
String url = params['url']?.first;
return new WebViewPage(url, title);
});

View File

@ -8,6 +8,7 @@ class Routes {
static String root = "/";
static String widgetDemo = '/widget-demo';
static String codeView = '/code-view';
static String webViewPage = '/web-view-page';
static void configureRoutes(Router router) {
List widgetDemosList = new WidgetDemoList().getDemos();
@ -19,6 +20,7 @@ class Routes {
router.define('/category/:type', handler: categoryHandler);
router.define('/category/error/404', handler: widgetNotFoundHandler);
router.define(codeView,handler:fullScreenCodeDialog);
router.define(webViewPage,handler:webViewPageHand);
widgetDemosList.forEach((demo) {
Handler handler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {