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
f5629d29
Commit
f5629d29
authored
Sep 18, 2019
by
余玠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixbug: 实现页面返回数据逻辑
parent
06866ee5
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
42 additions
and
53 deletions
+42
-53
example/ios/Runner/AppDelegate.m
example/ios/Runner/AppDelegate.m
+1
-1
example/ios/Runner/DemoRouter.h
example/ios/Runner/DemoRouter.h
+0
-5
example/ios/Runner/DemoRouter.m
example/ios/Runner/DemoRouter.m
+3
-33
example/ios/Runner/UIViewControllerDemo.m
example/ios/Runner/UIViewControllerDemo.m
+9
-10
ios/Classes/Boost/FLBPlatform.h
ios/Classes/Boost/FLBPlatform.h
+2
-0
ios/Classes/Boost/FlutterBoostPlugin.h
ios/Classes/Boost/FlutterBoostPlugin.h
+12
-0
ios/Classes/Boost/FlutterBoostPlugin.m
ios/Classes/Boost/FlutterBoostPlugin.m
+10
-0
ios/Classes/Engine/FLBFactory.m
ios/Classes/Engine/FLBFactory.m
+1
-1
ios/Classes/Engine/FLBFlutterApplication.h
ios/Classes/Engine/FLBFlutterApplication.h
+1
-1
ios/Classes/Engine/FLBFlutterApplication.m
ios/Classes/Engine/FLBFlutterApplication.m
+3
-2
No files found.
example/ios/Runner/AppDelegate.m
View file @
f5629d29
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
-
(
BOOL
)
application
:(
UIApplication
*
)
application
didFinishLaunchingWithOptions
:(
NSDictionary
*
)
launchOptions
-
(
BOOL
)
application
:(
UIApplication
*
)
application
didFinishLaunchingWithOptions
:(
NSDictionary
*
)
launchOptions
{
{
DemoRouter
*
router
=
[
DemoRouter
sharedRouter
];
DemoRouter
*
router
=
[
DemoRouter
new
];
[
FlutterBoostPlugin
.
sharedInstance
startFlutterWithPlatform
:
router
[
FlutterBoostPlugin
.
sharedInstance
startFlutterWithPlatform
:
router
onStart:
^
(
FlutterEngine
*
engine
)
{
onStart:
^
(
FlutterEngine
*
engine
)
{
...
...
example/ios/Runner/DemoRouter.h
View file @
f5629d29
...
@@ -15,12 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -15,12 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
@protocol
FLBPlatform
;
@protocol
FLBPlatform
;
@interface
DemoRouter
:
NSObject
<
FLBPlatform
>
@interface
DemoRouter
:
NSObject
<
FLBPlatform
>
@property
(
nonatomic
,
strong
)
UINavigationController
*
navigationController
;
@property
(
nonatomic
,
strong
)
UINavigationController
*
navigationController
;
+
(
DemoRouter
*
)
sharedRouter
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
example/ios/Runner/DemoRouter.m
View file @
f5629d29
...
@@ -9,17 +9,10 @@
...
@@ -9,17 +9,10 @@
#import "DemoRouter.h"
#import "DemoRouter.h"
#import <flutter_boost/FlutterBoost.h>
#import <flutter_boost/FlutterBoost.h>
@implementation
DemoRouter
@interface
DemoRouter
()
@end
+
(
DemoRouter
*
)
sharedRouter
@implementation
DemoRouter
{
static
id
instance
=
nil
;
static
dispatch_once_t
onceToken
;
dispatch_once
(
&
onceToken
,
^
{
instance
=
[[
self
alloc
]
init
];
});
return
instance
;
}
#pragma mark - Boost 1.5
#pragma mark - Boost 1.5
-
(
void
)
open
:(
NSString
*
)
name
-
(
void
)
open
:(
NSString
*
)
name
...
@@ -56,27 +49,4 @@
...
@@ -56,27 +49,4 @@
[
self
.
navigationController
popViewControllerAnimated
:
animated
];
[
self
.
navigationController
popViewControllerAnimated
:
animated
];
}
}
}
}
#pragma mark - Boost 1.0 - deprecated~
-
(
void
)
openPage
:(
NSString
*
)
name
params
:(
NSDictionary
*
)
params
animated
:(
BOOL
)
animated
completion
:(
void
(
^
)(
BOOL
))
completion
{
NSMutableDictionary
*
exts
=
NSMutableDictionary
.
new
;
exts
[
@"url"
]
=
name
;
exts
[
@"params"
]
=
params
;
exts
[
@"animated"
]
=
@
(
animated
);
[
self
open
:
name
urlParams
:
params
exts
:
exts
completion
:
completion
];
return
;
}
-
(
void
)
closePage
:(
NSString
*
)
uid
animated
:(
BOOL
)
animated
params
:(
NSDictionary
*
)
params
completion
:(
void
(
^
)(
BOOL
))
completion
{
NSMutableDictionary
*
exts
=
NSMutableDictionary
.
new
;
exts
[
@"params"
]
=
params
;
exts
[
@"animated"
]
=
@
(
animated
);
[
self
close
:
uid
result
:@{}
exts
:
exts
completion
:
completion
];
return
;
}
@end
@end
example/ios/Runner/UIViewControllerDemo.m
View file @
f5629d29
...
@@ -24,20 +24,19 @@
...
@@ -24,20 +24,19 @@
}
}
-
(
IBAction
)
pushFlutterPage
:(
id
)
sender
{
-
(
IBAction
)
pushFlutterPage
:(
id
)
sender
{
[
DemoRouter
.
sharedRouter
open
:
@"first"
[
FlutterBoostPlugin
open
:
@"first"
urlParams
:@{
kPageCallBackId
:
@"MycallbackId#1"
}
exts
:
@{
@"animated"
:
@
(
YES
)}
reult
:^
(
NSDictionary
*
result
)
{
urlParams:
@{}
NSLog
(
@"call me when page finished, and your result is:%@"
,
result
);
exts:
@{
@"animated"
:
@
(
YES
)}
}
completion
:^
(
BOOL
f
)
{
completion:
^
(
BOOL
f
){
NSLog
(
@"page is opened"
);
}];
}];
}
}
-
(
IBAction
)
present
:(
id
)
sender
{
-
(
IBAction
)
present
:(
id
)
sender
{
[
DemoRouter
.
sharedRouter
open
:
@"second"
[
FlutterBoostPlugin
open
:
@"second"
urlParams
:@{
@"present"
:
@
(
YES
),
kPageCallBackId
:
@"MycallbackId#2"
}
exts
:
@{
@"animated"
:
@
(
YES
)}
reult
:^
(
NSDictionary
*
result
)
{
urlParams:
@{
@"present"
:
@
(
YES
)}
NSLog
(
@"call me when page finished, and your result is:%@"
,
result
);
exts:
@{
@"animated"
:
@
(
YES
)}
}
completion
:^
(
BOOL
f
)
{
completion:
^
(
BOOL
f
){}]
;
NSLog
(
@"page is presented"
)
;
// [self dismissViewControllerAnimated:YES completion:completion
];
}
];
}
}
/*
/*
...
...
ios/Classes/Boost/FLBPlatform.h
View file @
f5629d29
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
#define kPageCallBackId @"__callback_id__"
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
@protocol
FLBPlatform
<
NSObject
>
@protocol
FLBPlatform
<
NSObject
>
@optional
@optional
...
...
ios/Classes/Boost/FlutterBoostPlugin.h
View file @
f5629d29
...
@@ -44,4 +44,16 @@
...
@@ -44,4 +44,16 @@
-
(
FLBVoidCallback
)
addEventListener
:(
FLBEventListener
)
listner
-
(
FLBVoidCallback
)
addEventListener
:(
FLBEventListener
)
listner
forName
:(
NSString
*
)
name
;
forName
:(
NSString
*
)
name
;
#pragma mark - open/close Page
+
(
void
)
close
:(
NSString
*
)
uniqueId
result
:(
NSDictionary
*
)
result
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
))
completion
;
+
(
void
)
open
:(
NSString
*
)
url
urlParams
:(
NSDictionary
*
)
urlParams
exts
:(
NSDictionary
*
)
exts
reult
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
completion
:(
void
(
^
)(
BOOL
))
completion
;
@end
@end
ios/Classes/Boost/FlutterBoostPlugin.m
View file @
f5629d29
...
@@ -162,4 +162,14 @@
...
@@ -162,4 +162,14 @@
forName:
name
];
forName:
name
];
}
}
#pragma mark - open/close Page
+
(
void
)
open
:(
NSString
*
)
url
urlParams
:(
NSDictionary
*
)
urlParams
exts
:(
NSDictionary
*
)
exts
reult
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
completion
:(
void
(
^
)(
BOOL
))
completion
{
id
<
FLBFlutterApplicationInterface
>
app
=
[[
FlutterBoostPlugin
sharedInstance
]
application
];
[
app
open
:
url
urlParams
:
urlParams
exts
:
exts
reult
:
resultCallback
completion
:
completion
];
}
+
(
void
)
close
:(
NSString
*
)
uniqueId
result
:(
NSDictionary
*
)
result
exts
:(
NSDictionary
*
)
exts
completion
:(
void
(
^
)(
BOOL
))
completion
{
id
<
FLBFlutterApplicationInterface
>
app
=
[[
FlutterBoostPlugin
sharedInstance
]
application
];
[
app
close
:
uniqueId
result
:
result
exts
:
exts
completion
:
completion
];
}
@end
@end
ios/Classes/Engine/FLBFactory.m
View file @
f5629d29
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
-
(
id
<
FLBFlutterApplicationInterface
>
)
createApplication
:(
id
<
FLBPlatform
>
)
platform
-
(
id
<
FLBFlutterApplicationInterface
>
)
createApplication
:(
id
<
FLBPlatform
>
)
platform
{
{
return
FLBFlutterApplication
.
new
;
return
[
FLBFlutterApplication
sharedApplication
]
;
}
}
-
(
id
<
FLBFlutterContainer
>
)
createFlutterContainer
-
(
id
<
FLBFlutterContainer
>
)
createFlutterContainer
...
...
ios/Classes/Engine/FLBFlutterApplication.h
View file @
f5629d29
...
@@ -30,6 +30,6 @@
...
@@ -30,6 +30,6 @@
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
@interface
FLBFlutterApplication
:
NSObject
<
FLBFlutterApplicationInterface
>
@interface
FLBFlutterApplication
:
NSObject
<
FLBFlutterApplicationInterface
>
@property
(
nonatomic
,
strong
)
id
<
FLBPlatform
>
platform
;
+
(
FLBFlutterApplication
*
)
sharedApplication
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
ios/Classes/Engine/FLBFlutterApplication.m
View file @
f5629d29
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
@implementation
FLBFlutterApplication
@implementation
FLBFlutterApplication
@synthesize
platform
;
+
(
FLBFlutterApplication
*
)
sharedApplication
+
(
FLBFlutterApplication
*
)
sharedApplication
{
{
...
@@ -173,7 +174,7 @@
...
@@ -173,7 +174,7 @@
reult
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
reult
:(
void
(
^
)(
NSDictionary
*
))
resultCallback
completion
:(
void
(
^
)(
BOOL
))
completion
completion
:(
void
(
^
)(
BOOL
))
completion
{
{
NSString
*
cid
=
urlParams
[
@"__calback_id__"
];
NSString
*
cid
=
urlParams
[
kPageCallBackId
];
if
(
!
cid
){
if
(
!
cid
){
static
int64_t
sCallbackID
=
1
;
static
int64_t
sCallbackID
=
1
;
...
@@ -193,7 +194,7 @@
...
@@ -193,7 +194,7 @@
params
:(
NSDictionary
*
)
urlParams
params
:(
NSDictionary
*
)
urlParams
uniqueId
:(
NSString
*
)
uniqueId
uniqueId
:(
NSString
*
)
uniqueId
{
{
NSString
*
cid
=
urlParams
[
@"__calback_id__"
];
NSString
*
cid
=
urlParams
[
kPageCallBackId
];
if
(
cid
&&
_callbackCache
[
cid
]){
if
(
cid
&&
_callbackCache
[
cid
]){
_pageResultCallbacks
[
uniqueId
]
=
_callbackCache
[
cid
];
_pageResultCallbacks
[
uniqueId
]
=
_callbackCache
[
cid
];
[
_callbackCache
removeObjectForKey
:
cid
];
[
_callbackCache
removeObjectForKey
:
cid
];
...
...
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