Commit dc9ee726 authored by Jidong Chen's avatar Jidong Chen

some fixs

parent 01e72797
......@@ -51,19 +51,18 @@ public class Broadcastor{
return ;
}
List<EvenListener> list = lists.get(name);
if(list == null){
return ;
}
String eventName = (String)arguments.get("name");
Map eventArguments = (Map)arguments.get("arguments");
List<EvenListener> list = lists.get(eventName);
if(list == null){
return ;
}
for(EvenListener l : list){
l.onEvent(eventName,eventArguments);
}
return ;
return;
}
public void addEventListener(String name , EvenListener listener){
......
......@@ -128,25 +128,20 @@ class FlutterBoost {
ContainerCoordinator.singleton.registerDefaultPageBuilder(builder);
}
///Register page builder for a key.
void registerPageBuilder(String pageName, PageBuilder builder) {
ContainerCoordinator.singleton.registerPageBuilder(pageName, builder);
}
///Register a map builders
void registerPageBuilders(Map<String, PageBuilder> builders) {
ContainerCoordinator.singleton.registerPageBuilders(builders);
}
Future<bool> openPage(String url, Map params,
Future<bool> openPage(String name, Map params,
{bool animated, PageResultHandler resultHandler}) {
return _router.openPage(url, params,
return _router.openPage(name, params,
animated: animated, resultHandler: resultHandler);
}
Future<bool> closePage(String url, String pageId, Map params,
Future<bool> closePage(String name, String pageId, Map params,
{bool animated}) {
return _router.closePage(url, pageId, params, animated: animated);
return _router.closePage(name, pageId, params, animated: animated);
}
//Close currentPage page.
......
......@@ -70,16 +70,18 @@ class Broadcastor{
}
Future<dynamic> handleCall(MethodCall call){
if(!_lists.containsKey(call.method) || call.method != "__event__"){
if(call.method != "__event__"){
return Future<dynamic>((){});
}
String name = call.arguments["name"];
Map arg = call.arguments["arguments"];
List<EventListener> list = _lists[call.method];
List<EventListener> list = _lists[name];
if(list != null){
for(EventListener l in list){
l(name,arg);
}
}
return Future<dynamic>((){});
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment