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
37e25238
Unverified
Commit
37e25238
authored
Apr 29, 2019
by
Jonah Williams
Committed by
GitHub
Apr 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempt to reduce usage of runtimeType (#31696)
parent
fe9512fa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
3 deletions
+27
-3
constants.dart
packages/flutter/lib/src/foundation/constants.dart
+20
-0
implicit_animations.dart
packages/flutter/lib/src/widgets/implicit_animations.dart
+1
-1
scroll_activity.dart
packages/flutter/lib/src/widgets/scroll_activity.dart
+1
-1
ticker_provider.dart
packages/flutter/lib/src/widgets/ticker_provider.dart
+1
-1
compile.dart
packages/flutter_tools/lib/src/compile.dart
+4
-0
No files found.
packages/flutter/lib/src/foundation/constants.dart
View file @
37e25238
...
@@ -11,3 +11,23 @@
...
@@ -11,3 +11,23 @@
/// a particular block of code will not be executed in release mode, and hence
/// a particular block of code will not be executed in release mode, and hence
/// can be removed.
/// can be removed.
const
bool
kReleaseMode
=
bool
.
fromEnvironment
(
'dart.vm.product'
,
defaultValue:
false
);
const
bool
kReleaseMode
=
bool
.
fromEnvironment
(
'dart.vm.product'
,
defaultValue:
false
);
/// A constant that is true if the application was compiled in profile mode.
///
/// More specifically, this is a constant that is true if the application was
/// compiled in Dart with the '-Ddart.vm.profile=true' flag.
///
/// Since this is a const value, it can be used to indicate to the compiler that
/// a particular block of code will not be executed in profle mode, an hence
/// can be removed.
const
bool
kProfileMode
=
bool
.
fromEnvironment
(
'dart.vm.profile'
,
defaultValue:
false
);
/// A constant that is true if the application was compiled in debug mode.
///
/// More specifically, this is a constant that is true if the application was
/// not compiled with '-Ddart.vm.product=true' and '-Ddart.vm.profile=true'.
///
/// Since this is a const value, it can be used to indicate to the compiler that
/// a particular block of code will not be executed in debug mode, and hence
/// can be removed.
const
bool
kDebugMode
=
!
kReleaseMode
&&
!
kProfileMode
;
packages/flutter/lib/src/widgets/implicit_animations.dart
View file @
37e25238
...
@@ -280,7 +280,7 @@ abstract class ImplicitlyAnimatedWidgetState<T extends ImplicitlyAnimatedWidget>
...
@@ -280,7 +280,7 @@ abstract class ImplicitlyAnimatedWidgetState<T extends ImplicitlyAnimatedWidget>
super
.
initState
();
super
.
initState
();
_controller
=
AnimationController
(
_controller
=
AnimationController
(
duration:
widget
.
duration
,
duration:
widget
.
duration
,
debugLabel:
'
${widget.toStringShort()}
'
,
debugLabel:
kDebugMode
?
'
${widget.toStringShort()}
'
:
null
,
vsync:
this
,
vsync:
this
,
);
);
_updateCurve
();
_updateCurve
();
...
...
packages/flutter/lib/src/widgets/scroll_activity.dart
View file @
37e25238
...
@@ -507,7 +507,7 @@ class BallisticScrollActivity extends ScrollActivity {
...
@@ -507,7 +507,7 @@ class BallisticScrollActivity extends ScrollActivity {
TickerProvider
vsync
,
TickerProvider
vsync
,
)
:
super
(
delegate
)
{
)
:
super
(
delegate
)
{
_controller
=
AnimationController
.
unbounded
(
_controller
=
AnimationController
.
unbounded
(
debugLabel:
'
$runtimeType
'
,
debugLabel:
kDebugMode
?
'
$runtimeType
'
:
null
,
vsync:
vsync
,
vsync:
vsync
,
)
)
..
addListener
(
_tick
)
..
addListener
(
_tick
)
...
...
packages/flutter/lib/src/widgets/ticker_provider.dart
View file @
37e25238
...
@@ -90,7 +90,7 @@ mixin SingleTickerProviderStateMixin<T extends StatefulWidget> on State<T> imple
...
@@ -90,7 +90,7 @@ mixin SingleTickerProviderStateMixin<T extends StatefulWidget> on State<T> imple
'mixing in a SingleTickerProviderStateMixin, use a regular TickerProviderStateMixin.'
'mixing in a SingleTickerProviderStateMixin, use a regular TickerProviderStateMixin.'
);
);
}());
}());
_ticker
=
Ticker
(
onTick
,
debugLabel:
'created by
$this
'
);
_ticker
=
Ticker
(
onTick
,
debugLabel:
kDebugMode
?
'created by
$this
'
:
null
);
// We assume that this is called from initState, build, or some sort of
// We assume that this is called from initState, build, or some sort of
// event handler, and that thus TickerMode.of(context) would return true. We
// event handler, and that thus TickerMode.of(context) would return true. We
// can't actually check that here because if we're in initState then we're
// can't actually check that here because if we're in initState then we're
...
...
packages/flutter_tools/lib/src/compile.dart
View file @
37e25238
...
@@ -281,8 +281,12 @@ class KernelCompiler {
...
@@ -281,8 +281,12 @@ class KernelCompiler {
command
.
add
(
'--aot'
);
command
.
add
(
'--aot'
);
command
.
add
(
'--tfa'
);
command
.
add
(
'--tfa'
);
}
}
// If we're not targeting product (release) mode and we're still aot, then
// target profile mode.
if
(
targetProductVm
)
{
if
(
targetProductVm
)
{
command
.
add
(
'-Ddart.vm.product=true'
);
command
.
add
(
'-Ddart.vm.product=true'
);
}
else
if
(
aot
)
{
command
.
add
(
'-Ddart.vm.profile=true'
);
}
}
if
(
incrementalCompilerByteStorePath
!=
null
)
{
if
(
incrementalCompilerByteStorePath
!=
null
)
{
command
.
add
(
'--incremental'
);
command
.
add
(
'--incremental'
);
...
...
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