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
0
Merge Requests
0
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
1ac64c20
Commit
1ac64c20
authored
5 years ago
by
Jidong Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
185c1ff8
master
patch-1
v1.22.4-hotfixes
1.17.1
1.12.13+3
1.12.13+2
1.12.13+1
1.12.13
1.9.1+2
1.9.1+1
0.1.66
0.1.65
0.1.64
0.1.63
0.1.62
0.1.61
0.1.60
0.1.54
0.1.53
0.1.52
0.1.51
0.1.50
0.1.5
v5_flutter_1.5_upgrade_opt
v4_flutter_1.5_upgrade_opt
v3_flutter_1.5_upgrade_opt
v2_flutter_1.5_upgrade_opt
v1.12.13_support+10
v1.12.13_support+9
v1.12.13_support+8
v1.12.13_support+7
v1.12.13_support+6
v1.12.13_support+5
v1.12.13_support+4
v1.12.13_support+3
v1.12.13_support+2
v1.12.13_support+1
v1.12.13_support_xianyu+15
v1.12.13_support_xianyu+14
v1.12.13_support_xianyu+13
v1.12.13_support_xianyu+12
v1.12.13_support_xianyu+11
v1.12.13_support_xianyu+10
v1.9.1_suport+1
v1_flutter_1.5_upgrade_opt
v0.1.61-androidx-hotfixes
No related merge requests found
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
775 additions
and
26 deletions
+775
-26
ios/Classes/1.0/FLBFactory.h
ios/Classes/1.0/FLBFactory.h
+35
-0
ios/Classes/1.0/FLBFactory.m
ios/Classes/1.0/FLBFactory.m
+39
-0
ios/Classes/1.0/FLBFlutterApplication.h
ios/Classes/1.0/FLBFlutterApplication.h
+35
-0
ios/Classes/1.0/FLBFlutterApplication.m
ios/Classes/1.0/FLBFlutterApplication.m
+130
-0
ios/Classes/1.0/FLBFlutterEngine.h
ios/Classes/1.0/FLBFlutterEngine.h
+33
-0
ios/Classes/1.0/FLBFlutterEngine.m
ios/Classes/1.0/FLBFlutterEngine.m
+103
-0
ios/Classes/1.0/FLBFlutterProvider.h
ios/Classes/1.0/FLBFlutterProvider.h
+47
-0
ios/Classes/1.0/FLBFlutterViewContainer.h
ios/Classes/1.0/FLBFlutterViewContainer.h
+48
-0
ios/Classes/1.0/FLBFlutterViewContainer.m
ios/Classes/1.0/FLBFlutterViewContainer.m
+241
-0
ios/Classes/1.5/FLB2Factory.h
ios/Classes/1.5/FLB2Factory.h
+1
-1
ios/Classes/1.5/FLB2Factory.m
ios/Classes/1.5/FLB2Factory.m
+2
-2
ios/Classes/Boost/FLB2FlutterProvider.h
ios/Classes/Boost/FLB2FlutterProvider.h
+2
-1
ios/Classes/Boost/FLB2Platform.h
ios/Classes/Boost/FLB2Platform.h
+2
-1
ios/Classes/Boost/FLBAbstractFactory.m
ios/Classes/Boost/FLBAbstractFactory.m
+0
-12
ios/Classes/Boost/FLBFlutterAppDelegate.m
ios/Classes/Boost/FLBFlutterAppDelegate.m
+2
-2
ios/Classes/Boost/FLBPlatform.h
ios/Classes/Boost/FLBPlatform.h
+47
-0
ios/Classes/Boost/FlutterBoost.h
ios/Classes/Boost/FlutterBoost.h
+2
-2
ios/Classes/Boost/FlutterBoostPlugin.m
ios/Classes/Boost/FlutterBoostPlugin.m
+4
-5
ios/Classes/Boost/FlutterBoostPlugin_private.h
ios/Classes/Boost/FlutterBoostPlugin_private.h
+2
-0
No files found.
ios/Classes/1.0/FLBFactory.h
0 → 100644
View file @
1ac64c20
/*
* 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 <Foundation/Foundation.h>
#import "FLBAbstractFactory.h"
NS_ASSUME_NONNULL_BEGIN
@interface
FLBFactory
:
NSObject
<
FLBAbstractFactory
>
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFactory.m
0 → 100644
View file @
1ac64c20
/*
* 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 "FLBFactory.h"
@implementation
FLBFactory
-
(
id
<
FLBFlutterApplicationInterface
>
)
createApplication
:(
id
<
FLB2Platform
>
)
platform
{
}
-
(
id
<
FLB2FlutterProvider
>
)
createFlutterProvider
:(
id
<
FLB2Platform
>
)
platform
{
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterApplication.h
0 → 100755
View file @
1ac64c20
/*
* 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 <Foundation/Foundation.h>
#import <Flutter/Flutter.h>
#import "FLBFlutterApplicationInterface.h"
NS_ASSUME_NONNULL_BEGIN
@interface
FLBFlutterApplication
:
NSObject
<
FLBFlutterApplicationInterface
>
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterApplication.m
0 → 100755
View file @
1ac64c20
/*
* 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 "FLBFlutterApplication.h"
#import "FLBFlutterContainerManager.h"
#import "FLBFlutterEngine.h"
@interface
FLBFlutterApplication
()
@property
(
nonatomic
,
strong
)
FLBFlutterContainerManager
*
manager
;
@property
(
nonatomic
,
strong
)
id
<
FLB2FlutterProvider
>
viewProvider
;
@property
(
nonatomic
,
assign
)
BOOL
isRunning
;
@end
@implementation
FLBFlutterApplication
+
(
FLBFlutterApplication
*
)
sharedApplication
{
static
FLBFlutterApplication
*
instance
=
nil
;
static
dispatch_once_t
onceToken
;
dispatch_once
(
&
onceToken
,
^
{
instance
=
[
self
new
];
});
return
instance
;
}
-
(
BOOL
)
isRunning
{
return
_isRunning
;
}
-
(
id
)
flutterProvider
{
return
_viewProvider
;
}
-
(
void
)
startFlutterWithPlatform
:(
id
<
FLB2Platform
>
)
platform
onStart
:(
void
(
^
)(
id
<
FlutterBinaryMessenger
,
FlutterTextureRegistry
,
FlutterPluginRegistry
>
_Nonnull
))
callback
{
static
dispatch_once_t
onceToken
;
dispatch_once
(
&
onceToken
,
^
{
self
.
platform
=
platform
;
self
.
viewProvider
=
[[
FLBFlutterEngine
alloc
]
init
];
_isRunning
=
YES
;
if
(
callback
)
callback
(
self
.
viewProvider
.
engine
);
});
}
-
(
instancetype
)
init
{
if
(
self
=
[
super
init
])
{
_manager
=
[
FLBFlutterContainerManager
new
];
}
return
self
;
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
UIView
*
)
flutterView
{
return
[
self
flutterViewController
].
view
;
}
-
(
BOOL
)
contains
:(
FLBFlutterViewContainer
*
)
vc
{
return
[
_manager
contains
:
vc
];
}
-
(
void
)
addUniqueViewController
:(
FLBFlutterViewContainer
*
)
vc
{
return
[
_manager
addUnique
:
vc
];
}
-
(
void
)
removeViewController
:(
FLBFlutterViewContainer
*
)
vc
{
return
[
_manager
remove
:
vc
];
}
-
(
BOOL
)
isTop
:(
NSString
*
)
pageId
{
return
[
_manager
.
peak
isEqual
:
pageId
];
}
-
(
void
)
pause
{
[
self
.
viewProvider
pause
];
}
-
(
void
)
resume
{
[
self
.
viewProvider
resume
];
}
-
(
void
)
inactive
{
[
self
.
viewProvider
inactive
];
}
-
(
FlutterViewController
*
)
flutterViewController
{
return
self
.
flutterProvider
.
engine
.
viewController
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterEngine.h
0 → 100755
View file @
1ac64c20
/*
* 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 <Foundation/Foundation.h>
#import "FLBFlutterProvider.h"
NS_ASSUME_NONNULL_BEGIN
@interface
FLBFlutterEngine
:
NSObject
<
FLBFlutterProvider
>
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterEngine.m
0 → 100755
View file @
1ac64c20
/*
* 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 "FLBFlutterEngine.h"
#import <Flutter/Flutter.h>
#import "FLBFlutterViewContainer.h"
@interface
FLBFlutterEngine
()
@property
(
nonatomic
,
strong
)
FlutterEngine
*
engine
;
@property
(
nonatomic
,
strong
)
FLBFlutterViewContainer
*
dummy
;
@end
@implementation
FLBFlutterEngine
-
(
instancetype
)
init
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
if
(
self
=
[
super
init
])
{
_engine
=
[[
FlutterEngine
alloc
]
initWithName
:
@"io.flutter"
project
:
nil
];
[
_engine
runWithEntrypoint
:
nil
];
_dummy
=
[[
FLBFlutterViewContainer
alloc
]
initWithEngine
:
_engine
nibName:
nil
bundle:
nil
];
Class
clazz
=
NSClassFromString
(
@"GeneratedPluginRegistrant"
);
if
(
clazz
)
{
if
([
clazz
respondsToSelector
:
NSSelectorFromString
(
@"registerWithRegistry:"
)])
{
[
clazz
performSelector
:
NSSelectorFromString
(
@"registerWithRegistry:"
)
withObject:
_engine
];
}
}
}
return
self
;
#pragma clang diagnostic pop
}
-
(
void
)
pause
{
[[
_engine
lifecycleChannel
]
sendMessage
:
@"AppLifecycleState.pause"
];
}
-
(
void
)
resume
{
[[
_engine
lifecycleChannel
]
sendMessage
:
@"AppLifecycleState.resume"
];
}
-
(
void
)
inactive
{
[[
_engine
lifecycleChannel
]
sendMessage
:
@"AppLifecycleState.inactive"
];
}
-
(
FlutterEngine
*
)
engine
{
return
_engine
;
}
-
(
void
)
atacheToViewController
:(
FlutterViewController
*
)
vc
{
if
(
_engine
.
viewController
!=
vc
){
_engine
.
viewController
=
vc
;
}
}
-
(
void
)
detach
{
if
(
_engine
.
viewController
!=
_dummy
){
_engine
.
viewController
=
_dummy
;
}
}
-
(
void
)
prepareEngineIfNeeded
{
[
self
detach
];
[
_dummy
surfaceUpdated
:
YES
];
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterProvider.h
0 → 100755
View file @
1ac64c20
/*
* 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 <Foundation/Foundation.h>
@class
FlutterViewController
;
@class
FlutterEngine
;
NS_ASSUME_NONNULL_BEGIN
#define RELEASE_1_0 1
@protocol
FLBFlutterProvider
<
NSObject
>
@required
-
(
FlutterEngine
*
)
engine
;
-
(
void
)
atacheToViewController
:(
FlutterViewController
*
)
vc
;
-
(
void
)
detach
;
-
(
void
)
pause
;
-
(
void
)
resume
;
-
(
void
)
inactive
;
-
(
void
)
prepareEngineIfNeeded
;
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterViewContainer.h
0 → 100755
View file @
1ac64c20
/*
* 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 <UIKit/UIKit.h>
#import <Flutter/Flutter.h>
#import "FLBFlutterContainer.h"
NS_ASSUME_NONNULL_BEGIN
@interface
FLBFlutterViewContainer
:
FlutterViewController
@property
(
nonatomic
,
copy
,
readonly
)
NSString
*
name
;
@property
(
nonatomic
,
strong
,
readonly
)
NSDictionary
*
params
;
@property
(
nonatomic
,
copy
,
readonly
)
NSString
*
uniqueIDString
;
/*
You must call this one time to set flutter page name
and params.
*/
-
(
void
)
setName
:(
NSString
*
)
name
params
:(
NSDictionary
*
)
params
;
-
(
void
)
surfaceUpdated
:(
BOOL
)
appeared
;
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterViewContainer.m
0 → 100755
View file @
1ac64c20
/*
* 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 "FLBFlutterViewContainer.h"
#import "FLBFlutterApplication.h"
#import "Service_NavigationService.h"
#import "FlutterBoostConfig.h"
#import "FLBFlutterViewContainerManager.h"
#define FLUTTER_VIEW [FLBFlutterApplication sharedApplication].flutterViewController.view
#define FLUTTER_VC [FLBFlutterApplication sharedApplication].flutterViewController
#define FLUTTER_APP [FLBFlutterApplication sharedApplication]
@interface
FLBFlutterViewContainer
()
@property
(
nonatomic
,
copy
,
readwrite
)
NSString
*
name
;
@property
(
nonatomic
,
strong
,
readwrite
)
NSDictionary
*
params
;
@property
(
nonatomic
,
assign
)
long
long
identifier
;
@end
@implementation
FLBFlutterViewContainer
-
(
instancetype
)
init
{
[
FLUTTER_APP
.
flutterProvider
prepareEngineIfNeeded
];
if
(
self
=
[
super
initWithEngine
:
FLUTTER_APP
.
flutterProvider
.
engine
nibName:
nil
bundle:
nil
]){
[
self
_setup
];
}
return
self
;
}
-
(
instancetype
)
initWithCoder
:(
NSCoder
*
)
aDecoder
{
if
(
self
=
[
super
initWithCoder
:
aDecoder
])
{
NSAssert
(
NO
,
@"unsupported init method!"
);
[
self
_setup
];
}
return
self
;
}
-
(
void
)
setName
:(
NSString
*
)
name
params
:(
NSDictionary
*
)
params
{
if
(
!
_name
&&
name
){
_name
=
name
;
_params
=
params
;
[
Service_NavigationService
didInitPageContainer
:
^
(
NSNumber
*
r
)
{}
pageName:
name
params:
params
uniqueId:
[
self
uniqueIDString
]];
}
}
static
NSUInteger
kInstanceCounter
=
0
;
+
(
NSUInteger
)
instanceCounter
{
return
kInstanceCounter
;
}
+
(
void
)
instanceCounterIncrease
{
kInstanceCounter
++
;
if
(
kInstanceCounter
==
1
){
// [FLUTTER_APP resume];
}
}
+
(
void
)
instanceCounterDecrease
{
kInstanceCounter
--
;
if
([
self
.
class
instanceCounter
]
==
0
){
// [[FLBFlutterApplication sharedApplication] pause];
}
}
-
(
NSString
*
)
uniqueIDString
{
return
@
(
_identifier
).
stringValue
;
}
-
(
void
)
_setup
{
static
long
long
sCounter
=
0
;
_identifier
=
sCounter
++
;
[
self
.
class
instanceCounterIncrease
];
}
-
(
void
)
dealloc
{
[
self
notifyWillDealloc
];
[
NSNotificationCenter
.
defaultCenter
removeObserver
:
self
];
}
-
(
void
)
notifyWillDealloc
{
[
Service_NavigationService
willDeallocPageContainer
:
^
(
NSNumber
*
r
)
{}
pageName:
_name
params
:
_params
uniqueId:
[
self
uniqueIDString
]];
[[
FLBFlutterApplication
sharedApplication
]
removeViewController
:
self
];
[
self
.
class
instanceCounterDecrease
];
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
view
.
backgroundColor
=
UIColor
.
whiteColor
;
}
#pragma mark - ScreenShots
-
(
BOOL
)
isFlutterViewAttatched
{
return
FLUTTER_VIEW
.
superview
==
self
.
view
;
}
-
(
void
)
attatchFlutterEngine
{
[
FLUTTER_APP
.
flutterProvider
prepareEngineIfNeeded
];
[
FLUTTER_APP
.
flutterProvider
atacheToViewController
:
self
];
}
-
(
void
)
detatchFlutterEngine
{
[
FLUTTER_APP
.
flutterProvider
detach
];
}
#pragma mark - Life circle methods
-
(
void
)
viewDidLayoutSubviews
{
[
super
viewDidLayoutSubviews
];
[[
FLBFlutterApplication
sharedApplication
]
resume
];
}
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
{
if
([
FLUTTER_APP
contains
:
self
]){
[
self
detatchFlutterEngine
];
}
else
{
[
self
attatchFlutterEngine
];
}
[[
FLBFlutterApplication
sharedApplication
]
resume
];
[
self
surfaceUpdated
:
YES
];
//For new page we should attach flutter view in view will appear
//for better performance.
[
Service_NavigationService
willShowPageContainer
:
^
(
NSNumber
*
result
)
{}
pageName:
_name
params:
_params
uniqueId:
self
.
uniqueIDString
];
//Save some first time page info.
if
(
!
[
FlutterBoostConfig
sharedInstance
].
fPagename
){
[
FlutterBoostConfig
sharedInstance
].
fPagename
=
_name
;
[
FlutterBoostConfig
sharedInstance
].
fPageId
=
self
.
uniqueIDString
;
[
FlutterBoostConfig
sharedInstance
].
fParams
=
_params
;
}
[
super
viewWillAppear
:
animated
];
}
-
(
void
)
viewDidAppear
:(
BOOL
)
animated
{
[
FLUTTER_APP
addUniqueViewController
:
self
];
//Ensure flutter view is attached.
[
self
attatchFlutterEngine
];
[
self
surfaceUpdated
:
YES
];
[
Service_NavigationService
didShowPageContainer
:
^
(
NSNumber
*
result
)
{}
pageName:
_name
params:
_params
uniqueId:
self
.
uniqueIDString
];
[
super
viewDidAppear
:
animated
];
}
-
(
void
)
viewWillDisappear
:(
BOOL
)
animated
{
[
Service_NavigationService
willDisappearPageContainer
:
^
(
NSNumber
*
result
)
{}
pageName:
_name
params:
_params
uniqueId:
self
.
uniqueIDString
];
[
super
viewWillDisappear
:
animated
];
}
-
(
void
)
viewDidDisappear
:(
BOOL
)
animated
{
[
self
detatchFlutterEngine
];
[
Service_NavigationService
didDisappearPageContainer
:
^
(
NSNumber
*
result
)
{}
pageName:
_name
params:
_params
uniqueId:
self
.
uniqueIDString
];
[
super
viewDidDisappear
:
animated
];
}
#pragma mark - FLBViewControllerResultHandler
-
(
void
)
onRecievedResult
:(
NSDictionary
*
)
resultData
forKey
:(
NSString
*
)
key
{
[
Service_NavigationService
onNativePageResult
:
^
(
NSNumber
*
finished
)
{}
uniqueId:
self
.
uniqueIDString
key:
key
resultData:
resultData
params:
@{}];
}
-
(
void
)
installSplashScreenViewIfNecessary
{
//Do nothing.
}
-
(
BOOL
)
loadDefaultSplashScreenView
{
return
NO
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/1.5/FLBFactory.h
→
ios/Classes/1.5/FLB
2
Factory.h
View file @
1ac64c20
...
...
@@ -26,7 +26,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface
FLBFactory
:
NSObject
@interface
FLB
2
Factory
:
NSObject
@end
...
...
This diff is collapsed.
Click to expand it.
ios/Classes/1.5/FLBFactory.m
→
ios/Classes/1.5/FLB
2
Factory.m
View file @
1ac64c20
...
...
@@ -5,8 +5,8 @@
// Created by Jidong Chen on 2019/6/11.
//
#import "FLBFactory.h"
#import "FLB
2
Factory.h"
@implementation
FLBFactory
@implementation
FLB
2
Factory
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Boost/FLB2FlutterProvider.h
View file @
1ac64c20
...
...
@@ -23,6 +23,7 @@
*/
#import <Foundation/Foundation.h>
#import "FLBFlutterProvider.h"
@class
FlutterViewController
;
@class
FlutterEngine
;
...
...
@@ -31,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
#define RELEASE_1_0 1
@protocol
FLB2FlutterProvider
<
NSObject
>
@protocol
FLB2FlutterProvider
<
FLBFlutterProvider
>
@required
-
(
FlutterEngine
*
)
engine
;
...
...
This diff is collapsed.
Click to expand it.
ios/Classes/Boost/FLB2Platform.h
View file @
1ac64c20
...
...
@@ -23,10 +23,11 @@
*/
#import <Foundation/Foundation.h>
#import "FLBPlatform.h"
NS_ASSUME_NONNULL_BEGIN
@protocol
FLB2Platform
<
NSObject
>
@protocol
FLB2Platform
<
FLBPlatform
>
@optional
//Whether to enable accessibility support. Default value is Yes.
...
...
This diff is collapsed.
Click to expand it.
ios/Classes/Boost/FLBAbstractFactory.m
deleted
100644 → 0
View file @
185c1ff8
//
// FLBAbstractFactory.m
// flutter_boost
//
// Created by Jidong Chen on 2019/6/11.
//
#import "FLBAbstractFactory.h"
@implementation
FLBAbstractFactory
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Boost/FLBFlutterAppDelegate.m
View file @
1ac64c20
...
...
@@ -23,13 +23,13 @@
*/
#import "FLBFlutterAppDelegate.h"
#import "F
LB2FlutterApplication
.h"
#import "F
lutterBoostPlugin_private
.h"
@implementation
FLBFlutterAppDelegate
// Returns the key window's rootViewController, if it's a FlutterViewController.
// Otherwise, returns nil.
-
(
FlutterViewController
*
)
rootFlutterViewController
{
return
F
LB2FlutterApplication
.
sharedA
pplication
.
flutterViewController
;
return
F
lutterBoostPlugin
.
sharedInstance
.
a
pplication
.
flutterViewController
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Boost/FLBPlatform.h
0 → 100755
View file @
1ac64c20
/*
* 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 <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol
FLBPlatform
<
NSObject
>
@optional
//Whether to enable accessibility support. Default value is Yes.
-
(
BOOL
)
accessibilityEnable
;
@required
-
(
void
)
openPage
:(
NSString
*
)
name
params
:(
NSDictionary
*
)
params
animated
:(
BOOL
)
animated
completion
:(
void
(
^
)(
BOOL
finished
))
completion
;
-
(
void
)
closePage
:(
NSString
*
)
uid
animated
:(
BOOL
)
animated
params
:(
NSDictionary
*
)
params
completion
:(
void
(
^
)(
BOOL
finished
))
completion
;
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
Click to expand it.
ios/Classes/Boost/FlutterBoost.h
View file @
1ac64c20
...
...
@@ -27,8 +27,8 @@
#import "FlutterBoostPlugin.h"
#import "FLBFlutterAppDelegate.h"
//
#import "FLBFlutterViewContainer.h"
//
#import "FLBPlatform.h"
#import "FLBFlutterViewContainer.h"
#import "FLBPlatform.h"
#import "FLB2FlutterViewContainer.h"
#import "FLB2Platform.h"
...
...
This diff is collapsed.
Click to expand it.
ios/Classes/Boost/FlutterBoostPlugin.m
View file @
1ac64c20
...
...
@@ -23,7 +23,6 @@
*/
#import "FlutterBoostPlugin.h"
#import "FLB2FlutterApplication.h"
#import "FLBResultMediator.h"
#import "FlutterBoostPlugin_private.h"
...
...
@@ -72,18 +71,18 @@
FlutterPluginRegistry
>
engine
))
callback
;
{
//TODO:
[
FLB2FlutterApplication
.
sharedA
pplication
startFlutterWithPlatform
:
platform
onStart:
callback
];
[
self
.
a
pplication
startFlutterWithPlatform
:
platform
onStart:
callback
];
}
-
(
BOOL
)
isRunning
{
return
[
FLB2FlutterApplication
.
sharedA
pplication
isRunning
];
return
[
self
.
a
pplication
isRunning
];
}
-
(
FlutterViewController
*
)
currentViewController
{
return
[
[
FLB2FlutterApplication
sharedApplication
]
flutterViewController
];
return
[
self
.
application
flutterViewController
];
}
-
(
void
)
openPage
:(
NSString
*
)
name
...
...
This diff is collapsed.
Click to expand it.
ios/Classes/Boost/FlutterBoostPlugin_private.h
View file @
1ac64c20
...
...
@@ -25,12 +25,14 @@
#import "FLBFlutterApplicationInterface.h"
#import "FLBResultMediator.h"
#import "FLBAbstractFactory.h"
@interface
FlutterBoostPlugin
()
-
(
id
<
FLBFlutterApplicationInterface
>
)
application
;
@property
(
nonatomic
,
strong
)
FLBResultMediator
*
resultMediator
;
@property
(
nonatomic
,
strong
)
id
<
FLBAbstractFactory
>
factory
;
@property
(
nonatomic
,
copy
)
NSString
*
fPageId
;
@property
(
nonatomic
,
copy
)
NSString
*
fPagename
;
...
...
This diff is collapsed.
Click to expand it.
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