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
78c23ac1
Commit
78c23ac1
authored
5 years ago
by
Jidong Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
1ac64c20
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
804 additions
and
132 deletions
+804
-132
ios/Classes/1.0/FLBFactory.m
ios/Classes/1.0/FLBFactory.m
+5
-3
ios/Classes/1.0/FLBFlutterApplication.h
ios/Classes/1.0/FLBFlutterApplication.h
+2
-1
ios/Classes/1.0/FLBFlutterApplication.m
ios/Classes/1.0/FLBFlutterApplication.m
+32
-27
ios/Classes/1.0/FLBFlutterEngine.h
ios/Classes/1.0/FLBFlutterEngine.h
+6
-2
ios/Classes/1.0/FLBFlutterEngine.m
ios/Classes/1.0/FLBFlutterEngine.m
+22
-32
ios/Classes/1.0/FLBFlutterEngineOld.h
ios/Classes/1.0/FLBFlutterEngineOld.h
+37
-0
ios/Classes/1.0/FLBFlutterEngineOld.m
ios/Classes/1.0/FLBFlutterEngineOld.m
+108
-0
ios/Classes/1.0/FLBFlutterViewContainer.h
ios/Classes/1.0/FLBFlutterViewContainer.h
+2
-15
ios/Classes/1.0/FLBFlutterViewContainer.m
ios/Classes/1.0/FLBFlutterViewContainer.m
+211
-49
ios/Classes/1.0/FLBFlutterViewControllerAdaptor.h
ios/Classes/1.0/FLBFlutterViewControllerAdaptor.h
+39
-0
ios/Classes/1.0/FLBFlutterViewControllerAdaptor.m
ios/Classes/1.0/FLBFlutterViewControllerAdaptor.m
+105
-0
ios/Classes/1.0/FLBFlutterViewProvider.h
ios/Classes/1.0/FLBFlutterViewProvider.h
+45
-0
ios/Classes/1.0/FLBViewProviderFactory.h
ios/Classes/1.0/FLBViewProviderFactory.h
+39
-0
ios/Classes/1.0/FLBViewProviderFactory.m
ios/Classes/1.0/FLBViewProviderFactory.m
+51
-0
ios/Classes/1.0/FlutterBoostConfig.h
ios/Classes/1.0/FlutterBoostConfig.h
+40
-0
ios/Classes/1.0/FlutterBoostConfig.m
ios/Classes/1.0/FlutterBoostConfig.m
+59
-0
ios/Classes/Boost/FLBAbstractFactory.h
ios/Classes/Boost/FLBAbstractFactory.h
+1
-3
No files found.
ios/Classes/1.0/FLBFactory.m
View file @
78c23ac1
...
...
@@ -23,17 +23,19 @@
*/
#import "FLBFactory.h"
#import "FLBFlutterViewContainer.h"
#import "FLBFlutterApplication.h"
@implementation
FLBFactory
-
(
id
<
FLBFlutterApplicationInterface
>
)
createApplication
:(
id
<
FLB2Platform
>
)
platform
{
return
FLBFlutterApplication
.
new
;
}
-
(
id
<
FLB
2FlutterProvider
>
)
createFlutterProvider
:(
id
<
FLB2Platform
>
)
platform
-
(
id
<
FLB
FlutterContainer
>
)
createFlutterContainer
{
return
FLBFlutterViewContainer
.
new
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterApplication.h
View file @
78c23ac1
...
...
@@ -23,13 +23,14 @@
*/
#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
View file @
78c23ac1
...
...
@@ -23,47 +23,36 @@
*/
#import "FLBFlutterApplication.h"
#import "FlutterBoost.h"
#import "FLBFlutterContainerManager.h"
#import "FLB
FlutterEngine
.h"
#import "FLB
ViewProviderFactory
.h"
@interface
FLBFlutterApplication
()
@property
(
nonatomic
,
strong
)
FLBFlutterContainerManager
*
manager
;
@property
(
nonatomic
,
strong
)
id
<
FLB2FlutterProvider
>
viewProvider
;
@property
(
nonatomic
,
strong
)
id
<
FLBFlutterViewProvider
>
viewProvider
;
@property
(
nonatomic
,
assign
)
BOOL
isRendering
;
@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
-
(
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
);
self
.
viewProvider
=
[[
FLBViewProviderFactory
new
]
createViewProviderWithPlatform
:
platform
];
[
self
.
viewProvider
resume
];
self
.
isRendering
=
YES
;
self
.
isRunning
=
YES
;
if
(
callback
)
callback
(
self
.
viewProvider
.
viewController
);
});
}
...
...
@@ -85,18 +74,23 @@
return
[
self
flutterViewController
].
view
;
}
-
(
FlutterViewController
*
)
flutterViewController
{
return
self
.
viewProvider
.
viewController
;
}
-
(
BOOL
)
contains
:(
FLBFlutterViewContainer
*
)
vc
-
(
BOOL
)
contains
:(
id
<
FLBFlutterContainer
>
)
vc
{
return
[
_manager
contains
:
vc
];
}
-
(
void
)
addUniqueViewController
:(
FLBFlutterViewContainer
*
)
vc
-
(
void
)
addUniqueViewController
:(
id
<
FLBFlutterContainer
>
)
vc
{
return
[
_manager
addUnique
:
vc
];
}
-
(
void
)
removeViewController
:(
FLBFlutterViewContainer
*
)
vc
-
(
void
)
removeViewController
:(
id
<
FLBFlutterContainer
>
)
vc
{
return
[
_manager
remove
:
vc
];
}
...
...
@@ -109,12 +103,22 @@
-
(
void
)
pause
{
if
(
!
_isRendering
)
return
;
[
self
.
viewProvider
pause
];
_isRendering
=
NO
;
}
-
(
void
)
resume
{
if
(
_isRendering
)
return
;
[
self
.
viewProvider
resume
];
_isRendering
=
YES
;
}
-
(
void
)
inactive
...
...
@@ -122,9 +126,10 @@
[
self
.
viewProvider
inactive
];
}
-
(
FlutterViewController
*
)
flutterViewController
-
(
void
)
setAccessibilityEnable
:(
BOOL
)
enable
{
return
self
.
flutterProvider
.
engine
.
viewController
;
[
self
.
viewProvider
setAccessibilityEnable
:
enable
]
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterEngine.h
View file @
78c23ac1
...
...
@@ -23,11 +23,15 @@
*/
#import <Foundation/Foundation.h>
#import "FLBFlutterProvider.h"
#import "FLBFlutter
View
Provider.h"
NS_ASSUME_NONNULL_BEGIN
@interface
FLBFlutterEngine
:
NSObject
<
FLBFlutterProvider
>
#if RELEASE_1_0
@interface
FLBFlutterEngine
:
NSObject
<
FLBFlutterViewProvider
>
@end
#endif
NS_ASSUME_NONNULL_END
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterEngine.m
View file @
78c23ac1
...
...
@@ -24,12 +24,13 @@
#import "FLBFlutterEngine.h"
#import <Flutter/Flutter.h>
#import "FLBFlutterViewCont
aine
r.h"
#import "FLBFlutterViewCont
rollerAdapto
r.h"
#if RELEASE_1_0
@interface
FLBFlutterEngine
()
@property
(
nonatomic
,
strong
)
FLBFlutterViewControllerAdaptor
*
viewController
;
@property
(
nonatomic
,
strong
)
FlutterEngine
*
engine
;
@property
(
nonatomic
,
strong
)
FLBFlutterViewContainer
*
dummy
;
@end
@implementation
FLBFlutterEngine
...
...
@@ -42,14 +43,15 @@
if
(
self
=
[
super
init
])
{
_engine
=
[[
FlutterEngine
alloc
]
initWithName
:
@"io.flutter"
project
:
nil
];
[
_engine
runWithEntrypoint
:
nil
];
_dummy
=
[[
FLBFlutterViewContainer
alloc
]
initWithEngine
:
_engine
nibName:
nil
bundle:
nil
];
_viewController
=
[[
FLBFlutterViewControllerAdaptor
alloc
]
initWithEngine
:
_engine
nibName:
nil
bundle:
nil
];
[
_viewController
view
];
Class
clazz
=
NSClassFromString
(
@"GeneratedPluginRegistrant"
);
if
(
clazz
)
{
if
([
clazz
respondsToSelector
:
NSSelectorFromString
(
@"registerWithRegistry:"
)])
{
[
clazz
performSelector
:
NSSelectorFromString
(
@"registerWithRegistry:"
)
withObject:
_
engine
];
withObject:
_
viewController
];
}
}
}
...
...
@@ -58,14 +60,23 @@
#pragma clang diagnostic pop
}
-
(
FlutterViewController
*
)
viewController
{
return
_viewController
;
}
-
(
void
)
pause
{
[[
_engine
lifecycleChannel
]
sendMessage
:
@"AppLifecycleState.pause"
];
//TODO: [[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.paused"];
[
self
.
viewController
boost_viewWillDisappear
:
NO
];
[
self
.
viewController
boost_viewDidDisappear
:
NO
];
}
-
(
void
)
resume
{
[[
_engine
lifecycleChannel
]
sendMessage
:
@"AppLifecycleState.resume"
];
//TODO: [[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.resumed"];
[
self
.
viewController
boost_viewWillAppear
:
NO
];
[
self
.
viewController
boost_viewDidAppear
:
NO
];
}
-
(
void
)
inactive
...
...
@@ -73,31 +84,10 @@
[[
_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
-
(
void
)
setAccessibilityEnable
:(
BOOL
)
enable
{
[
self
detach
];
[
_dummy
surfaceUpdated
:
YES
];
self
.
viewController
.
accessibilityEnable
=
enable
;
}
@end
#endif
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterEngineOld.h
0 → 100755
View file @
78c23ac1
/*
* 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 "FLBFlutterViewProvider.h"
#import "FLBPlatform.h"
NS_ASSUME_NONNULL_BEGIN
@interface
FLBFlutterEngineOld
:
NSObject
<
FLBFlutterViewProvider
>
-
(
instancetype
)
initWithPlatform
:(
id
<
FLBPlatform
>
)
platform
;
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterEngineOld.m
0 → 100755
View file @
78c23ac1
/*
* 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 "FLBFlutterEngineOld.h"
#import "FLBFlutterViewControllerAdaptor.h"
#import <objc/runtime.h>
@interface
FLBFlutterEngineOld
()
@property
(
nonatomic
,
strong
)
FLBFlutterViewControllerAdaptor
*
viewController
;
@end
@implementation
FLBFlutterEngineOld
-
(
instancetype
)
initWithPlatform
:(
id
<
FLBPlatform
>
)
platform
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
if
(
self
=
[
super
init
])
{
Class
class
=
[
FLBFlutterViewControllerAdaptor
class
];
SEL
originalSelector
=
@selector
(
onAccessibilityStatusChanged
:
);
SEL
swizzledSelector
=
@selector
(
fixed_onAccessibilityStatusChanged
:
);
Method
originalMethod
=
class_getInstanceMethod
(
class
,
originalSelector
);
Method
swizzledMethod
=
class_getInstanceMethod
(
class
,
swizzledSelector
);
method_exchangeImplementations
(
originalMethod
,
swizzledMethod
);
_viewController
=
[
FLBFlutterViewControllerAdaptor
new
];
if
([
platform
respondsToSelector
:
@selector
(
accessibilityEnable
)]){
_viewController
.
accessibilityEnable
=
[
platform
accessibilityEnable
];
}
else
{
_viewController
.
accessibilityEnable
=
YES
;
}
[
_viewController
view
];
Class
clazz
=
NSClassFromString
(
@"GeneratedPluginRegistrant"
);
if
(
clazz
)
{
if
([
clazz
respondsToSelector
:
NSSelectorFromString
(
@"registerWithRegistry:"
)])
{
[
clazz
performSelector
:
NSSelectorFromString
(
@"registerWithRegistry:"
)
withObject:
_viewController
];
}
}
}
return
self
;
#pragma clang diagnostic pop
}
-
(
FlutterViewController
*
)
viewController
{
return
_viewController
;
}
-
(
void
)
pause
{
[
self
.
viewController
boost_viewWillDisappear
:
NO
];
[
self
.
viewController
boost_viewDidDisappear
:
NO
];
}
-
(
void
)
resume
{
[
self
.
viewController
boost_viewWillAppear
:
NO
];
[
self
.
viewController
boost_viewDidAppear
:
NO
];
}
-
(
void
)
inactive
{
NSString
*
channel
=
@"flutter/lifecycle"
;
NSString
*
message
=
@"AppLifecycleState.inactive"
;
NSData
*
data
=
[[
FlutterStringCodec
sharedInstance
]
encode
:
message
];
[
self
.
viewController
sendOnChannel
:
channel
message
:
data
];
}
-
(
void
)
resumeFlutterOnly
{
NSString
*
channel
=
@"flutter/lifecycle"
;
NSString
*
message
=
@"AppLifecycleState.resumed"
;
NSData
*
data
=
[[
FlutterStringCodec
sharedInstance
]
encode
:
message
];
[
self
.
viewController
sendOnChannel
:
channel
message
:
data
];
}
-
(
void
)
setAccessibilityEnable
:(
BOOL
)
enable
{
self
.
viewController
.
accessibilityEnable
=
enable
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterViewContainer.h
View file @
78c23ac1
...
...
@@ -23,25 +23,12 @@
*/
#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
;
@interface
FLBFlutterViewContainer
:
UIViewController
<
FLBFlutterContainer
>
@end
...
...
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterViewContainer.m
View file @
78c23ac1
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterViewControllerAdaptor.h
0 → 100755
View file @
78c23ac1
/*
* 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 <Flutter/Flutter.h>
NS_ASSUME_NONNULL_BEGIN
@interface
FLBFlutterViewControllerAdaptor
:
FlutterViewController
-
(
void
)
boost_viewWillAppear
:(
BOOL
)
animated
;
-
(
void
)
boost_viewDidAppear
:(
BOOL
)
animated
;
-
(
void
)
boost_viewWillDisappear
:(
BOOL
)
animated
;
-
(
void
)
boost_viewDidDisappear
:(
BOOL
)
animated
;
@property
(
nonatomic
,
assign
)
BOOL
accessibilityEnable
;
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterViewControllerAdaptor.m
0 → 100755
View file @
78c23ac1
/*
* 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 "FLBFlutterViewControllerAdaptor.h"
#import <objc/runtime.h>
@interface
FLBFlutterViewControllerAdaptor
()
@end
@implementation
FLBFlutterViewControllerAdaptor
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
view
.
backgroundColor
=
[
UIColor
whiteColor
];
// Do any additional setup after loading the view.
}
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
{
//Left blank intentionally.
}
-
(
void
)
viewDidAppear
:(
BOOL
)
animated
{
//Left blank intentionally.
}
-
(
void
)
viewWillDisappear
:(
BOOL
)
animated
{
[[
UIApplication
sharedApplication
]
sendAction
:
@selector
(
resignFirstResponder
)
to
:
nil
from
:
nil
forEvent
:
nil
];
//Avoid super call intentionally.
}
-
(
void
)
viewDidDisappear
:(
BOOL
)
animated
{
//Avoid super call intentionally.
[[[
UIApplication
sharedApplication
]
keyWindow
]
endEditing
:
YES
];
}
-
(
void
)
boost_viewWillAppear
:(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
}
-
(
void
)
boost_viewDidAppear
:(
BOOL
)
animated
{
[
super
viewDidAppear
:
animated
];
}
-
(
void
)
boost_viewWillDisappear
:(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
}
-
(
void
)
boost_viewDidDisappear
:(
BOOL
)
animated
{
[
super
viewDidDisappear
:
animated
];
}
-
(
UIEdgeInsets
)
paddingEdgeInsets
{
UIEdgeInsets
edgeInsets
=
UIEdgeInsetsZero
;
if
(
@available
(
iOS
11
,
*
))
{
edgeInsets
=
UIEdgeInsetsMake
(
0
,
self
.
view
.
safeAreaInsets
.
left
,
self
.
view
.
safeAreaInsets
.
bottom
,
self
.
view
.
safeAreaInsets
.
right
);
}
else
{
edgeInsets
=
UIEdgeInsetsZero
;
}
return
edgeInsets
;
}
-
(
void
)
installSplashScreenViewIfNecessary
{
//Override this to avoid unnecessary splash Screen.
}
-
(
void
)
fixed_onAccessibilityStatusChanged
:(
NSNotification
*
)
notification
{
if
(
self
.
accessibilityEnable
){
[
self
fixed_onAccessibilityStatusChanged
:
notification
];
}
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBFlutterViewProvider.h
0 → 100755
View file @
78c23ac1
/*
* 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
;
NS_ASSUME_NONNULL_BEGIN
#define RELEASE_1_0 0
@protocol
FLBFlutterViewProvider
<
NSObject
>
@required
-
(
void
)
setAccessibilityEnable
:(
BOOL
)
enable
;
-
(
BOOL
)
accessibilityEnable
;
-
(
FlutterViewController
*
)
viewController
;
-
(
void
)
pause
;
-
(
void
)
resume
;
-
(
void
)
inactive
;
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBViewProviderFactory.h
0 → 100755
View file @
78c23ac1
/*
* 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 "FLBFlutterViewProvider.h"
#import "FLBPlatform.h"
NS_ASSUME_NONNULL_BEGIN
@interface
FLBViewProviderFactory
:
NSObject
-
(
id
<
FLBFlutterViewProvider
>
)
createViewProvider
;
-
(
id
<
FLBFlutterViewProvider
>
)
createViewProviderWithPlatform
:(
id
<
FLBPlatform
>
)
platform
;
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FLBViewProviderFactory.m
0 → 100755
View file @
78c23ac1
/*
* 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 "FLBViewProviderFactory.h"
#import "FLBFlutterEngine.h"
#import "FLBFlutterEngineOld.h"
#import "FLBPlatform.h"
@implementation
FLBViewProviderFactory
-
(
id
<
FLBFlutterViewProvider
>
)
createViewProviderWithPlatform
:(
id
<
FLBPlatform
>
)
platform
{
#if RELEASE_1_0
return
[
FLBFlutterEngine
new
];
#else
return
[[
FLBFlutterEngineOld
alloc
]
initWithPlatform
:
platform
];
#endif
}
-
(
id
<
FLBFlutterViewProvider
>
)
createViewProvider
{
#if RELEASE_1_0
return
[
FLBFlutterEngine
new
];
#else
return
[
FLBFlutterEngineOld
new
];
#endif
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FlutterBoostConfig.h
0 → 100755
View file @
78c23ac1
/*
* 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.
*/
NS_ASSUME_NONNULL_BEGIN
@interface
FlutterBoostConfig
:
NSObject
#pragma mark - Store first open page
//There are some cases first page messages could be lost.
//So we store the first page info for later usage.
+
(
instancetype
)
sharedInstance
;
@property
(
nonatomic
,
copy
)
NSString
*
fPagename
;
@property
(
nonatomic
,
copy
)
NSString
*
fPageId
;
@property
(
nonatomic
,
strong
)
NSDictionary
*
fParams
;
-
(
BOOL
)
firstView
;
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
Click to expand it.
ios/Classes/1.0/FlutterBoostConfig.m
0 → 100755
View file @
78c23ac1
/*
* 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 "FlutterBoostConfig.h"
@interface
FlutterBoostConfig
()
@property
(
nonatomic
,
assign
)
BOOL
firstView
;
@end
@implementation
FlutterBoostConfig
+
(
instancetype
)
sharedInstance
{
static
FlutterBoostConfig
*
instance
=
nil
;
static
dispatch_once_t
onceToken
;
dispatch_once
(
&
onceToken
,
^
{
instance
=
[
self
new
];
instance
.
firstView
=
YES
;
});
return
instance
;
}
-
(
void
)
setFPageId
:(
NSString
*
)
fPageId
{
_fPageId
=
fPageId
;
_firstView
=
NO
;
}
-
(
BOOL
)
firstView
{
return
_firstView
;
}
@end
This diff is collapsed.
Click to expand it.
ios/Classes/Boost/FLBAbstractFactory.h
View file @
78c23ac1
...
...
@@ -33,10 +33,8 @@ NS_ASSUME_NONNULL_BEGIN
@protocol
FLBAbstractFactory
<
NSObject
>
@required
-
(
id
<
FLBFlutterApplicationInterface
>
)
createApplication
:(
id
<
FLB2Platform
>
)
platform
;
-
(
id
<
FLB2FlutterProvider
>
)
createFlutterProvider
:(
id
<
FLB2Platform
>
)
platform
;
-
(
id
<
FLBFlutterContainer
>
)
createFlutterContainer
;
@end
...
...
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