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
5fb69212
Commit
5fb69212
authored
Nov 01, 2016
by
Ian Hickson
Committed by
GitHub
Nov 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Loader improvements (#6615)
parent
a33b70ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
10 deletions
+35
-10
loader_app.dart
packages/flutter/bin/loader/loader_app.dart
+23
-10
hot.dart
packages/flutter_tools/lib/src/hot.dart
+5
-0
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+7
-0
No files found.
packages/flutter/bin/loader/loader_app.dart
View file @
5fb69212
...
@@ -22,7 +22,9 @@ void main() {
...
@@ -22,7 +22,9 @@ void main() {
return
new
Column
(
return
new
Column
(
children:
<
Widget
>[
children:
<
Widget
>[
new
Flexible
(
new
Flexible
(
child:
new
Container
()
// TODO(ianh): replace this with our logo in a Center box
child:
new
Center
(
child:
new
FlutterLogo
(
size:
100.0
),
),
),
),
new
Flexible
(
new
Flexible
(
child:
new
Builder
(
child:
new
Builder
(
...
@@ -38,21 +40,21 @@ void main() {
...
@@ -38,21 +40,21 @@ void main() {
children
.
add
(
new
Center
(
child:
new
CircularProgressIndicator
(
value:
progressMax
>
0
?
progress
/
progressMax
:
null
)));
children
.
add
(
new
Center
(
child:
new
CircularProgressIndicator
(
value:
progressMax
>
0
?
progress
/
progressMax
:
null
)));
}
}
return
new
Block
(
children:
children
);
return
new
Block
(
children:
children
);
}
}
,
)
)
,
),
),
new
Flexible
(
new
Flexible
(
child:
new
Block
(
child:
new
Block
(
padding:
new
EdgeInsets
.
symmetric
(
horizontal:
16
.0
),
padding:
new
EdgeInsets
.
symmetric
(
horizontal:
24
.0
),
children:
<
Widget
>[
new
Text
(
explanation
,
textAlign:
TextAlign
.
center
)
]
children:
<
Widget
>[
new
Text
(
explanation
,
textAlign:
TextAlign
.
center
)
]
)
)
,
),
),
]
]
,
);
);
}
}
,
)
)
,
)
)
,
)
)
,
);
);
connectionTimeout
=
new
Timer
(
const
Duration
(
seconds:
8
),
()
{
connectionTimeout
=
new
Timer
(
const
Duration
(
seconds:
8
),
()
{
setState
(()
{
setState
(()
{
...
@@ -82,6 +84,17 @@ class LoaderBinding extends WidgetsFlutterBinding {
...
@@ -82,6 +84,17 @@ class LoaderBinding extends WidgetsFlutterBinding {
});
});
}
}
);
);
registerStringServiceExtension
(
name:
'loaderShowExplanation'
,
getter:
()
=>
explanation
,
setter:
(
String
value
)
{
connectionTimeout
?.
cancel
();
connectionTimeout
=
null
;
setState
(()
{
explanation
=
value
;
});
}
);
registerNumericServiceExtension
(
registerNumericServiceExtension
(
name:
'loaderSetProgress'
,
name:
'loaderSetProgress'
,
getter:
()
=>
progress
,
getter:
()
=>
progress
,
...
...
packages/flutter_tools/lib/src/hot.dart
View file @
5fb69212
...
@@ -263,6 +263,7 @@ class HotRunner extends ResidentRunner {
...
@@ -263,6 +263,7 @@ class HotRunner extends ResidentRunner {
return
3
;
return
3
;
}
}
_loaderShowMessage
(
'Connecting...'
,
progress:
0
);
_loaderShowMessage
(
'Connecting...'
,
progress:
0
);
_loaderShowExplanation
(
'You can use hot reload to update your app on the fly, without restarting it.'
);
bool
devfsResult
=
await
_updateDevFS
(
bool
devfsResult
=
await
_updateDevFS
(
progressReporter:
(
int
progress
,
int
max
)
{
progressReporter:
(
int
progress
,
int
max
)
{
if
(
progress
%
10
==
0
)
if
(
progress
%
10
==
0
)
...
@@ -340,6 +341,10 @@ class HotRunner extends ResidentRunner {
...
@@ -340,6 +341,10 @@ class HotRunner extends ResidentRunner {
}
}
}
}
void
_loaderShowExplanation
(
String
explanation
)
{
currentView
.
uiIsolate
.
flutterLoaderShowExplanation
(
explanation
);
}
DevFS
_devFS
;
DevFS
_devFS
;
Future
<
Uri
>
_initDevFS
()
{
Future
<
Uri
>
_initDevFS
()
{
...
...
packages/flutter_tools/lib/src/vmservice.dart
View file @
5fb69212
...
@@ -809,6 +809,13 @@ class Isolate extends ServiceObjectOwner {
...
@@ -809,6 +809,13 @@ class Isolate extends ServiceObjectOwner {
}).
catchError
((
dynamic
error
)
=>
null
);
}).
catchError
((
dynamic
error
)
=>
null
);
}
}
void
flutterLoaderShowExplanation
(
String
explanation
)
{
// Invoke loaderShowExplanation; ignore any returned errors.
invokeRpcRaw
(
'ext.flutter.loaderShowExplanation'
,
<
String
,
dynamic
>
{
'value'
:
explanation
}).
catchError
((
dynamic
error
)
=>
null
);
}
void
flutterLoaderSetProgress
(
double
progress
)
{
void
flutterLoaderSetProgress
(
double
progress
)
{
// Invoke loaderSetProgress; ignore any returned errors.
// Invoke loaderSetProgress; ignore any returned errors.
invokeRpcRaw
(
'ext.flutter.loaderSetProgress'
,
<
String
,
dynamic
>{
invokeRpcRaw
(
'ext.flutter.loaderSetProgress'
,
<
String
,
dynamic
>{
...
...
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