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
74dac2ed
Commit
74dac2ed
authored
Mar 31, 2020
by
余玠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #625 on v1.12.13-hotfixes
parent
80d02b98
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
10 deletions
+69
-10
example/lib/main.dart
example/lib/main.dart
+1
-0
example/lib/simple_page_widgets.dart
example/lib/simple_page_widgets.dart
+50
-2
ios/Classes/Engine/FLBFlutterApplication.m
ios/Classes/Engine/FLBFlutterApplication.m
+1
-2
ios/Classes/Engine/FLBFlutterEngine.m
ios/Classes/Engine/FLBFlutterEngine.m
+1
-0
ios/Classes/container/FLBFlutterViewContainer.m
ios/Classes/container/FLBFlutterViewContainer.m
+13
-3
lib/container/container_coordinator.dart
lib/container/container_coordinator.dart
+3
-3
No files found.
example/lib/main.dart
View file @
74dac2ed
...
...
@@ -21,6 +21,7 @@ class _MyAppState extends State<MyApp> {
'first'
:
(
pageName
,
params
,
_
)
=>
FirstRouteWidget
(),
'firstFirst'
:
(
pageName
,
params
,
_
)
=>
FirstFirstRouteWidget
(),
'second'
:
(
pageName
,
params
,
_
)
=>
SecondRouteWidget
(),
'secondStateful'
:
(
pageName
,
params
,
_
)
=>
SecondStatefulRouteWidget
(),
'tab'
:
(
pageName
,
params
,
_
)
=>
TabRouteWidget
(),
'platformView'
:
(
pageName
,
params
,
_
)
=>
PlatformRouteWidget
(),
'flutterFragment'
:
(
pageName
,
params
,
_
)
=>
FragmentRouteWidget
(
params
),
...
...
example/lib/simple_page_widgets.dart
View file @
74dac2ed
...
...
@@ -60,7 +60,7 @@ class _FirstRouteWidgetState extends State<FirstRouteWidget>{
print
(
"open natve page!"
);
FlutterBoost
.
singleton
.
open
(
"native"
).
then
((
Map
value
)
{
print
(
"call me when page is finished. did recieve
second
route result
$value
"
);
"call me when page is finished. did recieve
native
route result
$value
"
);
});
},
),
...
...
@@ -85,6 +85,16 @@ class _FirstRouteWidgetState extends State<FirstRouteWidget>{
},
),
RaisedButton
(
child:
Text
(
'Present second stateful route'
),
onPressed:
()
{
print
(
"Present second stateful page!"
);
FlutterBoost
.
singleton
.
open
(
"secondStateful"
,
urlParams:
<
dynamic
,
dynamic
>{
"present"
:
true
}).
then
((
Map
value
)
{
print
(
"call me when page is finished. did recieve second stateful route result
$value
"
);
});
},
),
RaisedButton
(
child:
Text
(
'Present second route'
),
onPressed:
()
{
...
...
@@ -195,7 +205,44 @@ class _EmbededFirstRouteWidgetState extends State<EmbededFirstRouteWidget> {
}
@override
void
dispose
()
{
print
(
'[XDEBUG]:_EmbededFirstRouteWidgetState dispose called!'
);
print
(
'[XDEBUG]:_EmbededFirstRouteWidgetState disposing~'
);
super
.
dispose
();
}
}
class
SecondStatefulRouteWidget
extends
StatefulWidget
{
@override
State
<
StatefulWidget
>
createState
()
{
// TODO: implement createState
return
_SecondStatefulRouteWidgetState
();
}
}
class
_SecondStatefulRouteWidgetState
extends
State
<
SecondStatefulRouteWidget
>{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
"SecondStateful Route"
),
),
body:
Center
(
child:
RaisedButton
(
onPressed:
()
{
// Navigate back to first route when tapped.
BoostContainerSettings
settings
=
BoostContainer
.
of
(
context
).
settings
;
FlutterBoost
.
singleton
.
close
(
settings
.
uniqueId
,
result:
<
dynamic
,
dynamic
>{
"result"
:
"data from second"
});
},
child:
Text
(
'Go back with result!'
),
),
),
);
}
@override
void
dispose
()
{
print
(
'[XDEBUG]:SecondStatefulRouteWidget disposing~'
);
super
.
dispose
();
}
}
...
...
@@ -557,6 +604,7 @@ class _PushWidgetState extends State<PushWidget> {
@override
void
dispose
()
{
// TODO: implement dispose
print
(
'[XDEBUG] - PushWidget is disposing~'
);
super
.
dispose
();
_backPressedListenerUnsub
?.
call
();
}
...
...
ios/Classes/Engine/FLBFlutterApplication.m
View file @
74dac2ed
...
...
@@ -232,8 +232,7 @@
NSString
*
oldName
=
params
[
@"oldName"
];
NSString
*
newName
=
params
[
@"newName"
];
if
(
oldName
!=
nil
&&
[
newName
isEqualToString
:
@"default"
])
{
FLBFlutterViewContainer
*
viewController
=
(
FLBFlutterViewContainer
*
)
self
.
flutterProvider
.
engine
.
viewController
;
[
viewController
surfaceUpdated
:
NO
];
[
self
.
flutterProvider
detach
];
}
}
...
...
ios/Classes/Engine/FLBFlutterEngine.m
View file @
74dac2ed
...
...
@@ -108,6 +108,7 @@
-
(
void
)
detach
{
if
(
_engine
.
viewController
!=
_dummy
){
[(
FLBFlutterViewContainer
*
)
_engine
.
viewController
surfaceUpdated
:
NO
];
_engine
.
viewController
=
_dummy
;
}
}
...
...
ios/Classes/container/FLBFlutterViewContainer.m
View file @
74dac2ed
...
...
@@ -157,23 +157,33 @@ static NSUInteger kInstanceCounter = 0;
}
-
(
void
)
willMoveToParentViewController
:(
UIViewController
*
)
parent
{
if
(
parent
)
{
if
(
parent
&&
_name
)
{
//当VC将要被移动到Parent中的时候,才出发flutter层面的page init
[
BoostMessageChannel
didInitPageContainer
:
^
(
NSNumber
*
r
)
{}
pageName:
_name
params:
_params
uniqueId:
[
self
uniqueIDString
]];
}
[
super
willMoveToParentViewController
:
parent
];
}
-
(
void
)
didMoveToParentViewController
:(
UIViewController
*
)
parent
{
if
(
!
parent
)
{
//当VC被移出parent时,就通知flutter层销毁page
[
self
notifyWillDealloc
];
}
[
super
didMoveToParentViewController
:
parent
];
}
-
(
void
)
dismissViewControllerAnimated
:(
BOOL
)
flag
completion
:(
void
(
^
)(
void
))
completion
{
[
super
dismissViewControllerAnimated
:
flag
completion
:
^
(){
if
(
completion
)
{
completion
();
}
//当VC被dismiss时,就通知flutter层销毁page
[
self
notifyWillDealloc
];
[
super
dismissViewControllerAnimated
:
flag
completion
:
completion
];
}
];
}
-
(
void
)
dealloc
...
...
lib/container/container_coordinator.dart
View file @
74dac2ed
...
...
@@ -102,7 +102,7 @@ class ContainerCoordinator {
Map
map
=
event
;
final
String
type
=
map
[
'type'
];
Logger
.
log
(
"onEvent
$type
"
);
Logger
.
log
(
'onEvent
$type
'
);
switch
(
type
)
{
//Handler back key pressed event.
...
...
@@ -242,7 +242,7 @@ class ContainerCoordinator {
ContainerLifeCycle
.
Appear
);
Logger
.
log
(
'native containner did show,
\n
manager dump:
\n
${FlutterBoost.containerManager?.dump()}
'
);
'native containner did show
-
$name
,
\n
manager dump:
\n
${FlutterBoost.containerManager?.dump()}
'
);
return
true
;
}
...
...
@@ -275,7 +275,7 @@ class ContainerCoordinator {
FlutterBoost
.
containerManager
?.
remove
(
pageId
);
Logger
.
log
(
'native containner dealloc,
\n
manager dump:
\n
${FlutterBoost.containerManager?.dump()}
'
);
'native containner dealloc
for
$name
,
\n
manager dump:
\n
${FlutterBoost.containerManager?.dump()}
'
);
return
true
;
}
...
...
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