Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
e880bd92
Commit
e880bd92
authored
Dec 16, 2015
by
Jason Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support application lifecycle state change events in the framework
parent
b8562aba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
material_app.dart
packages/flutter/lib/src/material/material_app.dart
+2
-0
binding.dart
packages/flutter/lib/src/widgets/binding.dart
+7
-0
pubspec.yaml
packages/flutter/pubspec.yaml
+2
-2
No files found.
packages/flutter/lib/src/material/material_app.dart
View file @
e880bd92
...
...
@@ -104,6 +104,8 @@ class _MaterialAppState extends State<MaterialApp> implements BindingObserver {
}
}
void
didChangeAppLifecycleState
(
ui
.
AppLifecycleState
state
)
{
}
final
HeroController
_heroController
=
new
HeroController
();
Route
_generateRoute
(
RouteSettings
settings
)
{
...
...
packages/flutter/lib/src/widgets/binding.dart
View file @
e880bd92
...
...
@@ -16,6 +16,7 @@ class BindingObserver {
bool
didPopRoute
()
=>
false
;
void
didChangeSize
(
Size
size
)
{
}
void
didChangeLocale
(
ui
.
Locale
locale
)
{
}
void
didChangeAppLifecycleState
(
ui
.
AppLifecycleState
state
)
{
}
}
/// A concrete binding for applications based on the Widgets framework.
...
...
@@ -39,6 +40,7 @@ class WidgetFlutterBinding extends BindingBase with Scheduler, Gesturer, Rendere
BuildableElement
.
scheduleBuildFor
=
scheduleBuildFor
;
ui
.
window
.
onLocaleChanged
=
handleLocaleChanged
;
ui
.
window
.
onPopRoute
=
handlePopRoute
;
ui
.
window
.
onAppLifecycleStateChanged
=
handleAppLifecycleStateChanged
;
}
/// The one static instance of this class.
...
...
@@ -79,6 +81,11 @@ class WidgetFlutterBinding extends BindingBase with Scheduler, Gesturer, Rendere
}
}
void
handleAppLifecycleStateChanged
(
ui
.
AppLifecycleState
state
)
{
for
(
BindingObserver
observer
in
_observers
)
observer
.
didChangeAppLifecycleState
(
state
);
}
void
beginFrame
()
{
buildDirtyElements
();
super
.
beginFrame
();
...
...
packages/flutter/pubspec.yaml
View file @
e880bd92
...
...
@@ -8,8 +8,8 @@ dependencies:
collection
:
'
>=1.1.3
<2.0.0'
intl
:
'
>=0.12.4+2
<0.13.0'
material_design_icons
:
'
>=0.0.3
<0.1.0'
sky_engine
:
0.0.7
3
sky_services
:
0.0.7
3
sky_engine
:
0.0.7
4
sky_services
:
0.0.7
4
vector_math
:
'
>=1.4.3
<2.0.0'
# See the comment in flutter_tools' pubspec.yaml. We have to pin 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