mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-08-06 09:01:00 +08:00
refactor:文档、文章、组件收藏、新增webView
This commit is contained in:
@ -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);
|
||||
});
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user