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
1
Merge Requests
1
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
983669ee
Commit
983669ee
authored
Mar 31, 2020
by
余玠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add demo to log the flutter page's disposing event
parent
9961047f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
135 additions
and
7 deletions
+135
-7
example/lib/main.dart
example/lib/main.dart
+1
-0
example/lib/simple_page_widgets.dart
example/lib/simple_page_widgets.dart
+132
-7
lib/container/container_manager.dart
lib/container/container_manager.dart
+2
-0
No files found.
example/lib/main.dart
View file @
983669ee
...
...
@@ -19,6 +19,7 @@ class _MyAppState extends State<MyApp> {
FlutterBoost
.
singleton
.
registerPageBuilders
({
'embeded'
:
(
pageName
,
params
,
_
)=>
EmbededFirstRouteWidget
(),
'first'
:
(
pageName
,
params
,
_
)
=>
FirstRouteWidget
(),
'firstFirst'
:
(
pageName
,
params
,
_
)
=>
FirstFirstRouteWidget
(),
'second'
:
(
pageName
,
params
,
_
)
=>
SecondRouteWidget
(),
'tab'
:
(
pageName
,
params
,
_
)
=>
TabRouteWidget
(),
'platformView'
:
(
pageName
,
params
,
_
)
=>
PlatformRouteWidget
(),
...
...
example/lib/simple_page_widgets.dart
100755 → 100644
View file @
983669ee
...
...
@@ -3,7 +3,45 @@ import 'package:flutter/material.dart';
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:flutter_boost_example/platform_view.dart'
;
class
FirstRouteWidget
extends
StatelessWidget
{
class
FirstRouteWidget
extends
StatefulWidget
{
@override
State
<
StatefulWidget
>
createState
()
{
return
new
_FirstRouteWidgetState
();
}
}
class
_FirstRouteWidgetState
extends
State
<
FirstRouteWidget
>{
_FirstRouteWidgetState
();
@override
void
initState
()
{
print
(
'initState'
);
super
.
initState
();
}
@override
void
didChangeDependencies
()
{
print
(
'didChangeDependencies'
);
super
.
didChangeDependencies
();
}
@override
void
didUpdateWidget
(
FirstRouteWidget
oldWidget
)
{
print
(
'didUpdateWidget'
);
super
.
didUpdateWidget
(
oldWidget
);
}
@override
void
deactivate
()
{
print
(
'deactivate'
);
super
.
deactivate
();
}
@override
void
dispose
()
{
print
(
'[XDEBUG] - FirstRouteWidget is disposing~'
);
super
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
...
...
@@ -26,9 +64,18 @@ class FirstRouteWidget extends StatelessWidget {
});
},
),
RaisedButton
(
child:
Text
(
'Open second route'
),
RaisedButton
(
child:
Text
(
'Open FF route'
),
onPressed:
()
{
print
(
"open FF page!"
);
FlutterBoost
.
singleton
.
open
(
"firstFirst"
).
then
((
Map
value
)
{
print
(
"call me when page is finished. did recieve FF route result
$value
"
);
});
},
),
RaisedButton
(
child:
Text
(
'Open second route1'
),
onPressed:
()
{
print
(
"open second page!"
);
FlutterBoost
.
singleton
.
open
(
"second"
).
then
((
Map
value
)
{
...
...
@@ -54,14 +101,87 @@ class FirstRouteWidget extends StatelessWidget {
);
}
}
class
FirstFirstRouteWidget
extends
StatefulWidget
{
@override
State
<
StatefulWidget
>
createState
()
{
return
new
_FirstFirstRouteWidgetState
();
}
}
class
_FirstFirstRouteWidgetState
extends
State
<
FirstFirstRouteWidget
>{
_FirstFirstRouteWidgetState
();
@override
void
initState
()
{
print
(
'initState'
);
super
.
initState
();
}
@override
void
didChangeDependencies
()
{
print
(
'didChangeDependencies'
);
super
.
didChangeDependencies
();
}
@override
void
didUpdateWidget
(
FirstFirstRouteWidget
oldWidget
)
{
print
(
'didUpdateWidget'
);
super
.
didUpdateWidget
(
oldWidget
);
}
@override
void
deactivate
()
{
print
(
'deactivate'
);
super
.
deactivate
();
}
@override
void
dispose
()
{
print
(
'[XDEBUG] - FirstFirstRouteWidget is disposing~'
);
super
.
dispose
();
}
class
EmbededFirstRouteWidget
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
'First Route'
),
),
body:
Center
(
child:
RaisedButton
(
child:
Text
(
'Open second route'
),
child:
Text
(
'Open first route'
),
onPressed:
()
{
print
(
"open first page again!"
);
FlutterBoost
.
singleton
.
open
(
"first"
).
then
((
Map
value
){
print
(
"did recieve first route result"
);
print
(
"did recieve first route result
$value
"
);
});
},
),
),
);
}
}
class
EmbededFirstRouteWidget
extends
StatefulWidget
{
@override
State
<
StatefulWidget
>
createState
()
{
// TODO: implement createState
return
_EmbededFirstRouteWidgetState
();
}
}
class
_EmbededFirstRouteWidgetState
extends
State
<
EmbededFirstRouteWidget
>
{
@override
Widget
build
(
BuildContext
context
)
{
print
(
'_EmbededFirstRouteWidgetState build called!'
);
return
Scaffold
(
body:
Center
(
child:
RaisedButton
(
child:
Text
(
'Open second route2'
),
onPressed:
()
{
print
(
"open second page!"
);
FlutterBoost
.
singleton
.
open
(
"second"
).
then
((
Map
value
)
{
...
...
@@ -73,6 +193,11 @@ class EmbededFirstRouteWidget extends StatelessWidget {
),
);
}
@override
void
dispose
()
{
print
(
'[XDEBUG]:_EmbededFirstRouteWidgetState dispose called!'
);
super
.
dispose
();
}
}
class
SecondRouteWidget
extends
StatelessWidget
{
...
...
@@ -111,7 +236,7 @@ class TabRouteWidget extends StatelessWidget {
onPressed:
()
{
FlutterBoost
.
singleton
.
open
(
"second"
);
},
child:
Text
(
'Open second route'
),
child:
Text
(
'Open second route
3
'
),
),
),
);
...
...
lib/container/container_manager.dart
View file @
983669ee
...
...
@@ -183,9 +183,11 @@ class ContainerManagerState extends State<BoostContainerManager> {
if
(
SchedulerBinding
.
instance
.
schedulerPhase
==
SchedulerPhase
.
persistentCallbacks
)
{
SchedulerBinding
.
instance
.
addPostFrameCallback
((
Duration
duration
)
{
Logger
.
log
(
'_refreshOverlayEntries in addPostFrameCallback'
);
_refreshOverlayEntries
();
});
}
else
{
Logger
.
log
(
'_refreshOverlayEntries in setState'
);
_refreshOverlayEntries
();
}
...
...
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