Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flutter_boost_1.22.4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
flutter_boost_1.22.4
Commits
dd87a8bf
Commit
dd87a8bf
authored
Oct 15, 2019
by
余玠
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/flutter_1.9_upgrade
parents
368ae69d
87a43534
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
76 additions
and
47 deletions
+76
-47
example/ios/Runner/Base.lproj/Main.storyboard
example/ios/Runner/Base.lproj/Main.storyboard
+3
-22
example_swift/ios/Flutter/AppFrameworkInfo.plist
example_swift/ios/Flutter/AppFrameworkInfo.plist
+26
-0
example_swift/ios/Flutter/Debug.xcconfig
example_swift/ios/Flutter/Debug.xcconfig
+2
-0
example_swift/ios/Flutter/Release.xcconfig
example_swift/ios/Flutter/Release.xcconfig
+2
-0
ios/Classes/Boost/FlutterBoostPlugin.h
ios/Classes/Boost/FlutterBoostPlugin.h
+13
-0
ios/Classes/Engine/FLBFlutterEngine.m
ios/Classes/Engine/FLBFlutterEngine.m
+4
-6
ios/Classes/Messaging/BoostMessageChannel.h
ios/Classes/Messaging/BoostMessageChannel.h
+6
-1
ios/Classes/container/FLBFlutterViewContainer.m
ios/Classes/container/FLBFlutterViewContainer.m
+20
-18
No files found.
example/ios/Runner/Base.lproj/Main.storyboard
View file @
dd87a8bf
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"144
60.31"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
initialViewController=
"BYZ-38-t0r
"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"144
90.70"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES
"
>
<device
id=
"retina4_7"
orientation=
"portrait"
>
<device
id=
"retina4_7"
orientation=
"portrait"
>
<adaptation
id=
"fullscreen"
/>
<adaptation
id=
"fullscreen"
/>
</device>
</device>
<dependencies>
<dependencies>
<deployment
identifier=
"iOS"
/>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"14460.20"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"14490.49"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
</dependencies>
<scenes>
<scenes/>
<!--Flutter View Controller-->
<scene
sceneID=
"tne-QT-ifu"
>
<objects>
<viewController
id=
"BYZ-38-t0r"
customClass=
"FlutterViewController"
sceneMemberID=
"viewController"
>
<layoutGuides>
<viewControllerLayoutGuide
type=
"top"
id=
"y3c-jy-aDJ"
/>
<viewControllerLayoutGuide
type=
"bottom"
id=
"wfy-db-euE"
/>
</layoutGuides>
<view
key=
"view"
contentMode=
"scaleToFill"
id=
"8bC-Xf-vdC"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"667"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<color
key=
"backgroundColor"
red=
"1"
green=
"1"
blue=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</view>
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"dkx-z0-nzr"
sceneMemberID=
"firstResponder"
/>
</objects>
</scene>
</scenes>
</document>
</document>
example_swift/ios/Flutter/AppFrameworkInfo.plist
0 → 100755
View file @
dd87a8bf
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
CFBundleDevelopmentRegion
</key>
<string>
en
</string>
<key>
CFBundleExecutable
</key>
<string>
App
</string>
<key>
CFBundleIdentifier
</key>
<string>
io.flutter.flutter.app
</string>
<key>
CFBundleInfoDictionaryVersion
</key>
<string>
6.0
</string>
<key>
CFBundleName
</key>
<string>
App
</string>
<key>
CFBundlePackageType
</key>
<string>
FMWK
</string>
<key>
CFBundleShortVersionString
</key>
<string>
1.0
</string>
<key>
CFBundleSignature
</key>
<string>
????
</string>
<key>
CFBundleVersion
</key>
<string>
1.0
</string>
<key>
MinimumOSVersion
</key>
<string>
8.0
</string>
</dict>
</plist>
example_swift/ios/Flutter/Debug.xcconfig
0 → 100755
View file @
dd87a8bf
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
example_swift/ios/Flutter/Release.xcconfig
0 → 100755
View file @
dd87a8bf
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
ios/Classes/Boost/FlutterBoostPlugin.h
View file @
dd87a8bf
...
@@ -45,9 +45,22 @@
...
@@ -45,9 +45,22 @@
-
(
FlutterViewController
*
)
currentViewController
;
-
(
FlutterViewController
*
)
currentViewController
;
#pragma mark - broadcast event to/from flutter
#pragma mark - broadcast event to/from flutter
/**
* Native层往Dart层发送事件,事件名称通过eventName指定
*
* @param eventName 事件名称
* @param arguments 参数
*/
-
(
void
)
sendEvent
:(
NSString
*
)
eventName
-
(
void
)
sendEvent
:(
NSString
*
)
eventName
arguments
:(
NSDictionary
*
)
arguments
;
arguments
:(
NSDictionary
*
)
arguments
;
/**
* 添加监听Dart层调用Native层的事件
*
* @param name 事件名称
* @param listner 事件监听器
*/
-
(
FLBVoidCallback
)
addEventListener
:(
FLBEventListener
)
listner
-
(
FLBVoidCallback
)
addEventListener
:(
FLBEventListener
)
listner
forName
:(
NSString
*
)
name
;
forName
:(
NSString
*
)
name
;
...
...
ios/Classes/Engine/FLBFlutterEngine.m
View file @
dd87a8bf
...
@@ -81,7 +81,6 @@
...
@@ -81,7 +81,6 @@
-
(
void
)
resume
-
(
void
)
resume
{
{
[[
_engine
lifecycleChannel
]
sendMessage
:
@"AppLifecycleState.resumed"
];
[[
_engine
lifecycleChannel
]
sendMessage
:
@"AppLifecycleState.resumed"
];
[(
FLBFlutterViewContainer
*
)
_engine
.
viewController
surfaceUpdated
:
YES
];
}
}
-
(
void
)
inactive
-
(
void
)
inactive
...
@@ -110,6 +109,7 @@
...
@@ -110,6 +109,7 @@
-
(
void
)
atacheToViewController
:(
FlutterViewController
*
)
vc
-
(
void
)
atacheToViewController
:(
FlutterViewController
*
)
vc
{
{
if
(
_engine
.
viewController
!=
vc
){
if
(
_engine
.
viewController
!=
vc
){
[(
FLBFlutterViewContainer
*
)
_engine
.
viewController
surfaceUpdated
:
NO
];
_engine
.
viewController
=
vc
;
_engine
.
viewController
=
vc
;
}
}
}
}
...
@@ -123,11 +123,9 @@
...
@@ -123,11 +123,9 @@
-
(
void
)
prepareEngineIfNeeded
-
(
void
)
prepareEngineIfNeeded
{
{
// if ([_dummy respondsToSelector:@selector(setEnableForRunnersBatch:)]) {
[(
FLBFlutterViewContainer
*
)
_engine
.
viewController
surfaceUpdated
:
NO
];
// [_dummy setEnableForRunnersBatch:YES];
NSLog
(
@"[XDEBUG]---surface changed--reset-"
);
// }
// [self detach];
[
self
detach
];
[
_dummy
surfaceUpdated
:
YES
];
}
}
@end
@end
...
...
ios/Classes/Messaging/BoostMessageChannel.h
View file @
dd87a8bf
...
@@ -38,7 +38,12 @@
...
@@ -38,7 +38,12 @@
+
(
void
)
didInitPageContainer
:(
void
(
^
)(
NSNumber
*
))
result
pageName
:(
NSString
*
)
pageName
params
:(
NSDictionary
*
)
params
uniqueId
:(
NSString
*
)
uniqueId
;
+
(
void
)
didInitPageContainer
:(
void
(
^
)(
NSNumber
*
))
result
pageName
:(
NSString
*
)
pageName
params
:(
NSDictionary
*
)
params
uniqueId
:(
NSString
*
)
uniqueId
;
+
(
void
)
willDeallocPageContainer
:(
void
(
^
)(
NSNumber
*
))
result
pageName
:(
NSString
*
)
pageName
params
:(
NSDictionary
*
)
params
uniqueId
:(
NSString
*
)
uniqueId
;
+
(
void
)
willDeallocPageContainer
:(
void
(
^
)(
NSNumber
*
))
result
pageName
:(
NSString
*
)
pageName
params
:(
NSDictionary
*
)
params
uniqueId
:(
NSString
*
)
uniqueId
;
/**
* Native层往Dart层发送事件,事件名称通过eventName指定
*
* @param eventName 事件名称
* @param arguments 参数
*/
+
(
void
)
sendEvent
:(
NSString
*
)
eventName
+
(
void
)
sendEvent
:(
NSString
*
)
eventName
arguments
:(
NSDictionary
*
)
arguments
;
arguments
:(
NSDictionary
*
)
arguments
;
...
...
ios/Classes/container/FLBFlutterViewContainer.m
View file @
dd87a8bf
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
#import "BoostMessageChannel.h"
#import "BoostMessageChannel.h"
#import "FLBFlutterContainerManager.h"
#import "FLBFlutterContainerManager.h"
#import "FlutterBoostPlugin_private.h"
#import "FlutterBoostPlugin_private.h"
#import <objc/message.h>
#import <objc/runtime.h>
#define FLUTTER_APP [FlutterBoostPlugin sharedInstance].application
#define FLUTTER_APP [FlutterBoostPlugin sharedInstance].application
#define FLUTTER_VIEW FLUTTER_APP.flutterViewController.view
#define FLUTTER_VIEW FLUTTER_APP.flutterViewController.view
...
@@ -137,7 +139,6 @@ static NSUInteger kInstanceCounter = 0;
...
@@ -137,7 +139,6 @@ static NSUInteger kInstanceCounter = 0;
-
(
void
)
attatchFlutterEngine
-
(
void
)
attatchFlutterEngine
{
{
[
FLUTTER_APP
.
flutterProvider
prepareEngineIfNeeded
];
[
FLUTTER_APP
.
flutterProvider
atacheToViewController
:
self
];
[
FLUTTER_APP
.
flutterProvider
atacheToViewController
:
self
];
}
}
...
@@ -161,16 +162,6 @@ static NSUInteger kInstanceCounter = 0;
...
@@ -161,16 +162,6 @@ static NSUInteger kInstanceCounter = 0;
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
{
{
if
([
FLUTTER_APP
contains
:
self
]){
[
self
surfaceUpdated
:
NO
];
[
self
detatchFlutterEngine
];
}
else
{
[
self
attatchFlutterEngine
];
[
self
surfaceUpdated
:
YES
];
}
[
FLUTTER_APP
resume
];
//For new page we should attach flutter view in view will appear
//For new page we should attach flutter view in view will appear
//for better performance.
//for better performance.
...
@@ -185,7 +176,13 @@ static NSUInteger kInstanceCounter = 0;
...
@@ -185,7 +176,13 @@ static NSUInteger kInstanceCounter = 0;
[
FlutterBoostPlugin
sharedInstance
].
fParams
=
_params
;
[
FlutterBoostPlugin
sharedInstance
].
fParams
=
_params
;
}
}
[
super
viewWillAppear
:
animated
];
//instead of calling [super viewWillAppear:animated];, call super's super
struct
objc_super
target
=
{
.
super_class
=
class_getSuperclass
([
FlutterViewController
class
]),
.
receiver
=
self
,
};
NSMethodSignature
*
(
*
callSuper
)(
struct
objc_super
*
,
SEL
,
BOOL
animated
)
=
(
__typeof__
(
callSuper
))
objc_msgSendSuper
;
callSuper
(
&
target
,
@selector
(
viewWillAppear
:
),
animated
);
}
}
-
(
void
)
viewDidAppear
:(
BOOL
)
animated
-
(
void
)
viewDidAppear
:(
BOOL
)
animated
...
@@ -194,13 +191,15 @@ static NSUInteger kInstanceCounter = 0;
...
@@ -194,13 +191,15 @@ static NSUInteger kInstanceCounter = 0;
//Ensure flutter view is attached.
//Ensure flutter view is attached.
[
self
attatchFlutterEngine
];
[
self
attatchFlutterEngine
];
[
FLUTTER_APP
resume
];
[
BoostMessageChannel
didShowPageContainer
:
^
(
NSNumber
*
result
)
{}
[
BoostMessageChannel
didShowPageContainer
:
^
(
NSNumber
*
result
)
{}
pageName:
_name
pageName:
_name
params:
_params
params:
_params
uniqueId:
self
.
uniqueIDString
];
uniqueId:
self
.
uniqueIDString
];
//NOTES:务必在show之后再update,否则有闪烁
[
self
surfaceUpdated
:
YES
];
[
super
viewDidAppear
:
animated
];
[
super
viewDidAppear
:
animated
];
}
}
...
@@ -217,14 +216,17 @@ static NSUInteger kInstanceCounter = 0;
...
@@ -217,14 +216,17 @@ static NSUInteger kInstanceCounter = 0;
-
(
void
)
viewDidDisappear
:(
BOOL
)
animated
-
(
void
)
viewDidDisappear
:(
BOOL
)
animated
{
{
[
FLUTTER_APP
resume
];
[
BoostMessageChannel
didDisappearPageContainer
:
^
(
NSNumber
*
result
)
{}
[
BoostMessageChannel
didDisappearPageContainer
:
^
(
NSNumber
*
result
)
{}
pageName:
_name
pageName:
_name
params:
_params
params:
_params
uniqueId:
self
.
uniqueIDString
];
uniqueId:
self
.
uniqueIDString
];
[
super
viewDidDisappear
:
animated
];
// instead of calling [super viewDidDisappear:animated];, call super's super
[
FLUTTER_APP
resume
];
struct
objc_super
target
=
{
.
super_class
=
class_getSuperclass
([
FlutterViewController
class
]),
.
receiver
=
self
,
};
NSMethodSignature
*
(
*
callSuper
)(
struct
objc_super
*
,
SEL
,
BOOL
animated
)
=
(
__typeof__
(
callSuper
))
objc_msgSendSuper
;
callSuper
(
&
target
,
@selector
(
viewDidDisappear
:
),
animated
);
}
}
-
(
void
)
installSplashScreenViewIfNecessary
{
-
(
void
)
installSplashScreenViewIfNecessary
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment