Commit b1b34f72 authored by Jidong Chen's avatar Jidong Chen

remove dart code xservice dependency

parent 7b58b614
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Alibaba Group
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import 'NavigationService.dart';
import '../handlers/NavigationService_onNativePageResult.dart';
import '../handlers/NavigationService_didShowPageContainer.dart';
import '../handlers/NavigationService_willShowPageContainer.dart';
import '../handlers/NavigationService_willDisappearPageContainer.dart';
import '../handlers/NavigationService_didDisappearPageContainer.dart';
import '../handlers/NavigationService_didInitPageContainer.dart';
import '../handlers/NavigationService_willDeallocPageContainer.dart';
class NavigationServiceRegister{
static register(){
NavigationService.regsiter();
NavigationService_onNativePageResult.regsiter();
NavigationService_didShowPageContainer.regsiter();
NavigationService_willShowPageContainer.regsiter();
NavigationService_willDisappearPageContainer.regsiter();
NavigationService_didDisappearPageContainer.regsiter();
NavigationService_didInitPageContainer.regsiter();
NavigationService_willDeallocPageContainer.regsiter();
}
}
\ No newline at end of file
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_boost/AIOService/NavigationService/service/NavigationService.dart'; import 'package:flutter_boost/messaging/service/navigation_service.dart';
import 'package:flutter_boost/container/boost_container.dart'; import 'package:flutter_boost/container/boost_container.dart';
import 'package:flutter_boost/flutter_boost.dart'; import 'package:flutter_boost/flutter_boost.dart';
import 'package:flutter_boost/messaging/native_page_container_event_handler.dart'; import 'package:flutter_boost/messaging/native_page_container_event_handler.dart';
...@@ -88,7 +88,7 @@ class ContainerCoordinator implements NativePageContainerEventHandler { ...@@ -88,7 +88,7 @@ class ContainerCoordinator implements NativePageContainerEventHandler {
void onChannelEvent(dynamic event) { void onChannelEvent(dynamic event) {
if (event is Map) { if (event is Map) {
Map map = event as Map; Map map = event;
final String type = map['type']; final String type = map['type'];
switch (type) { switch (type) {
...@@ -177,7 +177,7 @@ class ContainerCoordinator implements NativePageContainerEventHandler { ...@@ -177,7 +177,7 @@ class ContainerCoordinator implements NativePageContainerEventHandler {
FlutterBoost.containerManager?.remove(pageId); FlutterBoost.containerManager?.remove(pageId);
Logger.log( Logger.log(
'native containner dealloc, \nmanager dump:\n${FlutterBoost.containerManager?.dump()}'); 'native containner dealloc, \n manager dump:\n${FlutterBoost.containerManager?.dump()}');
return true; return true;
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart'; import 'package:flutter/scheduler.dart';
import 'package:flutter_boost/AIOService/NavigationService/service/NavigationService.dart'; import 'package:flutter_boost/messaging/service/navigation_service.dart';
import 'package:flutter_boost/container/boost_container.dart'; import 'package:flutter_boost/container/boost_container.dart';
import 'package:flutter_boost/container/container_coordinator.dart'; import 'package:flutter_boost/container/container_coordinator.dart';
import 'package:flutter_boost/flutter_boost.dart'; import 'package:flutter_boost/flutter_boost.dart';
......
...@@ -24,19 +24,26 @@ ...@@ -24,19 +24,26 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter_boost/messaging/service/navigation_service.dart';
import 'package:flutter_boost/AIOService/NavigationService/service/NavigationService.dart';
import 'package:flutter_boost/container/boost_container.dart'; import 'package:flutter_boost/container/boost_container.dart';
import 'package:flutter_boost/container/container_manager.dart'; import 'package:flutter_boost/container/container_manager.dart';
import 'package:flutter_boost/messaging/page_result_mediator.dart'; import 'package:flutter_boost/messaging/page_result_mediator.dart';
import 'package:flutter_boost/router/router.dart'; import 'package:flutter_boost/router/router.dart';
import 'AIOService/loader/ServiceLoader.dart';
import 'container/container_coordinator.dart'; import 'container/container_coordinator.dart';
import 'messaging/base/message_dispatcher.dart';
import 'messaging/handlers/did_disappear_page_container_handler.dart';
import 'messaging/handlers/did_show_page_container_handler.dart';
import 'messaging/handlers/did_init_page_container_handler.dart';
import 'messaging/handlers/on_native_page_result_handler.dart';
import 'messaging/handlers/will_dealloc_page_container_handler.dart';
import 'messaging/handlers/will_show_page_container_handler.dart';
import 'messaging/handlers/will_disappear_page_container_handler.dart';
import 'observers_holders.dart'; import 'observers_holders.dart';
export 'container/boost_container.dart'; export 'container/boost_container.dart';
export 'container/container_manager.dart'; export 'container/container_manager.dart';
import 'package:flutter/services.dart';
typedef Widget PageBuilder(String pageName, Map params, String uniqueId); typedef Widget PageBuilder(String pageName, Map params, String uniqueId);
...@@ -55,9 +62,25 @@ class FlutterBoost { ...@@ -55,9 +62,25 @@ class FlutterBoost {
final PageResultMediator _resultMediator = PageResultMediator(); final PageResultMediator _resultMediator = PageResultMediator();
final Router _router = Router(); final Router _router = Router();
final MethodChannel _methodChannel = MethodChannel('flutter_boost');
final MessageDispatcher _dispatcher = MessageDispatcher();
FlutterBoost() { FlutterBoost() {
_router.resultMediator = _resultMediator; _router.resultMediator = _resultMediator;
ServiceLoader.load();
//Config message handlers
NavigationService.methodChannel = _methodChannel;
_dispatcher.registerHandler(DidDisappearPageContainerHandler());
_dispatcher.registerHandler(DidInitPageContainerHandler());
_dispatcher.registerHandler(DidShowPageContainerHandler());
_dispatcher.registerHandler(OnNativePageResultHandler());
_dispatcher.registerHandler(WillDeallocPageContainerHandler());
_dispatcher.registerHandler(WillShowPageContainerHandler());
_dispatcher.registerHandler(WillDisappearPageContainerHandler());
_methodChannel.setMethodCallHandler((MethodCall call){
_dispatcher.dispatch(call);
});
} }
static FlutterBoost get singleton => _instance; static FlutterBoost get singleton => _instance;
......
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Alibaba Group
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import 'dart:async';
import 'package:flutter/services.dart';
import 'message_handler.dart';
class MessageDispatcher{
Map<String,MessageHandler> _handlers = Map();
Future<dynamic> dispatch(MethodCall call){
if(_handlers.containsKey(call.method)){
return _handlers[call.method].onMethodCall(call);
}{
return null;
}
}
void registerHandler(MessageHandler handler){
_handlers[handler.name()] = handler;
}
}
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (c) 2019 Alibaba Group * Copyright (c) 2019 Alibaba Group
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is * copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions: * furnished to do so, subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software. * all copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
...@@ -22,12 +22,10 @@ ...@@ -22,12 +22,10 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
import '../NavigationService/service/NavigationServiceRegister.dart'; import 'dart:async';
import 'package:flutter/services.dart';
class ServiceLoader{
abstract class MessageHandler{
static load(){ String name();
NavigationServiceRegister.register(); Future<dynamic> onMethodCall(MethodCall call);
} }
\ No newline at end of file
}
\ No newline at end of file
...@@ -25,24 +25,15 @@ import 'dart:async'; ...@@ -25,24 +25,15 @@ import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_boost/container/container_coordinator.dart'; import 'package:flutter_boost/container/container_coordinator.dart';
import 'package:xservice_kit/ServiceCallHandler.dart'; import 'package:flutter_boost/messaging/base/message_handler.dart';
import 'package:xservice_kit/ServiceGateway.dart';
class NavigationService_didDisappearPageContainer extends ServiceCallHandler { class DidDisappearPageContainerHandler implements MessageHandler {
static void regsiter() {
ServiceGateway.sharedInstance()
.registerHandler(new NavigationService_didDisappearPageContainer());
}
@override @override
String name() { String name() {
return "didDisappearPageContainer"; return "didDisappearPageContainer";
} }
@override
String service() {
return "NavigationService";
}
@override @override
Future<bool> onMethodCall(MethodCall call) { Future<bool> onMethodCall(MethodCall call) {
......
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:xservice_kit/ServiceCallHandler.dart';
import 'package:xservice_kit/ServiceGateway.dart';
import 'package:flutter_boost/container/container_coordinator.dart'; import 'package:flutter_boost/container/container_coordinator.dart';
class NavigationService_didInitPageContainer extends ServiceCallHandler { import 'package:flutter_boost/messaging/base/message_handler.dart';
class DidInitPageContainerHandler implements MessageHandler {
static void regsiter() { static void regsiter() {
ServiceGateway.sharedInstance() // ServiceGateway.sharedInstance()
.registerHandler(new NavigationService_didInitPageContainer()); // .registerHandler(new NavigationService_didInitPageContainer());
} }
@override @override
...@@ -39,10 +39,6 @@ class NavigationService_didInitPageContainer extends ServiceCallHandler { ...@@ -39,10 +39,6 @@ class NavigationService_didInitPageContainer extends ServiceCallHandler {
return "didInitPageContainer"; return "didInitPageContainer";
} }
@override
String service() {
return "NavigationService";
}
@override @override
Future<bool> onMethodCall(MethodCall call) { Future<bool> onMethodCall(MethodCall call) {
......
...@@ -25,25 +25,15 @@ import 'dart:async'; ...@@ -25,25 +25,15 @@ import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_boost/container/container_coordinator.dart'; import 'package:flutter_boost/container/container_coordinator.dart';
import 'package:xservice_kit/ServiceCallHandler.dart'; import 'package:flutter_boost/messaging/base/message_handler.dart';
import 'package:xservice_kit/ServiceGateway.dart';
class NavigationService_didShowPageContainer extends ServiceCallHandler { class DidShowPageContainerHandler implements MessageHandler {
static void regsiter() {
ServiceGateway.sharedInstance()
.registerHandler(new NavigationService_didShowPageContainer());
}
@override @override
String name() { String name() {
return "didShowPageContainer"; return "didShowPageContainer";
} }
@override
String service() {
return "NavigationService";
}
@override @override
Future<bool> onMethodCall(MethodCall call) { Future<bool> onMethodCall(MethodCall call) {
return onCall(call.arguments["pageName"], call.arguments["params"], return onCall(call.arguments["pageName"], call.arguments["params"],
......
...@@ -24,26 +24,17 @@ ...@@ -24,26 +24,17 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:xservice_kit/ServiceCallHandler.dart';
import 'package:xservice_kit/ServiceGateway.dart';
import 'package:flutter_boost/flutter_boost.dart'; import 'package:flutter_boost/flutter_boost.dart';
class NavigationService_onNativePageResult extends ServiceCallHandler { import 'package:flutter_boost/messaging/base/message_handler.dart';
static void regsiter() { class OnNativePageResultHandler implements MessageHandler {
ServiceGateway.sharedInstance().registerHandler(new NavigationService_onNativePageResult());
}
@override @override
String name() { String name() {
return "onNativePageResult"; return "onNativePageResult";
} }
@override
String service() {
return "NavigationService";
}
@override @override
Future<bool> onMethodCall(MethodCall call) { Future<bool> onMethodCall(MethodCall call) {
return onCall(call.arguments["uniqueId"],call.arguments["key"],call.arguments["resultData"],call.arguments["params"]); return onCall(call.arguments["uniqueId"],call.arguments["key"],call.arguments["resultData"],call.arguments["params"]);
......
...@@ -25,25 +25,14 @@ import 'dart:async'; ...@@ -25,25 +25,14 @@ import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_boost/container/container_coordinator.dart'; import 'package:flutter_boost/container/container_coordinator.dart';
import 'package:xservice_kit/ServiceCallHandler.dart'; import 'package:flutter_boost/messaging/base/message_handler.dart';
import 'package:xservice_kit/ServiceGateway.dart';
class NavigationService_willDeallocPageContainer extends ServiceCallHandler {
static void regsiter() {
ServiceGateway.sharedInstance()
.registerHandler(new NavigationService_willDeallocPageContainer());
}
class WillDeallocPageContainerHandler implements MessageHandler {
@override @override
String name() { String name() {
return "willDeallocPageContainer"; return "willDeallocPageContainer";
} }
@override
String service() {
return "NavigationService";
}
@override @override
Future<bool> onMethodCall(MethodCall call) { Future<bool> onMethodCall(MethodCall call) {
return onCall(call.arguments["pageName"], call.arguments["params"], return onCall(call.arguments["pageName"], call.arguments["params"],
......
...@@ -25,25 +25,15 @@ import 'dart:async'; ...@@ -25,25 +25,15 @@ import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_boost/container/container_coordinator.dart'; import 'package:flutter_boost/container/container_coordinator.dart';
import 'package:xservice_kit/ServiceCallHandler.dart'; import 'package:flutter_boost/messaging/base/message_handler.dart';
import 'package:xservice_kit/ServiceGateway.dart';
class NavigationService_willDisappearPageContainer extends ServiceCallHandler { class WillDisappearPageContainerHandler implements MessageHandler {
static void regsiter() {
ServiceGateway.sharedInstance()
.registerHandler(new NavigationService_willDisappearPageContainer());
}
@override @override
String name() { String name() {
return "willDisappearPageContainer"; return "willDisappearPageContainer";
} }
@override
String service() {
return "NavigationService";
}
@override @override
Future<bool> onMethodCall(MethodCall call) { Future<bool> onMethodCall(MethodCall call) {
return onCall(call.arguments["pageName"], call.arguments["params"], return onCall(call.arguments["pageName"], call.arguments["params"],
......
...@@ -25,25 +25,15 @@ import 'dart:async'; ...@@ -25,25 +25,15 @@ import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_boost/container/container_coordinator.dart'; import 'package:flutter_boost/container/container_coordinator.dart';
import 'package:xservice_kit/ServiceCallHandler.dart'; import 'package:flutter_boost/messaging/base/message_handler.dart';
import 'package:xservice_kit/ServiceGateway.dart';
class NavigationService_willShowPageContainer extends ServiceCallHandler { class WillShowPageContainerHandler implements MessageHandler {
static void regsiter() {
ServiceGateway.sharedInstance()
.registerHandler(new NavigationService_willShowPageContainer());
}
@override @override
String name() { String name() {
return "willShowPageContainer"; return "willShowPageContainer";
} }
@override
String service() {
return "NavigationService";
}
@override @override
Future<bool> onMethodCall(MethodCall call) { Future<bool> onMethodCall(MethodCall call) {
return onCall(call.arguments["pageName"], call.arguments["params"], return onCall(call.arguments["pageName"], call.arguments["params"],
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
import 'package:flutter_boost/AIOService/NavigationService/service/NavigationService.dart'; import 'package:flutter_boost/messaging/service/navigation_service.dart';
import 'dart:async'; import 'dart:async';
abstract class MessageProxy{ abstract class MessageProxy{
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
import 'package:flutter_boost/support/logger.dart'; import 'package:flutter_boost/support/logger.dart';
import 'package:flutter_boost/AIOService/NavigationService/service/NavigationService.dart'; import 'package:flutter_boost/messaging/service/navigation_service.dart';
typedef void PageResultHandler(String key , Map<String,dynamic> result); typedef void PageResultHandler(String key , Map<String,dynamic> result);
typedef VoidCallback = void Function(); typedef VoidCallback = void Function();
......
...@@ -22,34 +22,30 @@ ...@@ -22,34 +22,30 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
import 'dart:async'; import 'dart:async';
import 'package:xservice_kit/foundation_ext/foundation_ext.dart'; import 'package:flutter/services.dart';
import 'package:xservice_kit/ServiceTemplate.dart';
import 'package:xservice_kit/ServiceGateway.dart';
class NavigationService {
class NavigationService {
static MethodChannel methodChannel;
static final ServiceTemplate _service =
new ServiceTemplate("NavigationService");
static void regsiter() {
ServiceGateway.sharedInstance().registerService(_service);
}
//List event from event channel. //List event from event channel.
static int listenEvent(void onData(dynamic event)) { static int listenEvent(void onData(dynamic event)) {
return _service.listenEvent(onData); // return _service.listenEvent(onData);
} }
//Cancel event for subscription with ID. //Cancel event for subscription with ID.
static void cancelEventForSubscription(int subID) { static void cancelEventForSubscription(int subID) {
_service.cancelEventForSubscription(subID); // _service.cancelEventForSubscription(subID);
} }
static Future<bool> onShownContainerChanged(String newName,String oldName,Map params) { static Future<bool> onShownContainerChanged(String newName,String oldName,Map params) {
Map<String,dynamic> properties = new Map<String,dynamic>(); Map<String,dynamic> properties = new Map<String,dynamic>();
properties["newName"]=newName; properties["newName"]=newName;
properties["oldName"]=oldName; properties["oldName"]=oldName;
properties["params"]=params; properties["params"]=params;
return _service.methodChannel().invokeMethod('onShownContainerChanged',properties).then<bool>((value){ return methodChannel.invokeMethod('onShownContainerChanged',properties).then<bool>((value){
return BOOL(value); return (value);
}); });
} }
static Future<bool> onFlutterPageResult(String uniqueId,String key,Map resultData,Map params) { static Future<bool> onFlutterPageResult(String uniqueId,String key,Map resultData,Map params) {
...@@ -58,15 +54,15 @@ ...@@ -58,15 +54,15 @@
properties["key"]=key; properties["key"]=key;
properties["resultData"]=resultData; properties["resultData"]=resultData;
properties["params"]=params; properties["params"]=params;
return _service.methodChannel().invokeMethod('onFlutterPageResult',properties).then<bool>((value){ return methodChannel.invokeMethod('onFlutterPageResult',properties).then<bool>((value){
return BOOL(value); return (value);
}); });
} }
static Future<Map> pageOnStart(Map params) async { static Future<Map> pageOnStart(Map params) async {
Map<String,dynamic> properties = new Map<String,dynamic>(); Map<String,dynamic> properties = new Map<String,dynamic>();
properties["params"]=params; properties["params"]=params;
try { try {
return await _service.methodChannel().invokeMethod('pageOnStart',properties).then<Map>((value){ return await methodChannel.invokeMethod('pageOnStart',properties).then<Map>((value){
return value as Map; return value as Map;
}); });
} catch (e) { } catch (e) {
...@@ -79,8 +75,8 @@ ...@@ -79,8 +75,8 @@
properties["pageName"]=pageName; properties["pageName"]=pageName;
properties["params"]=params; properties["params"]=params;
properties["animated"]=animated; properties["animated"]=animated;
return _service.methodChannel().invokeMethod('openPage',properties).then<bool>((value){ return methodChannel.invokeMethod('openPage',properties).then<bool>((value){
return BOOL(value); return (value);
}); });
} }
static Future<bool> closePage(String uniqueId,String pageName,Map params,bool animated) { static Future<bool> closePage(String uniqueId,String pageName,Map params,bool animated) {
...@@ -89,8 +85,8 @@ ...@@ -89,8 +85,8 @@
properties["pageName"]=pageName; properties["pageName"]=pageName;
properties["params"]=params; properties["params"]=params;
properties["animated"]=animated; properties["animated"]=animated;
return _service.methodChannel().invokeMethod('closePage',properties).then<bool>((value){ return methodChannel.invokeMethod('closePage',properties).then<bool>((value){
return BOOL(value); return value;
}); });
} }
} }
\ No newline at end of file
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