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
fae46f29
Commit
fae46f29
authored
Jun 20, 2019
by
Jidong Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ios open close opt
parent
b393b000
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
232 additions
and
55 deletions
+232
-55
example/ios/Podfile.lock
example/ios/Podfile.lock
+1
-1
example/ios/Runner.xcodeproj/project.pbxproj
example/ios/Runner.xcodeproj/project.pbxproj
+0
-4
example/ios/Runner/DemoRouter.h
example/ios/Runner/DemoRouter.h
+2
-2
example/ios/Runner/DemoRouter.m
example/ios/Runner/DemoRouter.m
+62
-4
example/ios/Runner/UIViewControllerDemo.m
example/ios/Runner/UIViewControllerDemo.m
+1
-3
example/lib/simple_page_widgets.dart
example/lib/simple_page_widgets.dart
+6
-5
ios/Classes/1.0/FLBFlutterApplication.m
ios/Classes/1.0/FLBFlutterApplication.m
+14
-0
ios/Classes/1.0/FLBFlutterViewContainer.m
ios/Classes/1.0/FLBFlutterViewContainer.m
+0
-10
ios/Classes/1.5/FLB2FlutterApplication.m
ios/Classes/1.5/FLB2FlutterApplication.m
+56
-3
ios/Classes/Boost/FLB2Platform.h
ios/Classes/Boost/FLB2Platform.h
+1
-1
ios/Classes/Boost/FLBFlutterApplicationInterface.h
ios/Classes/Boost/FLBFlutterApplicationInterface.h
+10
-1
ios/Classes/Boost/FLBTypes.h
ios/Classes/Boost/FLBTypes.h
+33
-0
ios/Classes/Boost/FlutterBoostPlugin.h
ios/Classes/Boost/FlutterBoostPlugin.h
+1
-1
ios/Classes/Boost/FlutterBoostPlugin_private.h
ios/Classes/Boost/FlutterBoostPlugin_private.h
+2
-0
ios/Classes/Messaging/Generated/NavigationService/service/Service_NavigationService.mm
...ed/NavigationService/service/Service_NavigationService.mm
+8
-0
ios/Classes/Messaging/base/FLBBroadcastor.h
ios/Classes/Messaging/base/FLBBroadcastor.h
+1
-4
ios/flutter_boost.podspec
ios/flutter_boost.podspec
+1
-1
lib/flutter_boost.dart
lib/flutter_boost.dart
+23
-4
lib/messaging/message_proxy.dart
lib/messaging/message_proxy.dart
+5
-5
lib/messaging/service/navigation_service.dart
lib/messaging/service/navigation_service.dart
+3
-3
lib/router/router.dart
lib/router/router.dart
+2
-3
No files found.
example/ios/Podfile.lock
View file @
fae46f29
...
@@ -20,7 +20,7 @@ EXTERNAL SOURCES:
...
@@ -20,7 +20,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
SPEC CHECKSUMS:
Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296
Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296
flutter_boost:
a018687cd20f74f410a6ab17bd33187f5f31f8fd
flutter_boost:
e6949ea7bf22ad0766867b631996c2a7afa1a710
xservice_kit: a86c64372b3e41e7d8e9b1a0b9139866680f525c
xservice_kit: a86c64372b3e41e7d8e9b1a0b9139866680f525c
PODFILE CHECKSUM: 2a757a7bdc03b37a2814666652fdff1cf694243f
PODFILE CHECKSUM: 2a757a7bdc03b37a2814666652fdff1cf694243f
...
...
example/ios/Runner.xcodeproj/project.pbxproj
View file @
fae46f29
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
/* Begin PBXBuildFile section */
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2
/* GeneratedPluginRegistrant.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
1498D2331E8E89220040F4C2
/* GeneratedPluginRegistrant.m */
;
};
1498D2341E8E89220040F4C2
/* GeneratedPluginRegistrant.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
1498D2331E8E89220040F4C2
/* GeneratedPluginRegistrant.m */
;
};
2D5378261FAA1A9400D5DBA9
/* flutter_assets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2D5378251FAA1A9400D5DBA9
/* flutter_assets */
;
};
3B3967161E833CAA004F5970
/* AppFrameworkInfo.plist in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3B3967151E833CAA004F5970
/* AppFrameworkInfo.plist */
;
};
3B3967161E833CAA004F5970
/* AppFrameworkInfo.plist in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3B3967151E833CAA004F5970
/* AppFrameworkInfo.plist */
;
};
3B80C3941E831B6300D905FE
/* App.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3B80C3931E831B6300D905FE
/* App.framework */
;
};
3B80C3941E831B6300D905FE
/* App.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3B80C3931E831B6300D905FE
/* App.framework */
;
};
3B80C3951E831B6300D905FE
/* App.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3B80C3931E831B6300D905FE
/* App.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
3B80C3951E831B6300D905FE
/* App.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3B80C3931E831B6300D905FE
/* App.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
...
@@ -45,7 +44,6 @@
...
@@ -45,7 +44,6 @@
/* Begin PBXFileReference section */
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2
/* GeneratedPluginRegistrant.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
GeneratedPluginRegistrant.h
;
sourceTree
=
"<group>"
;
};
1498D2321E8E86230040F4C2
/* GeneratedPluginRegistrant.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
GeneratedPluginRegistrant.h
;
sourceTree
=
"<group>"
;
};
1498D2331E8E89220040F4C2
/* GeneratedPluginRegistrant.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GeneratedPluginRegistrant.m
;
sourceTree
=
"<group>"
;
};
1498D2331E8E89220040F4C2
/* GeneratedPluginRegistrant.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
GeneratedPluginRegistrant.m
;
sourceTree
=
"<group>"
;
};
2D5378251FAA1A9400D5DBA9
/* flutter_assets */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
folder
;
name
=
flutter_assets
;
path
=
Flutter/flutter_assets
;
sourceTree
=
SOURCE_ROOT
;
};
3B3967151E833CAA004F5970
/* AppFrameworkInfo.plist */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.plist.xml
;
name
=
AppFrameworkInfo.plist
;
path
=
Flutter/AppFrameworkInfo.plist
;
sourceTree
=
"<group>"
;
};
3B3967151E833CAA004F5970
/* AppFrameworkInfo.plist */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.plist.xml
;
name
=
AppFrameworkInfo.plist
;
path
=
Flutter/AppFrameworkInfo.plist
;
sourceTree
=
"<group>"
;
};
3B80C3931E831B6300D905FE
/* App.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
App.framework
;
path
=
Flutter/App.framework
;
sourceTree
=
"<group>"
;
};
3B80C3931E831B6300D905FE
/* App.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
App.framework
;
path
=
Flutter/App.framework
;
sourceTree
=
"<group>"
;
};
7AFA3C8E1D35360C0083082E
/* Release.xcconfig */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.xcconfig
;
name
=
Release.xcconfig
;
path
=
Flutter/Release.xcconfig
;
sourceTree
=
"<group>"
;
};
7AFA3C8E1D35360C0083082E
/* Release.xcconfig */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.xcconfig
;
name
=
Release.xcconfig
;
path
=
Flutter/Release.xcconfig
;
sourceTree
=
"<group>"
;
};
...
@@ -105,7 +103,6 @@
...
@@ -105,7 +103,6 @@
9740EEB11CF90186004384FC
/* Flutter */
=
{
9740EEB11CF90186004384FC
/* Flutter */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
2D5378251FAA1A9400D5DBA9
/* flutter_assets */
,
3B80C3931E831B6300D905FE
/* App.framework */
,
3B80C3931E831B6300D905FE
/* App.framework */
,
3B3967151E833CAA004F5970
/* AppFrameworkInfo.plist */
,
3B3967151E833CAA004F5970
/* AppFrameworkInfo.plist */
,
9740EEBA1CF902C7004384FC
/* Flutter.framework */
,
9740EEBA1CF902C7004384FC
/* Flutter.framework */
,
...
@@ -232,7 +229,6 @@
...
@@ -232,7 +229,6 @@
3B3967161E833CAA004F5970
/* AppFrameworkInfo.plist in Resources */
,
3B3967161E833CAA004F5970
/* AppFrameworkInfo.plist in Resources */
,
9740EEB41CF90195004384FC
/* Debug.xcconfig in Resources */
,
9740EEB41CF90195004384FC
/* Debug.xcconfig in Resources */
,
97C146FE1CF9000F007C117D
/* Assets.xcassets in Resources */
,
97C146FE1CF9000F007C117D
/* Assets.xcassets in Resources */
,
2D5378261FAA1A9400D5DBA9
/* flutter_assets in Resources */
,
97C146FC1CF9000F007C117D
/* Main.storyboard in Resources */
,
97C146FC1CF9000F007C117D
/* Main.storyboard in Resources */
,
);
);
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
...
...
example/ios/Runner/DemoRouter.h
View file @
fae46f29
...
@@ -8,11 +8,11 @@
...
@@ -8,11 +8,11 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
#import <flutter_boost/F
LBPlatform
.h>
#import <flutter_boost/F
lutterBoost
.h>
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
@interface
DemoRouter
:
NSObject
<
FLBPlatform
>
@interface
DemoRouter
:
NSObject
<
FLB
2
Platform
>
@property
(
nonatomic
,
strong
)
UINavigationController
*
navigationController
;
@property
(
nonatomic
,
strong
)
UINavigationController
*
navigationController
;
...
...
example/ios/Runner/DemoRouter.m
View file @
fae46f29
...
@@ -21,11 +21,64 @@
...
@@ -21,11 +21,64 @@
return
instance
;
return
instance
;
}
}
// Boost 2 switch
-
(
BOOL
)
userBoost2
{
return
YES
;
}
#pragma mark - Boost 2
-
(
void
)
open
:(
NSString
*
)
name
urlParams
:(
NSDictionary
*
)
params
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
))
completion
{
BOOL
animated
=
[
exts
[
@"animated"
]
boolValue
];
animated
=
YES
;
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
)
close
:(
NSString
*
)
uid
result
:(
NSDictionary
*
)
result
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
))
completion
{
BOOL
animated
=
[
exts
[
@"animated"
]
boolValue
];
animated
=
YES
;
FLBFlutterViewContainer
*
vc
=
(
id
)
self
.
navigationController
.
presentedViewController
;
if
([
vc
isKindOfClass
:
FLBFlutterViewContainer
.
class
]
&&
[
vc
.
uniqueIDString
isEqual
:
uid
]){
[
vc
dismissViewControllerAnimated
:
animated
completion
:
^
{}];
}
else
{
[
self
.
navigationController
popViewControllerAnimated
:
animated
];
}
}
#pragma mark - Boost 1
-
(
void
)
openPage
:(
NSString
*
)
name
-
(
void
)
openPage
:(
NSString
*
)
name
params
:(
NSDictionary
*
)
params
params
:(
NSDictionary
*
)
params
animated
:(
BOOL
)
animated
animated
:(
BOOL
)
animated
completion
:(
void
(
^
)(
BOOL
))
completion
completion
:(
void
(
^
)(
BOOL
))
completion
{
{
if
([
self
userBoost2
]){
NSMutableDictionary
*
exts
=
NSMutableDictionary
.
new
;
exts
[
@"url"
]
=
name
;
exts
[
@"params"
]
=
params
;
exts
[
@"animated"
]
=
@
(
animated
);
[
self
open
:
name
urlParams
:
params
exts
:
exts
completion
:
completion
];
return
;
}
if
([
params
[
@"present"
]
boolValue
]){
if
([
params
[
@"present"
]
boolValue
]){
FLBFlutterViewContainer
*
vc
=
FLBFlutterViewContainer
.
new
;
FLBFlutterViewContainer
*
vc
=
FLBFlutterViewContainer
.
new
;
[
vc
setName
:
name
params
:
params
];
[
vc
setName
:
name
params
:
params
];
...
@@ -40,14 +93,19 @@
...
@@ -40,14 +93,19 @@
}
}
}
}
-
(
BOOL
)
accessibilityEnable
{
return
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
userBoost2
]){
NSMutableDictionary
*
exts
=
NSMutableDictionary
.
new
;
exts
[
@"params"
]
=
params
;
exts
[
@"animated"
]
=
@
(
animated
);
[
self
close
:
uid
result
:@{}
exts
:
exts
completion
:
completion
];
return
;
}
FLBFlutterViewContainer
*
vc
=
(
id
)
self
.
navigationController
.
presentedViewController
;
FLBFlutterViewContainer
*
vc
=
(
id
)
self
.
navigationController
.
presentedViewController
;
if
([
vc
isKindOfClass
:
FLBFlutterViewContainer
.
class
]
&&
[
vc
.
uniqueIDString
isEqual
:
uid
]){
if
([
vc
isKindOfClass
:
FLBFlutterViewContainer
.
class
]
&&
[
vc
.
uniqueIDString
isEqual
:
uid
]){
[
vc
dismissViewControllerAnimated
:
animated
completion
:
^
{}];
[
vc
dismissViewControllerAnimated
:
animated
completion
:
^
{}];
...
...
example/ios/Runner/UIViewControllerDemo.m
View file @
fae46f29
...
@@ -26,9 +26,7 @@
...
@@ -26,9 +26,7 @@
-
(
IBAction
)
pushFlutterPage
:(
id
)
sender
{
-
(
IBAction
)
pushFlutterPage
:(
id
)
sender
{
[
DemoRouter
.
sharedRouter
openPage
:
@"first"
params
:@{}
animated
:
YES
completion
:^
(
BOOL
f
){
[
DemoRouter
.
sharedRouter
openPage
:
@"first"
params
:@{}
animated
:
YES
completion
:^
(
BOOL
f
){
[
FlutterBoostPlugin
.
sharedInstance
onResultForKey
:
@"result_id_100"
resultData
:@{}
params
:
@{}];
}];
}];
}
}
...
...
example/lib/simple_page_widgets.dart
View file @
fae46f29
...
@@ -13,8 +13,10 @@ class FirstRouteWidget extends StatelessWidget {
...
@@ -13,8 +13,10 @@ class FirstRouteWidget extends StatelessWidget {
child:
Text
(
'Open second route'
),
child:
Text
(
'Open second route'
),
onPressed:
()
{
onPressed:
()
{
FlutterBoost
.
singleton
.
openPage
(
"second"
,
{},
animated:
true
,
resultHandler:
(
String
key
,
Map
<
dynamic
,
dynamic
>
result
){
print
(
"open second page!"
);
print
(
"did recieve second route result
$key
$result
"
);
FlutterBoost
.
singleton
.
open
(
"second"
).
then
((
Map
value
){
print
(
"did recieve second route result"
);
print
(
"did recieve second route result
$value
"
);
});
});
},
},
...
@@ -39,12 +41,11 @@ class SecondRouteWidget extends StatelessWidget {
...
@@ -39,12 +41,11 @@ class SecondRouteWidget extends StatelessWidget {
BoostContainerSettings
settings
=
BoostContainer
.
of
(
context
).
settings
;
BoostContainerSettings
settings
=
BoostContainer
.
of
(
context
).
settings
;
if
(
settings
.
params
.
containsKey
(
"result_id"
)){
if
(
settings
.
params
.
containsKey
(
"result_id"
)){
String
rid
=
settings
.
params
[
"result_id"
];
String
rid
=
settings
.
params
[
"result_id"
];
FlutterBoost
.
singleton
.
onPageResult
(
rid
,
{
"data"
:
"works"
},{});
}
}
FlutterBoost
.
singleton
.
close
PageForContext
(
context
);
FlutterBoost
.
singleton
.
close
(
settings
.
uniqueId
,
result:
{
"result"
:
"data from second"
}
);
},
},
child:
Text
(
'Go back!'
),
child:
Text
(
'Go back
with result
!'
),
),
),
),
),
);
);
...
...
ios/Classes/1.0/FLBFlutterApplication.m
View file @
fae46f29
...
@@ -154,4 +154,18 @@
...
@@ -154,4 +154,18 @@
completion:
completion
];
completion:
completion
];
}
}
-
(
void
)
didInitPageContainer
:(
NSString
*
)
url
params
:(
NSDictionary
*
)
urlParams
uniqueId
:(
NSString
*
)
uniqueId
{
}
-
(
void
)
willDeallocPageContainer
:(
NSString
*
)
url
params
:(
NSDictionary
*
)
params
uniqueId
:(
NSString
*
)
uniqueId
{
}
@end
@end
ios/Classes/1.0/FLBFlutterViewContainer.m
View file @
fae46f29
...
@@ -391,15 +391,5 @@ static NSUInteger kInstanceCounter = 0;
...
@@ -391,15 +391,5 @@ static NSUInteger kInstanceCounter = 0;
self
.
interactiveGestureActive
=
NO
;
self
.
interactiveGestureActive
=
NO
;
}
}
#pragma mark - FLBViewControllerResultHandler
-
(
void
)
onRecievedResult
:(
NSDictionary
*
)
resultData
forKey
:(
NSString
*
)
key
{
[
Service_NavigationService
onNativePageResult
:
^
(
NSNumber
*
finished
)
{}
uniqueId:
self
.
uniqueIDString
key:
key
resultData:
resultData
params:
@{}];
}
@end
@end
ios/Classes/1.5/FLB2FlutterApplication.m
View file @
fae46f29
...
@@ -32,6 +32,10 @@
...
@@ -32,6 +32,10 @@
@property
(
nonatomic
,
strong
)
id
<
FLB2FlutterProvider
>
viewProvider
;
@property
(
nonatomic
,
strong
)
id
<
FLB2FlutterProvider
>
viewProvider
;
@property
(
nonatomic
,
assign
)
BOOL
isRunning
;
@property
(
nonatomic
,
assign
)
BOOL
isRunning
;
@property
(
nonatomic
,
strong
)
NSMutableDictionary
*
pageResultCallbacks
;
@property
(
nonatomic
,
strong
)
NSMutableDictionary
*
callbackCache
;
@end
@end
...
@@ -73,6 +77,8 @@
...
@@ -73,6 +77,8 @@
{
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
_manager
=
[
FLBFlutterContainerManager
new
];
_manager
=
[
FLBFlutterContainerManager
new
];
_pageResultCallbacks
=
NSMutableDictionary
.
new
;
_callbackCache
=
NSMutableDictionary
.
new
;
}
}
return
self
;
return
self
;
}
}
...
@@ -129,19 +135,66 @@
...
@@ -129,19 +135,66 @@
return
self
.
flutterProvider
.
engine
.
viewController
;
return
self
.
flutterProvider
.
engine
.
viewController
;
}
}
-
(
void
)
close
:(
NSString
*
)
u
i
d
-
(
void
)
close
:(
NSString
*
)
u
niqueI
d
result
:(
NSDictionary
*
)
result
result
:(
NSDictionary
*
)
result
exts
:(
NSDictionary
*
)
exts
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
))
completion
{
completion
:(
void
(
^
)(
BOOL
))
completion
{
[
self
.
platform
close
:
uniqueId
result:
result
exts:
exts
completion:
completion
];
if
(
_pageResultCallbacks
[
uniqueId
]){
void
(
^
cb
)(
NSDictionary
*
)
=
_pageResultCallbacks
[
uniqueId
];
cb
(
result
);
[
_pageResultCallbacks
removeObjectForKey
:
uniqueId
];
}
}
}
-
(
void
)
open
:(
NSString
*
)
url
-
(
void
)
open
:(
NSString
*
)
url
urlParams
:(
NSDictionary
*
)
urlParams
urlParams
:(
NSDictionary
*
)
urlParams
exts
:(
NSDictionary
*
)
exts
exts
:(
NSDictionary
*
)
exts
reult
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
reult
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
completion
:(
void
(
^
)(
BOOL
))
completion
{
completion
:(
void
(
^
)(
BOOL
))
completion
{
NSString
*
cid
=
urlParams
[
@"__calback_id__"
];
if
(
!
cid
){
static
int64_t
sCallbackID
=
1
;
cid
=
@
(
sCallbackID
).
stringValue
;
sCallbackID
+=
2
;
}
_callbackCache
[
cid
]
=
resultCallback
;
[
self
.
platform
open
:
url
urlParams:
urlParams
exts:
exts
completion:
completion
];
}
-
(
void
)
didInitPageContainer
:(
NSString
*
)
url
params
:(
NSDictionary
*
)
urlParams
uniqueId
:(
NSString
*
)
uniqueId
{
NSString
*
cid
=
urlParams
[
@"__calback_id__"
];
if
(
cid
&&
_callbackCache
[
cid
]){
_pageResultCallbacks
[
uniqueId
]
=
_callbackCache
[
cid
];
[
_callbackCache
removeObjectForKey
:
cid
];
}
}
-
(
void
)
willDeallocPageContainer
:(
NSString
*
)
url
params
:(
NSDictionary
*
)
params
uniqueId
:(
NSString
*
)
uniqueId
{
if
(
_pageResultCallbacks
[
uniqueId
]){
void
(
^
cb
)(
NSDictionary
*
)
=
_pageResultCallbacks
[
uniqueId
];
cb
(@{});
[
_pageResultCallbacks
removeObjectForKey
:
uniqueId
];
}
}
}
@end
@end
ios/Classes/Boost/FLB2Platform.h
View file @
fae46f29
...
@@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
@required
@required
-
(
void
)
open
:(
NSString
*
)
url
-
(
void
)
open
:(
NSString
*
)
url
urlParams
:(
NSDictionary
*
)
urlParams
urlParams
:(
NSDictionary
*
)
urlParams
exts
:(
BOOL
)
animated
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
finished
))
completion
;
completion
:(
void
(
^
)(
BOOL
finished
))
completion
;
-
(
void
)
close
:(
NSString
*
)
uid
-
(
void
)
close
:(
NSString
*
)
uid
...
...
ios/Classes/Boost/FLBFlutterApplicationInterface.h
View file @
fae46f29
...
@@ -56,7 +56,7 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -56,7 +56,7 @@ NS_ASSUME_NONNULL_BEGIN
-
(
void
)
inactive
;
-
(
void
)
inactive
;
-
(
BOOL
)
isRunning
;
-
(
BOOL
)
isRunning
;
#pragma mark - handle
close/open
messages
#pragma mark - handle messages
-
(
void
)
close
:(
NSString
*
)
uid
-
(
void
)
close
:(
NSString
*
)
uid
result
:(
NSDictionary
*
)
result
result
:(
NSDictionary
*
)
result
...
@@ -69,6 +69,15 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -69,6 +69,15 @@ NS_ASSUME_NONNULL_BEGIN
reult
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
reult
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
completion
:(
void
(
^
)(
BOOL
))
completion
;
completion
:(
void
(
^
)(
BOOL
))
completion
;
-
(
void
)
didInitPageContainer
:(
NSString
*
)
url
params
:(
NSDictionary
*
)
urlParams
uniqueId
:(
NSString
*
)
uniqueId
;
-
(
void
)
willDeallocPageContainer
:(
NSString
*
)
url
params
:(
NSDictionary
*
)
params
uniqueId
:(
NSString
*
)
uniqueId
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
...
...
ios/Classes/Boost/FLBTypes.h
0 → 100644
View file @
fae46f29
/*
* 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.
*/
#ifndef FLBTypes_h
#define FLBTypes_h
typedef
void
(
^
FLBEventListener
)
(
NSString
*
name
,
NSDictionary
*
arguments
);
typedef
void
(
^
FLBVoidCallback
)(
void
);
#endif
/* FLBTypes_h */
ios/Classes/Boost/FlutterBoostPlugin.h
View file @
fae46f29
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#import <Flutter/Flutter.h>
#import <Flutter/Flutter.h>
#import "FLB2Platform.h"
#import "FLB2Platform.h"
#import "FLB
Broadcastor
.h"
#import "FLB
Types
.h"
@interface
FlutterBoostPlugin
:
NSObject
<
FlutterPlugin
>
@interface
FlutterBoostPlugin
:
NSObject
<
FlutterPlugin
>
...
...
ios/Classes/Boost/FlutterBoostPlugin_private.h
View file @
fae46f29
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#import "FLBFlutterApplicationInterface.h"
#import "FLBFlutterApplicationInterface.h"
#import "FLBAbstractFactory.h"
#import "FLBAbstractFactory.h"
#import "FLBBroadcastor.h"
@interface
FlutterBoostPlugin
(){
@interface
FlutterBoostPlugin
(){
id
<
FLBFlutterApplicationInterface
>
_application
;
id
<
FLBFlutterApplicationInterface
>
_application
;
...
@@ -39,4 +40,5 @@
...
@@ -39,4 +40,5 @@
@property
(
nonatomic
,
copy
)
NSString
*
fPageId
;
@property
(
nonatomic
,
copy
)
NSString
*
fPageId
;
@property
(
nonatomic
,
copy
)
NSString
*
fPagename
;
@property
(
nonatomic
,
copy
)
NSString
*
fPagename
;
@property
(
nonatomic
,
strong
)
NSDictionary
*
fParams
;
@property
(
nonatomic
,
strong
)
NSDictionary
*
fParams
;
@end
@end
ios/Classes/Messaging/Generated/NavigationService/service/Service_NavigationService.mm
View file @
fae46f29
...
@@ -111,6 +111,10 @@
...
@@ -111,6 +111,10 @@
result
(
tTesult
);
result
(
tTesult
);
}
}
}];
}];
[
FlutterBoostPlugin
.
sharedInstance
.
application
didInitPageContainer
:
pageName
params:
params
uniqueId:
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
...
@@ -124,6 +128,10 @@
...
@@ -124,6 +128,10 @@
result
(
tTesult
);
result
(
tTesult
);
}
}
}];
}];
[
FlutterBoostPlugin
.
sharedInstance
.
application
willDeallocPageContainer
:
pageName
params:
params
uniqueId:
uniqueId
];
}
}
...
...
ios/Classes/Messaging/base/FLBBroadcastor.h
View file @
fae46f29
...
@@ -25,13 +25,10 @@
...
@@ -25,13 +25,10 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
#import <Flutter/Flutter.h>
#import <Flutter/Flutter.h>
#import "FLBTypes.h"
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
typedef
void
(
^
FLBEventListener
)
(
NSString
*
name
,
NSDictionary
*
arguments
);
typedef
void
(
^
FLBVoidCallback
)(
void
);
@interface
FLBBroadcastor
:
NSObject
@interface
FLBBroadcastor
:
NSObject
-
(
instancetype
)
initWithMethodChannel
:(
FlutterMethodChannel
*
)
channel
;
-
(
instancetype
)
initWithMethodChannel
:(
FlutterMethodChannel
*
)
channel
;
...
...
ios/flutter_boost.podspec
View file @
fae46f29
...
@@ -21,7 +21,7 @@ A new Flutter plugin make flutter better to use!
...
@@ -21,7 +21,7 @@ A new Flutter plugin make flutter better to use!
'Classes/Boost/FLB2Platform.h'
,
'Classes/Boost/FLB2Platform.h'
,
'Classes/Boost/FLBFlutterContainer.h'
,
'Classes/Boost/FLBFlutterContainer.h'
,
'Classes/Boost/FLBFlutterAppDelegate.h'
,
'Classes/Boost/FLBFlutterAppDelegate.h'
,
'Classes/Boost/FLB
Broadcastor
.h'
,
'Classes/Boost/FLB
Types
.h'
,
'Classes/1.0/FLBFlutterViewContainer.h'
,
'Classes/1.0/FLBFlutterViewContainer.h'
,
'Classes/1.5/FLB2FlutterViewContainer.h'
'Classes/1.5/FLB2FlutterViewContainer.h'
...
...
lib/flutter_boost.dart
View file @
fae46f29
...
@@ -27,7 +27,6 @@ import 'package:flutter/material.dart';
...
@@ -27,7 +27,6 @@ import 'package:flutter/material.dart';
import
'package:flutter_boost/messaging/service/navigation_service.dart'
;
import
'package:flutter_boost/messaging/service/navigation_service.dart'
;
import
'package:flutter_boost/container/boost_container.dart'
;
import
'package:flutter_boost/container/boost_container.dart'
;
import
'package:flutter_boost/container/container_manager.dart'
;
import
'package:flutter_boost/container/container_manager.dart'
;
import
'package:flutter_boost/messaging/page_result_mediator.dart'
;
import
'package:flutter_boost/router/router.dart'
;
import
'package:flutter_boost/router/router.dart'
;
import
'container/container_coordinator.dart'
;
import
'container/container_coordinator.dart'
;
...
@@ -64,6 +63,8 @@ class FlutterBoost {
...
@@ -64,6 +63,8 @@ class FlutterBoost {
final
MethodChannel
_methodChannel
=
MethodChannel
(
'flutter_boost'
);
final
MethodChannel
_methodChannel
=
MethodChannel
(
'flutter_boost'
);
final
MessageDispatcher
_dispatcher
=
MessageDispatcher
();
final
MessageDispatcher
_dispatcher
=
MessageDispatcher
();
int
_callbackID
=
0
;
Broadcastor
_broadcastor
;
Broadcastor
_broadcastor
;
static
FlutterBoost
get
singleton
=>
_instance
;
static
FlutterBoost
get
singleton
=>
_instance
;
...
@@ -131,11 +132,25 @@ class FlutterBoost {
...
@@ -131,11 +132,25 @@ class FlutterBoost {
ContainerCoordinator
.
singleton
.
registerPageBuilders
(
builders
);
ContainerCoordinator
.
singleton
.
registerPageBuilders
(
builders
);
}
}
Future
<
Map
<
String
,
dynamic
>>
open
(
String
url
,{
Map
<
String
,
dynamic
>
urlParams
,
Map
<
String
,
dynamic
>
exts
}){
Future
<
Map
<
dynamic
,
dynamic
>>
open
(
String
url
,{
Map
<
String
,
dynamic
>
urlParams
,
Map
<
String
,
dynamic
>
exts
}){
if
(
urlParams
==
null
)
{
urlParams
=
Map
();
}
if
(
exts
==
null
){
exts
=
Map
();
}
urlParams
[
"__calback_id__"
]
=
_callbackID
;
_callbackID
+=
2
;
return
_router
.
open
(
url
,
urlParams:
urlParams
,
exts:
exts
);
return
_router
.
open
(
url
,
urlParams:
urlParams
,
exts:
exts
);
}
}
Future
<
bool
>
close
(
String
id
,{
Map
<
String
,
dynamic
>
result
,
Map
<
String
,
dynamic
>
exts
}){
Future
<
bool
>
close
(
String
id
,{
Map
<
String
,
dynamic
>
result
,
Map
<
String
,
dynamic
>
exts
}){
if
(
result
==
null
)
{
result
=
Map
();
}
if
(
exts
==
null
){
exts
=
Map
();
}
return
_router
.
close
(
id
,
result:
result
,
exts:
exts
);
return
_router
.
close
(
id
,
result:
result
,
exts:
exts
);
}
}
...
@@ -149,10 +164,12 @@ class FlutterBoost {
...
@@ -149,10 +164,12 @@ class FlutterBoost {
_broadcastor
.
sendEvent
(
name
,
arguments
);
_broadcastor
.
sendEvent
(
name
,
arguments
);
}
}
Future
<
bool
>
openPage
(
String
name
,
Map
params
,{
bool
animated
})
{
Future
<
Map
<
String
,
dynamic
>
>
openPage
(
String
name
,
Map
params
,{
bool
animated
})
{
Map
<
String
,
dynamic
>
exts
=
Map
();
Map
<
String
,
dynamic
>
exts
=
Map
();
if
(
animated
!=
null
){
if
(
animated
!=
null
){
exts
[
"animated"
]
=
animated
;
exts
[
"animated"
]
=
animated
;
}
else
{
exts
[
"animated"
]
=
true
;
}
}
return
open
(
name
,
urlParams:
params
,
exts:
exts
);
return
open
(
name
,
urlParams:
params
,
exts:
exts
);
}
}
...
@@ -163,9 +180,11 @@ class FlutterBoost {
...
@@ -163,9 +180,11 @@ class FlutterBoost {
Map
<
String
,
dynamic
>
exts
=
Map
();
Map
<
String
,
dynamic
>
exts
=
Map
();
if
(
animated
!=
null
){
if
(
animated
!=
null
){
exts
[
"animated"
]
=
animated
;
exts
[
"animated"
]
=
animated
;
}
else
{
exts
[
"animated"
]
=
true
;
}
}
if
(
name
!=
null
){
if
(
url
!=
null
){
exts
[
"url"
]
=
url
;
exts
[
"url"
]
=
url
;
}
}
...
...
lib/messaging/message_proxy.dart
View file @
fae46f29
...
@@ -25,20 +25,20 @@ import 'package:flutter_boost/messaging/service/navigation_service.dart';
...
@@ -25,20 +25,20 @@ import 'package:flutter_boost/messaging/service/navigation_service.dart';
import
'dart:async'
;
import
'dart:async'
;
abstract
class
MessageProxy
{
abstract
class
MessageProxy
{
Future
<
Map
<
String
,
dynamic
>>
open
(
String
url
,{
Map
<
String
,
dynamic
>
urlParams
,
Map
<
String
,
dynamic
>
exts
});
Future
<
Map
<
dynamic
,
dynamic
>>
open
(
String
url
,{
Map
<
String
,
dynamic
>
urlParams
,
Map
<
String
,
dynamic
>
exts
});
void
close
(
String
id
,{
Map
<
String
,
dynamic
>
result
,
Map
<
String
,
dynamic
>
exts
});
Future
<
bool
>
close
(
String
id
,{
Map
<
String
,
dynamic
>
result
,
Map
<
String
,
dynamic
>
exts
});
}
}
class
MessageProxyImp
implements
MessageProxy
{
class
MessageProxyImp
implements
MessageProxy
{
@override
@override
Future
<
Map
<
String
,
dynamic
>>
open
(
String
url
,{
Map
<
String
,
dynamic
>
urlParams
,
Map
<
String
,
dynamic
>
exts
}){
Future
<
Map
<
dynamic
,
dynamic
>>
open
(
String
url
,{
Map
<
String
,
dynamic
>
urlParams
,
Map
<
String
,
dynamic
>
exts
}){
return
NavigationService
.
openPage
(
url
,
urlParams
,
exts
);
return
NavigationService
.
openPage
(
url
,
urlParams
,
exts
);
}
}
@override
@override
void
close
(
String
id
,{
Map
<
String
,
dynamic
>
result
,
Map
<
String
,
dynamic
>
exts
}){
Future
<
bool
>
close
(
String
id
,{
Map
<
String
,
dynamic
>
result
,
Map
<
String
,
dynamic
>
exts
}){
return
NavigationService
.
closePage
(
uniqueI
d
,
result:
result
,
exts:
exts
);
return
NavigationService
.
closePage
(
i
d
,
result:
result
,
exts:
exts
);
}
}
...
...
lib/messaging/service/navigation_service.dart
View file @
fae46f29
...
@@ -62,12 +62,12 @@ class NavigationService {
...
@@ -62,12 +62,12 @@ class NavigationService {
}
}
}
}
static
Future
<
Map
<
String
,
dynamic
>>
openPage
(
String
url
,
Map
urlParams
,
Map
exts
)
{
static
Future
<
Map
<
dynamic
,
dynamic
>>
openPage
(
String
url
,
Map
urlParams
,
Map
exts
)
{
Map
<
String
,
dynamic
>
properties
=
new
Map
<
String
,
dynamic
>();
Map
<
String
,
dynamic
>
properties
=
new
Map
<
String
,
dynamic
>();
properties
[
"url"
]=
url
;
properties
[
"url"
]=
url
;
properties
[
"urlParams"
]=
p
arams
;
properties
[
"urlParams"
]=
urlP
arams
;
properties
[
"exts"
]=
exts
;
properties
[
"exts"
]=
exts
;
return
methodChannel
.
invokeMethod
(
'openPage'
,
properties
).
then
<
Map
<
String
,
dynamic
>>((
value
){
return
methodChannel
.
invokeMethod
(
'openPage'
,
properties
).
then
<
Map
<
dynamic
,
dynamic
>>((
value
){
return
(
value
);
return
(
value
);
});
});
}
}
...
...
lib/router/router.dart
View file @
fae46f29
...
@@ -26,7 +26,6 @@ import 'dart:async';
...
@@ -26,7 +26,6 @@ import 'dart:async';
import
'package:flutter_boost/container/boost_container.dart'
;
import
'package:flutter_boost/container/boost_container.dart'
;
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:flutter_boost/messaging/message_proxy.dart'
;
import
'package:flutter_boost/messaging/message_proxy.dart'
;
import
'package:flutter_boost/messaging/page_result_mediator.dart'
;
import
'package:flutter_boost/support/logger.dart'
;
import
'package:flutter_boost/support/logger.dart'
;
class
Router
{
class
Router
{
...
@@ -39,7 +38,7 @@ class Router {
...
@@ -39,7 +38,7 @@ class Router {
}
}
Future
<
Map
<
String
,
dynamic
>>
open
(
String
url
,{
Map
<
String
,
dynamic
>
urlParams
,
Map
<
String
,
dynamic
>
exts
}){
Future
<
Map
<
dynamic
,
dynamic
>>
open
(
String
url
,{
Map
<
String
,
dynamic
>
urlParams
,
Map
<
String
,
dynamic
>
exts
}){
return
_msgProxy
.
open
(
url
,
urlParams:
urlParams
,
exts:
exts
);
return
_msgProxy
.
open
(
url
,
urlParams:
urlParams
,
exts:
exts
);
}
}
...
@@ -75,6 +74,6 @@ class Router {
...
@@ -75,6 +74,6 @@ class Router {
Map
<
String
,
dynamic
>
exts
=
Map
();
Map
<
String
,
dynamic
>
exts
=
Map
();
exts
[
"animated"
]
=
animated
;
exts
[
"animated"
]
=
animated
;
return
_msgProxy
.
close
(
i
d
,
result:
{}
,
exts:
exts
);
return
_msgProxy
.
close
(
settings
.
uniqueI
d
,
result:
{}
,
exts:
exts
);
}
}
}
}
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