Commit a761a6e2 authored by 余玠's avatar 余玠

remove the FlutterBoost "2" things which used to mark the new version temporaily

parent c9ebf0bb
PODS: PODS:
- Flutter (1.0.0) - Flutter (1.0.0)
- flutter_boost (0.0.1): - flutter_boost (0.0.2):
- Flutter - Flutter
DEPENDENCIES: DEPENDENCIES:
- Flutter (from `.symlinks/flutter/ios`) - Flutter (from `.symlinks/flutter/ios`)
- flutter_boost (from `/Users/wubian/flutter_boost2/ios`) - flutter_boost (from `/Users/yujie/Desktop/flutter/flutter_boost/ios`)
EXTERNAL SOURCES: EXTERNAL SOURCES:
Flutter: Flutter:
:path: ".symlinks/flutter/ios" :path: ".symlinks/flutter/ios"
flutter_boost: flutter_boost:
:path: "/Users/wubian/flutter_boost2/ios" :path: "/Users/yujie/Desktop/flutter/flutter_boost/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
flutter_boost: 584b569d153b3c3f3bfe48e043088af7ab9b1834 flutter_boost: 70a3494f98330364190073821d59dc5f9daf934c
PODFILE CHECKSUM: 2a757a7bdc03b37a2814666652fdff1cf694243f PODFILE CHECKSUM: 2a757a7bdc03b37a2814666652fdff1cf694243f
COCOAPODS: 1.6.0 COCOAPODS: 1.2.0
...@@ -180,6 +180,7 @@ ...@@ -180,6 +180,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
3FC74F80EA9D039C70D1F681 /* [CP] Embed Pods Frameworks */, 3FC74F80EA9D039C70D1F681 /* [CP] Embed Pods Frameworks */,
6CD183C8DCF5E8247072E2F6 /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
...@@ -269,7 +270,22 @@ ...@@ -269,7 +270,22 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
6CD183C8DCF5E8247072E2F6 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
...@@ -301,7 +317,7 @@ ...@@ -301,7 +317,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <flutter_boost/FlutterBoost2.h> #import <flutter_boost/FlutterBoost.h>
@interface AppDelegate : FLB2FlutterAppDelegate <UIApplicationDelegate> @interface AppDelegate : FLBFlutterAppDelegate <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) UIWindow *window;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#import "AppDelegate.h" #import "AppDelegate.h"
#import "UIViewControllerDemo.h" #import "UIViewControllerDemo.h"
#import "DemoRouter.h" #import "DemoRouter.h"
#import <flutter_boost/FlutterBoost2.h> #import <flutter_boost/FlutterBoost.h>
@interface AppDelegate () @interface AppDelegate ()
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{ {
DemoRouter *router = [DemoRouter sharedRouter]; DemoRouter *router = [DemoRouter sharedRouter];
[FlutterBoostPlugin2.sharedInstance startFlutterWithPlatform:router [FlutterBoostPlugin.sharedInstance startFlutterWithPlatform:router
onStart:^(FlutterEngine *fvc) { onStart:^(FlutterEngine *fvc) {
}]; }];
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
vc.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"hybrid" image:nil tag:0]; vc.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"hybrid" image:nil tag:0];
FLB2FlutterViewContainer *fvc = FLB2FlutterViewContainer.new; FLBFlutterViewContainer *fvc = FLBFlutterViewContainer.new;
[fvc setName:@"tab" params:@{}]; [fvc setName:@"tab" params:@{}];
fvc.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"flutter_tab" image:nil tag:1]; fvc.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"flutter_tab" image:nil tag:1];
......
...@@ -8,12 +8,13 @@ ...@@ -8,12 +8,13 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <flutter_boost/FlutterBoost2.h> #import <flutter_boost/FlutterBoost.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@protocol FLBPlatform;
@interface DemoRouter : NSObject<FLB2Platform> @interface DemoRouter : NSObject<FLBPlatform>
@property (nonatomic,strong) UINavigationController *navigationController; @property (nonatomic,strong) UINavigationController *navigationController;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// //
#import "DemoRouter.h" #import "DemoRouter.h"
#import <flutter_boost/FlutterBoost2.h> #import <flutter_boost/FlutterBoost.h>
@implementation DemoRouter @implementation DemoRouter
...@@ -21,12 +21,6 @@ ...@@ -21,12 +21,6 @@
return instance; return instance;
} }
//AB Boost 2 switch
- (BOOL)useBoost2
{
return YES;
}
#pragma mark - Boost 2 #pragma mark - Boost 2
- (void)open:(NSString *)name - (void)open:(NSString *)name
urlParams:(NSDictionary *)params urlParams:(NSDictionary *)params
...@@ -36,13 +30,13 @@ ...@@ -36,13 +30,13 @@
BOOL animated = [exts[@"animated"] boolValue]; BOOL animated = [exts[@"animated"] boolValue];
animated = YES; animated = YES;
if([params[@"present"] boolValue]){ if([params[@"present"] boolValue]){
FLB2FlutterViewContainer *vc = FLB2FlutterViewContainer.new; FLBFlutterViewContainer *vc = FLBFlutterViewContainer.new;
[vc setName:name params:params]; [vc setName:name params:params];
[self.navigationController presentViewController:vc animated:animated completion:^{ [self.navigationController presentViewController:vc animated:animated completion:^{
if(completion) completion(YES); if(completion) completion(YES);
}]; }];
}else{ }else{
FLB2FlutterViewContainer *vc = FLB2FlutterViewContainer.new; FLBFlutterViewContainer *vc = FLBFlutterViewContainer.new;
[vc setName:name params:params]; [vc setName:name params:params];
[self.navigationController pushViewController:vc animated:animated]; [self.navigationController pushViewController:vc animated:animated];
if(completion) completion(YES); if(completion) completion(YES);
...@@ -56,8 +50,8 @@ ...@@ -56,8 +50,8 @@
{ {
BOOL animated = [exts[@"animated"] boolValue]; BOOL animated = [exts[@"animated"] boolValue];
animated = YES; animated = YES;
FLB2FlutterViewContainer *vc = (id)self.navigationController.presentedViewController; FLBFlutterViewContainer *vc = (id)self.navigationController.presentedViewController;
if([vc isKindOfClass:FLB2FlutterViewContainer.class] && [vc.uniqueIDString isEqual: uid]){ if([vc isKindOfClass:FLBFlutterViewContainer.class] && [vc.uniqueIDString isEqual: uid]){
[vc dismissViewControllerAnimated:animated completion:^{}]; [vc dismissViewControllerAnimated:animated completion:^{}];
}else{ }else{
[self.navigationController popViewControllerAnimated:animated]; [self.navigationController popViewControllerAnimated:animated];
...@@ -70,44 +64,20 @@ ...@@ -70,44 +64,20 @@
animated:(BOOL)animated animated:(BOOL)animated
completion:(void (^)(BOOL))completion completion:(void (^)(BOOL))completion
{ {
if([self useBoost2]){ NSMutableDictionary *exts = NSMutableDictionary.new;
NSMutableDictionary *exts = NSMutableDictionary.new; exts[@"url"] = name;
exts[@"url"] = name; exts[@"params"] = params;
exts[@"params"] = params; exts[@"animated"] = @(animated);
exts[@"animated"] = @(animated); [self open:name urlParams:params exts:exts completion:completion];
[self open:name urlParams:params exts:exts completion:completion]; return;
return;
}
if([params[@"present"] boolValue]){
FLB2FlutterViewContainer *vc = FLB2FlutterViewContainer.new;
[vc setName:name params:params];
[self.navigationController presentViewController:vc animated:animated completion:^{
if(completion) completion(YES);
}];
}else{
FLB2FlutterViewContainer *vc = FLB2FlutterViewContainer.new;
[vc setName:name params:params];
[self.navigationController pushViewController:vc animated:animated];
if(completion) completion(YES);
}
} }
- (void)closePage:(NSString *)uid animated:(BOOL)animated params:(NSDictionary *)params completion:(void (^)(BOOL))completion - (void)closePage:(NSString *)uid animated:(BOOL)animated params:(NSDictionary *)params completion:(void (^)(BOOL))completion
{ {
if([self useBoost2]){ NSMutableDictionary *exts = NSMutableDictionary.new;
NSMutableDictionary *exts = NSMutableDictionary.new; exts[@"params"] = params;
exts[@"params"] = params; exts[@"animated"] = @(animated);
exts[@"animated"] = @(animated); [self close:uid result:@{} exts:exts completion:completion];
[self close:uid result:@{} exts:exts completion:completion]; return;
return;
}
FLB2FlutterViewContainer *vc = (id)self.navigationController.presentedViewController;
if([vc isKindOfClass:FLB2FlutterViewContainer.class] && [vc.uniqueIDString isEqual: uid]){
[vc dismissViewControllerAnimated:animated completion:^{}];
}else{
[self.navigationController popViewControllerAnimated:animated];
}
} }
@end @end
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#import "UIViewControllerDemo.h" #import "UIViewControllerDemo.h"
#import <Flutter/Flutter.h> #import <Flutter/Flutter.h>
#import "DemoRouter.h" #import "DemoRouter.h"
#import <flutter_boost/FlutterBoostPlugin2.h> #import <flutter_boost/FlutterBoostPlugin.h>
@interface UIViewControllerDemo () @interface UIViewControllerDemo ()
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface FLB2Factory : NSObject<FLBAbstractFactory> @interface FLBFactory : NSObject<FLBAbstractFactory>
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -22,20 +22,20 @@ ...@@ -22,20 +22,20 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#import "FLB2Factory.h" #import "FLBFactory.h"
#import "FLB2FlutterApplication.h" #import "FLBFlutterApplication.h"
#import "FLB2FlutterViewContainer.h" #import "FLBFlutterViewContainer.h"
@implementation FLB2Factory @implementation FLBFactory
- (id<FLBFlutterApplicationInterface>)createApplication:(id<FLB2Platform>)platform - (id<FLBFlutterApplicationInterface>)createApplication:(id<FLBPlatform>)platform
{ {
return FLB2FlutterApplication.new; return FLBFlutterApplication.new;
} }
- (id<FLBFlutterContainer>)createFlutterContainer - (id<FLBFlutterContainer>)createFlutterContainer
{ {
return FLB2FlutterViewContainer.new; return FLBFlutterViewContainer.new;
} }
@end @end
...@@ -24,12 +24,12 @@ ...@@ -24,12 +24,12 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <Flutter/Flutter.h> #import <Flutter/Flutter.h>
#import "FLB2Platform.h" #import "FLBPlatform.h"
#import "FLB2FlutterProvider.h" #import "FLBFlutterProvider.h"
#import "FLBFlutterApplicationInterface.h" #import "FLBFlutterApplicationInterface.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface FLB2FlutterApplication : NSObject<FLBFlutterApplicationInterface> @interface FLBFlutterApplication : NSObject<FLBFlutterApplicationInterface>
@property (nonatomic,strong) id<FLB2Platform> platform; @property (nonatomic,strong) id<FLBPlatform> platform;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -22,25 +22,25 @@ ...@@ -22,25 +22,25 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#import "FLB2FlutterApplication.h" #import "FLBFlutterApplication.h"
#import "FlutterBoost2.h" #import "FlutterBoost.h"
#import "FLB2FlutterContainerManager.h" #import "FLBFlutterContainerManager.h"
#import "FLB2FlutterEngine.h" #import "FLBFlutterEngine.h"
@interface FLB2FlutterApplication() @interface FLBFlutterApplication()
@property (nonatomic,strong) FLB2FlutterContainerManager *manager; @property (nonatomic,strong) FLBFlutterContainerManager *manager;
@property (nonatomic,strong) id<FLB2FlutterProvider> viewProvider; @property (nonatomic,strong) id<FLBFlutterProvider> viewProvider;
@property (nonatomic,assign) BOOL isRunning; @property (nonatomic,assign) BOOL isRunning;
@property (nonatomic,strong) NSMutableDictionary *pageResultCallbacks; @property (nonatomic,strong) NSMutableDictionary *pageResultCallbacks;
@property (nonatomic,strong) NSMutableDictionary *callbackCache; @property (nonatomic,strong) NSMutableDictionary *callbackCache;
@end @end
@implementation FLB2FlutterApplication @implementation FLBFlutterApplication
+ (FLB2FlutterApplication *)sharedApplication + (FLBFlutterApplication *)sharedApplication
{ {
static FLB2FlutterApplication *instance = nil; static FLBFlutterApplication *instance = nil;
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
instance = [self new]; instance = [self new];
...@@ -58,13 +58,13 @@ ...@@ -58,13 +58,13 @@
return _viewProvider; return _viewProvider;
} }
- (void)startFlutterWithPlatform:(id<FLB2Platform>)platform - (void)startFlutterWithPlatform:(id<FLBPlatform>)platform
onStart:(void (^)(id<FlutterBinaryMessenger,FlutterTextureRegistry,FlutterPluginRegistry> _Nonnull))callback onStart:(void (^)(id<FlutterBinaryMessenger,FlutterTextureRegistry,FlutterPluginRegistry> _Nonnull))callback
{ {
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
self.platform = platform; self.platform = platform;
self.viewProvider = [[FLB2FlutterEngine alloc] initWithPlatform:platform]; self.viewProvider = [[FLBFlutterEngine alloc] initWithPlatform:platform];
self.isRunning = YES; self.isRunning = YES;
if(callback) callback(self.viewProvider.engine); if(callback) callback(self.viewProvider.engine);
}); });
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
- (instancetype)init - (instancetype)init
{ {
if (self = [super init]) { if (self = [super init]) {
_manager = [FLB2FlutterContainerManager new]; _manager = [FLBFlutterContainerManager new];
_pageResultCallbacks = NSMutableDictionary.new; _pageResultCallbacks = NSMutableDictionary.new;
_callbackCache = NSMutableDictionary.new; _callbackCache = NSMutableDictionary.new;
......
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
*/ */
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "FLB2FlutterProvider.h" #import "FLBFlutterProvider.h"
#import "FLB2Platform.h" #import "FLBPlatform.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface FLB2FlutterEngine : NSObject<FLB2FlutterProvider> @interface FLBFlutterEngine : NSObject<FLBFlutterProvider>
- (instancetype)initWithPlatform:(id<FLB2Platform>)platform; - (instancetype)initWithPlatform:(id<FLBPlatform>)platform;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -22,20 +22,20 @@ ...@@ -22,20 +22,20 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#import "FLB2FlutterEngine.h" #import "FLBFlutterEngine.h"
#import <Flutter/Flutter.h> #import <Flutter/Flutter.h>
#import "FLB2FlutterViewContainer.h" #import "FLBFlutterViewContainer.h"
#import "BoostMessageChannel.h" #import "BoostMessageChannel.h"
@interface FLB2FlutterEngine() @interface FLBFlutterEngine()
@property (nonatomic,strong) FlutterEngine *engine; @property (nonatomic,strong) FlutterEngine *engine;
@property (nonatomic,strong) FLB2FlutterViewContainer *dummy; @property (nonatomic,strong) FLBFlutterViewContainer *dummy;
@end @end
@implementation FLB2FlutterEngine @implementation FLBFlutterEngine
- (instancetype)initWithPlatform:(id<FLB2Platform>)platform - (instancetype)initWithPlatform:(id<FLBPlatform>)platform
{ {
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks" #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
}else{ }else{
[_engine runWithEntrypoint:nil]; [_engine runWithEntrypoint:nil];
} }
_dummy = [[FLB2FlutterViewContainer alloc] initWithEngine:_engine _dummy = [[FLBFlutterViewContainer alloc] initWithEngine:_engine
nibName:nil nibName:nil
bundle:nil]; bundle:nil];
Class clazz = NSClassFromString(@"GeneratedPluginRegistrant"); Class clazz = NSClassFromString(@"GeneratedPluginRegistrant");
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
- (void)resume - (void)resume
{ {
[[_engine lifecycleChannel] sendMessage:@"AppLifecycleState.resumed"]; [[_engine lifecycleChannel] sendMessage:@"AppLifecycleState.resumed"];
[(FLB2FlutterViewContainer *)_engine.viewController surfaceUpdated:YES]; [(FLBFlutterViewContainer *)_engine.viewController surfaceUpdated:YES];
} }
- (void)inactive - (void)inactive
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#import "FLBFlutterContainer.h" #import "FLBFlutterContainer.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface FLB2FlutterViewContainer : FlutterViewController<FLBFlutterContainer> @interface FLBFlutterViewContainer : FlutterViewController<FLBFlutterContainer>
- (void)surfaceUpdated:(BOOL)appeared; - (void)surfaceUpdated:(BOOL)appeared;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -22,23 +22,23 @@ ...@@ -22,23 +22,23 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#import "FLB2FlutterViewContainer.h" #import "FLBFlutterViewContainer.h"
#import "FLB2FlutterApplication.h" #import "FLBFlutterApplication.h"
#import "BoostMessageChannel.h" #import "BoostMessageChannel.h"
#import "FLB2FlutterContainerManager.h" #import "FLBFlutterContainerManager.h"
#import "FlutterBoostPlugin2_private.h" #import "FlutterBoostPlugin_private.h"
#define FLUTTER_APP [FlutterBoostPlugin2 sharedInstance].application #define FLUTTER_APP [FlutterBoostPlugin sharedInstance].application
#define FLUTTER_VIEW FLUTTER_APP.flutterViewController.view #define FLUTTER_VIEW FLUTTER_APP.flutterViewController.view
#define FLUTTER_VC FLUTTER_APP.flutterViewController #define FLUTTER_VC FLUTTER_APP.flutterViewController
@interface FLB2FlutterViewContainer () @interface FLBFlutterViewContainer ()
@property (nonatomic,copy,readwrite) NSString *name; @property (nonatomic,copy,readwrite) NSString *name;
@property (nonatomic,strong,readwrite) NSDictionary *params; @property (nonatomic,strong,readwrite) NSDictionary *params;
@property (nonatomic,assign) long long identifier; @property (nonatomic,assign) long long identifier;
@end @end
@implementation FLB2FlutterViewContainer @implementation FLBFlutterViewContainer
- (instancetype)init - (instancetype)init
{ {
...@@ -173,10 +173,10 @@ static NSUInteger kInstanceCounter = 0; ...@@ -173,10 +173,10 @@ static NSUInteger kInstanceCounter = 0;
params:_params params:_params
uniqueId:self.uniqueIDString]; uniqueId:self.uniqueIDString];
//Save some first time page info. //Save some first time page info.
if(![FlutterBoostPlugin2 sharedInstance].fPagename){ if(![FlutterBoostPlugin sharedInstance].fPagename){
[FlutterBoostPlugin2 sharedInstance].fPagename = _name; [FlutterBoostPlugin sharedInstance].fPagename = _name;
[FlutterBoostPlugin2 sharedInstance].fPageId = self.uniqueIDString; [FlutterBoostPlugin sharedInstance].fPageId = self.uniqueIDString;
[FlutterBoostPlugin2 sharedInstance].fParams = _params; [FlutterBoostPlugin sharedInstance].fParams = _params;
} }
[super viewWillAppear:animated]; [super viewWillAppear:animated];
......
...@@ -22,14 +22,14 @@ ...@@ -22,14 +22,14 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#import "BoostChannel.h" #import "BoostChannel.h"
#import "FlutterBoost2.h" #import "FlutterBoost.h"
@implementation BoostChannel @implementation BoostChannel
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar { + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
[FlutterBoostPlugin2 registerWithRegistrar:registrar]; [FlutterBoostPlugin registerWithRegistrar:registrar];
} }
- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
[FlutterBoostPlugin2.sharedInstance handleMethodCall:call result:result]; [FlutterBoostPlugin.sharedInstance handleMethodCall:call result:result];
} }
@end @end
...@@ -25,14 +25,14 @@ ...@@ -25,14 +25,14 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "FLBFlutterApplicationInterface.h" #import "FLBFlutterApplicationInterface.h"
#import "FLB2FlutterProvider.h" #import "FLBFlutterProvider.h"
#import "FLB2Platform.h" #import "FLBPlatform.h"
#import "FLBFlutterContainer.h" #import "FLBFlutterContainer.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@protocol FLBAbstractFactory <NSObject> @protocol FLBAbstractFactory <NSObject>
@required @required
- (id<FLBFlutterApplicationInterface>)createApplication:(id<FLB2Platform>)platform; - (id<FLBFlutterApplicationInterface>)createApplication:(id<FLBPlatform>)platform;
- (id<FLBFlutterContainer>)createFlutterContainer; - (id<FLBFlutterContainer>)createFlutterContainer;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#import <Flutter/Flutter.h> #import <Flutter/Flutter.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface FLB2FlutterAppDelegate : FlutterAppDelegate @interface FLBFlutterAppDelegate : FlutterAppDelegate
// Returns the key window's rootViewController, if it's a FlutterViewController. // Returns the key window's rootViewController, if it's a FlutterViewController.
// Otherwise, returns nil. // Otherwise, returns nil.
- (FlutterViewController*)rootFlutterViewController; - (FlutterViewController*)rootFlutterViewController;
......
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#import "FLB2FlutterAppDelegate.h" #import "FLBFlutterAppDelegate.h"
#import "FlutterBoostPlugin2_private.h" #import "FlutterBoostPlugin_private.h"
@implementation FLB2FlutterAppDelegate @implementation FLBFlutterAppDelegate
// Returns the key window's rootViewController, if it's a FlutterViewController. // Returns the key window's rootViewController, if it's a FlutterViewController.
// Otherwise, returns nil. // Otherwise, returns nil.
- (FlutterViewController*)rootFlutterViewController { - (FlutterViewController*)rootFlutterViewController {
return FlutterBoostPlugin2.sharedInstance.application.flutterViewController; return FlutterBoostPlugin.sharedInstance.application.flutterViewController;
} }
@end @end
...@@ -23,18 +23,18 @@ ...@@ -23,18 +23,18 @@
*/ */
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <Flutter/Flutter.h> #import <Flutter/Flutter.h>
#import "FLB2Platform.h" #import "FLBPlatform.h"
#import "FlutterBoost2.h" #import "FlutterBoost.h"
#import "FLB2FlutterProvider.h" #import "FLBFlutterProvider.h"
#import "FLBFlutterContainer.h" #import "FLBFlutterContainer.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@protocol FLBFlutterApplicationInterface <NSObject> @protocol FLBFlutterApplicationInterface <NSObject>
@property (nonatomic,strong) id<FLB2Platform> platform; @property (nonatomic,strong) id<FLBPlatform> platform;
- (id<FLB2FlutterProvider>)flutterProvider; - (id<FLBFlutterProvider>)flutterProvider;
- (void)startFlutterWithPlatform:(id<FLB2Platform>)platform - (void)startFlutterWithPlatform:(id<FLBPlatform>)platform
onStart:(void (^)(id<FlutterBinaryMessenger, onStart:(void (^)(id<FlutterBinaryMessenger,
FlutterTextureRegistry, FlutterTextureRegistry,
FlutterPluginRegistry> engine))callback; FlutterPluginRegistry> engine))callback;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#import "FLBFlutterContainer.h" #import "FLBFlutterContainer.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface FLB2FlutterContainerManager : NSObject @interface FLBFlutterContainerManager : NSObject
- (NSString *)peak; - (NSString *)peak;
- (void)addUnique:(id<FLBFlutterContainer>)vc; - (void)addUnique:(id<FLBFlutterContainer>)vc;
......
...@@ -22,14 +22,14 @@ ...@@ -22,14 +22,14 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#import "FLB2FlutterContainerManager.h" #import "FLBFlutterContainerManager.h"
@interface FLB2FlutterContainerManager() @interface FLBFlutterContainerManager()
@property (nonatomic,strong) NSMutableArray *idStk; @property (nonatomic,strong) NSMutableArray *idStk;
@property (nonatomic,strong) NSMutableDictionary *existedID; @property (nonatomic,strong) NSMutableDictionary *existedID;
@end @end
@implementation FLB2FlutterContainerManager @implementation FLBFlutterContainerManager
- (instancetype)init - (instancetype)init
{ {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
@class FlutterEngine; @class FlutterEngine;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@protocol FLB2FlutterProvider <NSObject> @protocol FLBFlutterProvider <NSObject>
@required @required
- (FlutterEngine *)engine; - (FlutterEngine *)engine;
- (void)atacheToViewController:(FlutterViewController *)vc; - (void)atacheToViewController:(FlutterViewController *)vc;
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@protocol FLB2Platform <NSObject> @protocol FLBPlatform <NSObject>
@optional @optional
- (NSString *)entryForDart; - (NSString *)entryForDart;
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
#ifndef FlutterBoost_h #ifndef FlutterBoost_h
#define FlutterBoost_h #define FlutterBoost_h
#import "FlutterBoostPlugin2.h" #import "FlutterBoostPlugin.h"
#import "FLB2FlutterAppDelegate.h" #import "FLBFlutterAppDelegate.h"
#import "FLB2FlutterViewContainer.h" #import "FLBFlutterViewContainer.h"
#import "FLBTypes.h" #import "FLBTypes.h"
#endif /* FlutterBoost_h */ #endif /* FlutterBoost_h */
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
*/ */
#import <Flutter/Flutter.h> #import <Flutter/Flutter.h>
#import "FLB2Platform.h" #import "FLBPlatform.h"
#import "FLBTypes.h" #import "FLBTypes.h"
@interface FlutterBoostPlugin2 : NSObject<FlutterPlugin> @interface FlutterBoostPlugin : NSObject<FlutterPlugin>
#pragma mark - Initializer #pragma mark - Initializer
+ (instancetype)sharedInstance; + (instancetype)sharedInstance;
- (void)startFlutterWithPlatform:(id<FLB2Platform>)platform - (void)startFlutterWithPlatform:(id<FLBPlatform>)platform
onStart:(void (^)(id<FlutterBinaryMessenger, onStart:(void (^)(id<FlutterBinaryMessenger,
FlutterTextureRegistry, FlutterTextureRegistry,
FlutterPluginRegistry> engine))callback; FlutterPluginRegistry> engine))callback;
......
...@@ -22,24 +22,24 @@ ...@@ -22,24 +22,24 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#import "FlutterBoostPlugin2.h" #import "FlutterBoostPlugin.h"
#import "FlutterBoostPlugin2_private.h" #import "FlutterBoostPlugin_private.h"
#import "FLB2Factory.h" #import "FLBFactory.h"
#import "BoostMessageChannel.h" #import "BoostMessageChannel.h"
#import "FLBCollectionHelper.h" #import "FLBCollectionHelper.h"
#define NSNull2Nil(_x_) if([_x_ isKindOfClass: NSNull.class]) _x_ = nil; #define NSNull2Nil(_x_) if([_x_ isKindOfClass: NSNull.class]) _x_ = nil;
@interface FlutterBoostPlugin2() @interface FlutterBoostPlugin()
@end @end
@implementation FlutterBoostPlugin2 @implementation FlutterBoostPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar { + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
FlutterMethodChannel* channel = [FlutterMethodChannel FlutterMethodChannel* channel = [FlutterMethodChannel
methodChannelWithName:@"flutter_boost" methodChannelWithName:@"flutter_boost"
binaryMessenger:[registrar messenger]]; binaryMessenger:[registrar messenger]];
FlutterBoostPlugin2* instance = [self.class sharedInstance]; FlutterBoostPlugin* instance = [self.class sharedInstance];
instance.methodChannel = channel; instance.methodChannel = channel;
[registrar addMethodCallDelegate:instance channel:channel]; [registrar addMethodCallDelegate:instance channel:channel];
} }
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
NSNull2Nil(exts); NSNull2Nil(exts);
NSNull2Nil(resultData); NSNull2Nil(resultData);
NSNull2Nil(uid); NSNull2Nil(uid);
[[FlutterBoostPlugin2 sharedInstance].application close:uid [[FlutterBoostPlugin sharedInstance].application close:uid
result:resultData result:resultData
exts:exts exts:exts
completion:^(BOOL r){ completion:^(BOOL r){
...@@ -83,16 +83,16 @@ ...@@ -83,16 +83,16 @@
NSNull2Nil(url); NSNull2Nil(url);
NSNull2Nil(urlParams); NSNull2Nil(urlParams);
NSNull2Nil(exts); NSNull2Nil(exts);
[[FlutterBoostPlugin2 sharedInstance].application open:url [[FlutterBoostPlugin sharedInstance].application open:url
urlParams:urlParams urlParams:urlParams
exts:exts exts:exts
reult:result reult:result
completion:^(BOOL r) {}]; completion:^(BOOL r) {}];
}else if([@"pageOnStart" isEqualToString:call.method]){ }else if([@"pageOnStart" isEqualToString:call.method]){
NSMutableDictionary *pageInfo = [NSMutableDictionary new]; NSMutableDictionary *pageInfo = [NSMutableDictionary new];
pageInfo[@"name"] =[FlutterBoostPlugin2 sharedInstance].fPagename; pageInfo[@"name"] =[FlutterBoostPlugin sharedInstance].fPagename;
pageInfo[@"params"] = [FlutterBoostPlugin2 sharedInstance].fParams; pageInfo[@"params"] = [FlutterBoostPlugin sharedInstance].fParams;
pageInfo[@"uniqueId"] = [FlutterBoostPlugin2 sharedInstance].fPageId; pageInfo[@"uniqueId"] = [FlutterBoostPlugin sharedInstance].fPageId;
if(result) result(pageInfo); if(result) result(pageInfo);
}else{ }else{
result(FlutterMethodNotImplemented); result(FlutterMethodNotImplemented);
...@@ -123,14 +123,14 @@ ...@@ -123,14 +123,14 @@
return _factory; return _factory;
} }
- (void)startFlutterWithPlatform:(id<FLB2Platform>)platform - (void)startFlutterWithPlatform:(id<FLBPlatform>)platform
onStart:(void (^)(id<FlutterBinaryMessenger, onStart:(void (^)(id<FlutterBinaryMessenger,
FlutterTextureRegistry, FlutterTextureRegistry,
FlutterPluginRegistry> engine))callback; FlutterPluginRegistry> engine))callback;
{ {
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
self->_factory = FLB2Factory.new; self->_factory = FLBFactory.new;
self->_application = [self->_factory createApplication:platform]; self->_application = [self->_factory createApplication:platform];
[self->_application startFlutterWithPlatform:platform [self->_application startFlutterWithPlatform:platform
onStart:callback]; onStart:callback];
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
#import "FLBFlutterApplicationInterface.h" #import "FLBFlutterApplicationInterface.h"
#import "FLBAbstractFactory.h" #import "FLBAbstractFactory.h"
#import "FlutterBoostPlugin2.h" #import "FlutterBoostPlugin.h"
@interface FlutterBoostPlugin2(){ @interface FlutterBoostPlugin(){
id<FLBFlutterApplicationInterface> _application; id<FLBFlutterApplicationInterface> _application;
id<FLBAbstractFactory> _factory; id<FLBAbstractFactory> _factory;
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#import "BoostMessageChannel.h" #import "BoostMessageChannel.h"
#import "FlutterBoostPlugin2_private.h" #import "FlutterBoostPlugin_private.h"
@implementation BoostMessageChannel @implementation BoostMessageChannel
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
+ (FlutterMethodChannel *)methodChannel + (FlutterMethodChannel *)methodChannel
{ {
return FlutterBoostPlugin2.sharedInstance.methodChannel; return FlutterBoostPlugin.sharedInstance.methodChannel;
} }
+ (void)sendEvent:(NSString *)eventName + (void)sendEvent:(NSString *)eventName
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
} }
}]; }];
[FlutterBoostPlugin2.sharedInstance.application didInitPageContainer:pageName [FlutterBoostPlugin.sharedInstance.application didInitPageContainer:pageName
params:params params:params
uniqueId:uniqueId]; uniqueId:uniqueId];
} }
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
} }
}]; }];
[FlutterBoostPlugin2.sharedInstance.application willDeallocPageContainer:pageName [FlutterBoostPlugin.sharedInstance.application willDeallocPageContainer:pageName
params:params params:params
uniqueId:uniqueId]; uniqueId:uniqueId];
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'flutter_boost' s.name = 'flutter_boost'
s.version = '0.0.1' s.version = '0.0.2'
s.summary = 'A new Flutter plugin make flutter better to use!' s.summary = 'A new Flutter plugin make flutter better to use!'
s.description = <<-DESC s.description = <<-DESC
A new Flutter plugin make flutter better to use! A new Flutter plugin make flutter better to use!
...@@ -15,14 +15,14 @@ A new Flutter plugin make flutter better to use! ...@@ -15,14 +15,14 @@ A new Flutter plugin make flutter better to use!
s.source_files = 'Classes/**/*.{h,m,mm}' s.source_files = 'Classes/**/*.{h,m,mm}'
s.public_header_files = s.public_header_files =
'Classes/Boost/FlutterBoostPlugin2.h', 'Classes/Boost/FlutterBoostPlugin.h',
'Classes/Boost/FLB2Platform.h', 'Classes/Boost/FLBPlatform.h',
'Classes/Boost/FLBFlutterContainer.h', 'Classes/Boost/FLBFlutterContainer.h',
'Classes/Boost/FLB2FlutterAppDelegate.h', 'Classes/Boost/FLBFlutterAppDelegate.h',
'Classes/Boost/FLBTypes.h', 'Classes/Boost/FLBTypes.h',
'Classes/Boost/FlutterBoost2.h', 'Classes/Boost/FlutterBoost.h',
'Classes/Boost/BoostChannel.h', 'Classes/Boost/BoostChannel.h',
'Classes/1.5/FLB2FlutterViewContainer.h' 'Classes/1.5/FLBFlutterViewContainer.h'
s.dependency 'Flutter' s.dependency 'Flutter'
s.libraries = 'c++' s.libraries = 'c++'
......
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