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
e46f6e76
Commit
e46f6e76
authored
Feb 06, 2017
by
Ian Hickson
Committed by
GitHub
Feb 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide more const constructors for keys. (#7907)
parent
57ee5263
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+5
-2
No files found.
packages/flutter/lib/src/widgets/framework.dart
View file @
e46f6e76
...
...
@@ -30,7 +30,7 @@ abstract class Key {
/// Construct a [ValueKey<String>] with the given [String].
///
/// This is the simplest way to create keys.
factory
Key
(
String
value
)
=>
new
ValueKey
<
String
>(
value
)
;
const
factory
Key
(
String
value
)
=
ValueKey
<
String
>
;
/// Default constructor, used by subclasses.
///
...
...
@@ -154,7 +154,7 @@ abstract class GlobalKey<T extends State<StatefulWidget>> extends Key {
///
/// The label is purely for debugging and not used for comparing the identity
/// of the key.
factory
GlobalKey
({
String
debugLabel
})
=>
new
LabeledGlobalKey
<
T
>(
debugLabel
)
;
// the label is purely for debugging purposes and is otherwise ignored
const
factory
GlobalKey
({
String
debugLabel
})
=
LabeledGlobalKey
<
T
>.
_
;
// the label is purely for debugging purposes and is otherwise ignored
/// Creates a global key without a label.
///
...
...
@@ -302,6 +302,9 @@ class LabeledGlobalKey<T extends State<StatefulWidget>> extends GlobalKey<T> {
/// The label does not affect the key's identity.
const
LabeledGlobalKey
(
this
.
_debugLabel
)
:
super
.
constructor
();
// Used for forwarding the constructor from GlobalKey.
const
LabeledGlobalKey
.
_
({
String
debugLabel
})
:
_debugLabel
=
debugLabel
,
super
.
constructor
();
final
String
_debugLabel
;
@override
...
...
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