mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Remove _emptyList from fn2.dart
We can use const [] instead and we'll be sure we don't mutate this constant. R=ianh@google.com Review URL: https://codereview.chromium.org/1178623002.
This commit is contained in:
parent
633ba8c811
commit
4806a4cc04
@ -530,8 +530,6 @@ class CustomPaint extends OneChildRenderObjectWrapper {
|
||||
|
||||
}
|
||||
|
||||
final List<UINode> _emptyList = new List<UINode>();
|
||||
|
||||
abstract class MultiChildRenderObjectWrapper extends RenderObjectWrapper {
|
||||
|
||||
// In MultiChildRenderObjectWrapper subclasses, slots are RenderObject nodes
|
||||
@ -540,10 +538,8 @@ abstract class MultiChildRenderObjectWrapper extends RenderObjectWrapper {
|
||||
MultiChildRenderObjectWrapper({
|
||||
Object key,
|
||||
List<UINode> children
|
||||
}) : this.children = children == null ? _emptyList : children,
|
||||
super(
|
||||
key: key
|
||||
) {
|
||||
}) : this.children = children == null ? const [] : children,
|
||||
super(key: key) {
|
||||
assert(!_debugHasDuplicateIds());
|
||||
}
|
||||
|
||||
|
||||
@ -51,8 +51,7 @@ same order (unless the order matters).
|
||||
|
||||
All variables and arguments are typed; don't use "var", "dynamic", or
|
||||
"Object" in any case where you could figure out the actual type.
|
||||
Always specialise generic types where possible. Even for ```[]``` and
|
||||
```{}``` literals, include the types.
|
||||
Always specialise generic types where possible.
|
||||
|
||||
Aim for a line length of 80 characters, but go over if breaking the
|
||||
line would make it less readable.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user