Unverified Commit 802eca29 authored by Phil Quitslund's avatar Phil Quitslund Committed by GitHub

set literal conversions (#27811)

parent 608b03c7
...@@ -120,7 +120,7 @@ linter: ...@@ -120,7 +120,7 @@ linter:
# - parameter_assignments # we do this commonly # - parameter_assignments # we do this commonly
- prefer_adjacent_string_concatenation - prefer_adjacent_string_concatenation
- prefer_asserts_in_initializer_lists - prefer_asserts_in_initializer_lists
# - prefer_collection_literals # temporary until all platforms support set literals - prefer_collection_literals
- prefer_conditional_assignment - prefer_conditional_assignment
- prefer_const_constructors - prefer_const_constructors
- prefer_const_constructors_in_immutables - prefer_const_constructors_in_immutables
......
...@@ -401,7 +401,7 @@ Set<String> _findFlutterDependencies(String srcPath, List<String> errors, { bool ...@@ -401,7 +401,7 @@ Set<String> _findFlutterDependencies(String srcPath, List<String> errors, { bool
return Directory(srcPath).listSync(recursive: true).where((FileSystemEntity entity) { return Directory(srcPath).listSync(recursive: true).where((FileSystemEntity entity) {
return entity is File && path.extension(entity.path) == '.dart'; return entity is File && path.extension(entity.path) == '.dart';
}).map<Set<String>>((FileSystemEntity entity) { }).map<Set<String>>((FileSystemEntity entity) {
final Set<String> result = Set<String>(); final Set<String> result = <String>{};
final File file = entity; final File file = entity;
for (String line in file.readAsLinesSync()) { for (String line in file.readAsLinesSync()) {
Match match = _importPattern.firstMatch(line); Match match = _importPattern.firstMatch(line);
...@@ -419,7 +419,7 @@ Set<String> _findFlutterDependencies(String srcPath, List<String> errors, { bool ...@@ -419,7 +419,7 @@ Set<String> _findFlutterDependencies(String srcPath, List<String> errors, { bool
} }
return result; return result;
}).reduce((Set<String> value, Set<String> element) { }).reduce((Set<String> value, Set<String> element) {
value ??= Set<String>(); value ??= <String>{};
value.addAll(element); value.addAll(element);
return value; return value;
}); });
...@@ -434,7 +434,7 @@ List<T> _deepSearch<T>(Map<T, Set<T>> map, T start, [ Set<T> seen ]) { ...@@ -434,7 +434,7 @@ List<T> _deepSearch<T>(Map<T, Set<T>> map, T start, [ Set<T> seen ]) {
final List<T> result = _deepSearch<T>( final List<T> result = _deepSearch<T>(
map, map,
key, key,
(seen == null ? Set<T>.from(<T>[start]) : Set<T>.from(seen))..add(key), (seen == null ? <T>{start} : Set<T>.from(seen))..add(key),
); );
if (result != null) { if (result != null) {
result.insert(0, start); result.insert(0, start);
...@@ -543,7 +543,7 @@ Future<void> _verifyGeneratedPluginRegistrants(String flutterRoot) async { ...@@ -543,7 +543,7 @@ Future<void> _verifyGeneratedPluginRegistrants(String flutterRoot) async {
} }
} }
final Set<String> outOfDate = Set<String>(); final Set<String> outOfDate = <String>{};
for (String package in packageToRegistrants.keys) { for (String package in packageToRegistrants.keys) {
final Map<File, String> fileToContent = <File, String>{}; final Map<File, String> fileToContent = <File, String>{};
......
...@@ -1382,7 +1382,7 @@ String zalgo(math.Random random, int targetLength, { bool includeSpacingCombinin ...@@ -1382,7 +1382,7 @@ String zalgo(math.Random random, int targetLength, { bool includeSpacingCombinin
0x16F7E, 0x1D165, 0x1D166, 0x1D16D, 0x1D16E, 0x1D16F, 0x1D170, 0x16F7E, 0x1D165, 0x1D166, 0x1D16D, 0x1D16E, 0x1D16F, 0x1D170,
0x1D171, 0x1D172, 0x1D171, 0x1D172,
]; ];
final Set<int> these = Set<int>(); final Set<int> these = <int>{};
int combiningCount = enclosingCombiningMarks.length + nonspacingCombiningMarks.length; int combiningCount = enclosingCombiningMarks.length + nonspacingCombiningMarks.length;
if (includeSpacingCombiningMarks) if (includeSpacingCombiningMarks)
combiningCount += spacingCombiningMarks.length; combiningCount += spacingCombiningMarks.length;
......
...@@ -80,7 +80,7 @@ final Map<LocaleInfo, Map<String, dynamic>> localeToResourceAttributes = <Locale ...@@ -80,7 +80,7 @@ final Map<LocaleInfo, Map<String, dynamic>> localeToResourceAttributes = <Locale
/// the first Hant Chinese locale as a default by repeating the data. If an /// the first Hant Chinese locale as a default by repeating the data. If an
/// explicit match is later found, we can reference this set to see if we should /// explicit match is later found, we can reference this set to see if we should
/// overwrite the existing assumed data. /// overwrite the existing assumed data.
final Set<LocaleInfo> assumedLocales = Set<LocaleInfo>(); final Set<LocaleInfo> assumedLocales = <LocaleInfo>{};
/// Return `s` as a Dart-parseable raw string in single or double quotes. /// Return `s` as a Dart-parseable raw string in single or double quotes.
/// ///
...@@ -124,15 +124,15 @@ String generateTranslationBundles() { ...@@ -124,15 +124,15 @@ String generateTranslationBundles() {
final Map<String, Set<String>> languageToScriptCodes = <String, Set<String>>{}; final Map<String, Set<String>> languageToScriptCodes = <String, Set<String>>{};
// Used to calculate if there are any corresponding countries for a given language and script. // Used to calculate if there are any corresponding countries for a given language and script.
final Map<LocaleInfo, Set<String>> languageAndScriptToCountryCodes = <LocaleInfo, Set<String>>{}; final Map<LocaleInfo, Set<String>> languageAndScriptToCountryCodes = <LocaleInfo, Set<String>>{};
final Set<String> allResourceIdentifiers = Set<String>(); final Set<String> allResourceIdentifiers = <String>{};
for (LocaleInfo locale in localeToResources.keys.toList()..sort()) { for (LocaleInfo locale in localeToResources.keys.toList()..sort()) {
if (locale.scriptCode != null) { if (locale.scriptCode != null) {
languageToScriptCodes[locale.languageCode] ??= Set<String>(); languageToScriptCodes[locale.languageCode] ??= <String>{};
languageToScriptCodes[locale.languageCode].add(locale.scriptCode); languageToScriptCodes[locale.languageCode].add(locale.scriptCode);
} }
if (locale.countryCode != null && locale.scriptCode != null) { if (locale.countryCode != null && locale.scriptCode != null) {
final LocaleInfo key = LocaleInfo.fromString(locale.languageCode + '_' + locale.scriptCode); final LocaleInfo key = LocaleInfo.fromString(locale.languageCode + '_' + locale.scriptCode);
languageAndScriptToCountryCodes[key] ??= Set<String>(); languageAndScriptToCountryCodes[key] ??= <String>{};
languageAndScriptToCountryCodes[key].add(locale.countryCode); languageAndScriptToCountryCodes[key].add(locale.countryCode);
} }
languageToLocales[locale.languageCode] ??= <LocaleInfo>[]; languageToLocales[locale.languageCode] ??= <LocaleInfo>[];
......
...@@ -71,7 +71,7 @@ const Map<String, String> kIdentifierRewrites = <String, String>{ ...@@ -71,7 +71,7 @@ const Map<String, String> kIdentifierRewrites = <String, String>{
}; };
final Set<String> kMirroredIcons = Set<String>.from(<String>[ const Set<String> kMirroredIcons = <String>{
// This list is obtained from: // This list is obtained from:
// http://google.github.io/material-design-icons/#icons-in-rtl // http://google.github.io/material-design-icons/#icons-in-rtl
'arrow_back', 'arrow_back',
...@@ -145,7 +145,7 @@ final Set<String> kMirroredIcons = Set<String>.from(<String>[ ...@@ -145,7 +145,7 @@ final Set<String> kMirroredIcons = Set<String>.from(<String>[
'view_list', 'view_list',
'view_quilt', 'view_quilt',
'wrap_text', 'wrap_text',
]); };
void main(List<String> args) { void main(List<String> args) {
// If we're run from the `tools` dir, set the cwd to the repo root. // If we're run from the `tools` dir, set the cwd to the repo root.
......
...@@ -54,20 +54,20 @@ const Map<String, String> _avatars = <String, String>{ ...@@ -54,20 +54,20 @@ const Map<String, String> _avatars = <String, String>{
'customer': 'people/square/peter.png', 'customer': 'people/square/peter.png',
}; };
final Map<String, Set<String>> _toolActions = <String, Set<String>>{ const Map<String, Set<String>> _toolActions = <String, Set<String>>{
'hammer': Set<String>()..addAll(<String>['flake', 'fragment', 'splinter']), 'hammer': <String>{'flake', 'fragment', 'splinter'},
'chisel': Set<String>()..addAll(<String>['flake', 'nick', 'splinter']), 'chisel': <String>{'flake', 'nick', 'splinter'},
'fryer': Set<String>()..addAll(<String>['fry']), 'fryer': <String>{'fry'},
'fabricator': Set<String>()..addAll(<String>['solder']), 'fabricator': <String>{'solder'},
'customer': Set<String>()..addAll(<String>['cash in', 'eat']), 'customer': <String>{'cash in', 'eat'},
}; };
final Map<String, Set<String>> _materialActions = <String, Set<String>>{ const Map<String, Set<String>> _materialActions = <String, Set<String>>{
'poker': Set<String>()..addAll(<String>['cash in']), 'poker': <String>{'cash in'},
'tortilla': Set<String>()..addAll(<String>['fry', 'eat']), 'tortilla': <String>{'fry', 'eat'},
'fish and': Set<String>()..addAll(<String>['fry', 'eat']), 'fish and': <String>{'fry', 'eat'},
'micro': Set<String>()..addAll(<String>['solder', 'fragment']), 'micro': <String>{'solder', 'fragment'},
'wood': Set<String>()..addAll(<String>['flake', 'cut', 'splinter', 'nick']), 'wood': <String>{'flake', 'cut', 'splinter', 'nick'},
}; };
class _ChipsTile extends StatelessWidget { class _ChipsTile extends StatelessWidget {
...@@ -134,12 +134,12 @@ class _ChipDemoState extends State<ChipDemo> { ...@@ -134,12 +134,12 @@ class _ChipDemoState extends State<ChipDemo> {
_reset(); _reset();
} }
final Set<String> _materials = Set<String>(); final Set<String> _materials = <String>{};
String _selectedMaterial = ''; String _selectedMaterial = '';
String _selectedAction = ''; String _selectedAction = '';
final Set<String> _tools = Set<String>(); final Set<String> _tools = <String>{};
final Set<String> _selectedTools = Set<String>(); final Set<String> _selectedTools = <String>{};
final Set<String> _actions = Set<String>(); final Set<String> _actions = <String>{};
bool _showShapeBorder = false; bool _showShapeBorder = false;
// Initialize members with the default data. // Initialize members with the default data.
...@@ -262,7 +262,7 @@ class _ChipDemoState extends State<ChipDemo> { ...@@ -262,7 +262,7 @@ class _ChipDemoState extends State<ChipDemo> {
); );
}).toList(); }).toList();
Set<String> allowedActions = Set<String>(); Set<String> allowedActions = <String>{};
if (_selectedMaterial != null && _selectedMaterial.isNotEmpty) { if (_selectedMaterial != null && _selectedMaterial.isNotEmpty) {
for (String tool in _selectedTools) { for (String tool in _selectedTools) {
allowedActions.addAll(_toolActions[tool]); allowedActions.addAll(_toolActions[tool]);
......
...@@ -21,7 +21,7 @@ const double _kAppBarHeight = 128.0; ...@@ -21,7 +21,7 @@ const double _kAppBarHeight = 128.0;
const double _kFabHalfSize = 28.0; // TODO(mpcomplete): needs to adapt to screen size const double _kFabHalfSize = 28.0; // TODO(mpcomplete): needs to adapt to screen size
const double _kRecipePageMaxWidth = 500.0; const double _kRecipePageMaxWidth = 500.0;
final Set<Recipe> _favoriteRecipes = Set<Recipe>(); final Set<Recipe> _favoriteRecipes = <Recipe>{};
final ThemeData _kTheme = ThemeData( final ThemeData _kTheme = ThemeData(
brightness: Brightness.light, brightness: Brightness.light,
......
...@@ -193,7 +193,7 @@ class CupertinoPageRoute<T> extends PageRoute<T> { ...@@ -193,7 +193,7 @@ class CupertinoPageRoute<T> extends PageRoute<T> {
/// * [popGestureEnabled], which returns true if a user-triggered pop gesture /// * [popGestureEnabled], which returns true if a user-triggered pop gesture
/// would be allowed. /// would be allowed.
static bool isPopGestureInProgress(PageRoute<dynamic> route) => _popGestureInProgress.contains(route); static bool isPopGestureInProgress(PageRoute<dynamic> route) => _popGestureInProgress.contains(route);
static final Set<PageRoute<dynamic>> _popGestureInProgress = Set<PageRoute<dynamic>>(); static final Set<PageRoute<dynamic>> _popGestureInProgress = <PageRoute<dynamic>>{};
/// True if a Cupertino pop gesture is currently underway for this route. /// True if a Cupertino pop gesture is currently underway for this route.
/// ///
......
...@@ -70,7 +70,7 @@ class _TrackedAnnotation { ...@@ -70,7 +70,7 @@ class _TrackedAnnotation {
/// ///
/// This is used to detect layers that used to have the mouse pointer inside /// This is used to detect layers that used to have the mouse pointer inside
/// them, but now no longer do (to facilitate exit notification). /// them, but now no longer do (to facilitate exit notification).
Set<int> activeDevices = Set<int>(); Set<int> activeDevices = <int>{};
} }
/// Describes a function that finds an annotation given an offset in logical /// Describes a function that finds an annotation given an offset in logical
......
...@@ -965,10 +965,10 @@ class _DialPainter extends CustomPainter { ...@@ -965,10 +965,10 @@ class _DialPainter extends CustomPainter {
textDirection: textDirection, textDirection: textDirection,
onTap: label.onTap, onTap: label.onTap,
), ),
tags: Set<SemanticsTag>.from(const <SemanticsTag>[ tags: <SemanticsTag>{
// Used by tests to find this node. // Used by tests to find this node.
SemanticsTag('dial-label'), const SemanticsTag('dial-label'),
]), },
); );
nodes.add(node); nodes.add(node);
labelTheta += labelThetaIncrement; labelTheta += labelThetaIncrement;
......
...@@ -183,7 +183,7 @@ abstract class MultiChildLayoutDelegate { ...@@ -183,7 +183,7 @@ abstract class MultiChildLayoutDelegate {
Set<RenderBox> debugPreviousChildrenNeedingLayout; Set<RenderBox> debugPreviousChildrenNeedingLayout;
assert(() { assert(() {
debugPreviousChildrenNeedingLayout = _debugChildrenNeedingLayout; debugPreviousChildrenNeedingLayout = _debugChildrenNeedingLayout;
_debugChildrenNeedingLayout = Set<RenderBox>(); _debugChildrenNeedingLayout = <RenderBox>{};
return true; return true;
}()); }());
......
...@@ -921,7 +921,7 @@ class PipelineOwner { ...@@ -921,7 +921,7 @@ class PipelineOwner {
} }
bool _debugDoingSemantics = false; bool _debugDoingSemantics = false;
final Set<RenderObject> _nodesNeedingSemantics = Set<RenderObject>(); final Set<RenderObject> _nodesNeedingSemantics = <RenderObject>{};
/// Update the semantics for render objects marked as needing a semantics /// Update the semantics for render objects marked as needing a semantics
/// update. /// update.
...@@ -2422,7 +2422,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2422,7 +2422,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
final bool producesForkingFragment = !config.hasBeenAnnotated && !config.isSemanticBoundary; final bool producesForkingFragment = !config.hasBeenAnnotated && !config.isSemanticBoundary;
final List<_InterestingSemanticsFragment> fragments = <_InterestingSemanticsFragment>[]; final List<_InterestingSemanticsFragment> fragments = <_InterestingSemanticsFragment>[];
final Set<_InterestingSemanticsFragment> toBeMarkedExplicit = Set<_InterestingSemanticsFragment>(); final Set<_InterestingSemanticsFragment> toBeMarkedExplicit = <_InterestingSemanticsFragment>{};
final bool childrenMergeIntoParent = mergeIntoParent || config.isMergingSemanticsOfDescendants; final bool childrenMergeIntoParent = mergeIntoParent || config.isMergingSemanticsOfDescendants;
// When set to true there's currently not enough information in this subtree // When set to true there's currently not enough information in this subtree
...@@ -3244,7 +3244,7 @@ abstract class _InterestingSemanticsFragment extends _SemanticsFragment { ...@@ -3244,7 +3244,7 @@ abstract class _InterestingSemanticsFragment extends _SemanticsFragment {
void addTags(Iterable<SemanticsTag> tags) { void addTags(Iterable<SemanticsTag> tags) {
if (tags == null || tags.isEmpty) if (tags == null || tags.isEmpty)
return; return;
_tagsForChildren ??= Set<SemanticsTag>(); _tagsForChildren ??= <SemanticsTag>{};
_tagsForChildren.addAll(tags); _tagsForChildren.addAll(tags);
} }
......
...@@ -481,7 +481,7 @@ class _AndroidViewGestureRecognizer extends OneSequenceGestureRecognizer { ...@@ -481,7 +481,7 @@ class _AndroidViewGestureRecognizer extends OneSequenceGestureRecognizer {
// Pointer for which we have already won the arena, events for pointers in this set are // Pointer for which we have already won the arena, events for pointers in this set are
// immediately dispatched to the Android view. // immediately dispatched to the Android view.
final Set<int> forwardedPointers = Set<int>(); final Set<int> forwardedPointers = <int>{};
// We use OneSequenceGestureRecognizers as they support gesture arena teams. // We use OneSequenceGestureRecognizers as they support gesture arena teams.
// TODO(amirh): get a list of GestureRecognizers here. // TODO(amirh): get a list of GestureRecognizers here.
......
...@@ -1284,7 +1284,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin { ...@@ -1284,7 +1284,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
return true; return true;
}()); }());
assert(() { assert(() {
final Set<SemanticsNode> seenChildren = Set<SemanticsNode>(); final Set<SemanticsNode> seenChildren = <SemanticsNode>{};
for (SemanticsNode child in newChildren) for (SemanticsNode child in newChildren)
assert(seenChildren.add(child)); // check for duplicate adds assert(seenChildren.add(child)); // check for duplicate adds
return true; return true;
...@@ -1742,7 +1742,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin { ...@@ -1742,7 +1742,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
double scrollExtentMin = _scrollExtentMin; double scrollExtentMin = _scrollExtentMin;
final double elevation = _elevation; final double elevation = _elevation;
double thickness = _thickness; double thickness = _thickness;
final Set<int> customSemanticsActionIds = Set<int>(); final Set<int> customSemanticsActionIds = <int>{};
for (CustomSemanticsAction action in _customSemanticsActions.keys) for (CustomSemanticsAction action in _customSemanticsActions.keys)
customSemanticsActionIds.add(CustomSemanticsAction.getIdentifier(action)); customSemanticsActionIds.add(CustomSemanticsAction.getIdentifier(action));
if (hintOverrides != null) { if (hintOverrides != null) {
...@@ -1781,7 +1781,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin { ...@@ -1781,7 +1781,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
if (decreasedValue == '' || decreasedValue == null) if (decreasedValue == '' || decreasedValue == null)
decreasedValue = node._decreasedValue; decreasedValue = node._decreasedValue;
if (node.tags != null) { if (node.tags != null) {
mergedTags ??= Set<SemanticsTag>(); mergedTags ??= <SemanticsTag>{};
mergedTags.addAll(node.tags); mergedTags.addAll(node.tags);
} }
if (node._customSemanticsActions != null) { if (node._customSemanticsActions != null) {
...@@ -2270,7 +2270,7 @@ class _SemanticsSortGroup extends Comparable<_SemanticsSortGroup> { ...@@ -2270,7 +2270,7 @@ class _SemanticsSortGroup extends Comparable<_SemanticsSortGroup> {
} }
final List<int> sortedIds = <int>[]; final List<int> sortedIds = <int>[];
final Set<int> visitedIds = Set<int>(); final Set<int> visitedIds = <int>{};
final List<SemanticsNode> startNodes = nodes.toList()..sort((SemanticsNode a, SemanticsNode b) { final List<SemanticsNode> startNodes = nodes.toList()..sort((SemanticsNode a, SemanticsNode b) {
final Offset aTopLeft = _pointInParentCoordinates(a, a.rect.topLeft); final Offset aTopLeft = _pointInParentCoordinates(a, a.rect.topLeft);
final Offset bTopLeft = _pointInParentCoordinates(b, b.rect.topLeft); final Offset bTopLeft = _pointInParentCoordinates(b, b.rect.topLeft);
...@@ -2410,9 +2410,9 @@ class _TraversalSortNode implements Comparable<_TraversalSortNode> { ...@@ -2410,9 +2410,9 @@ class _TraversalSortNode implements Comparable<_TraversalSortNode> {
/// obtain a [SemanticsHandle]. This will create a [SemanticsOwner] if /// obtain a [SemanticsHandle]. This will create a [SemanticsOwner] if
/// necessary. /// necessary.
class SemanticsOwner extends ChangeNotifier { class SemanticsOwner extends ChangeNotifier {
final Set<SemanticsNode> _dirtyNodes = Set<SemanticsNode>(); final Set<SemanticsNode> _dirtyNodes = <SemanticsNode>{};
final Map<int, SemanticsNode> _nodes = <int, SemanticsNode>{}; final Map<int, SemanticsNode> _nodes = <int, SemanticsNode>{};
final Set<SemanticsNode> _detachedNodes = Set<SemanticsNode>(); final Set<SemanticsNode> _detachedNodes = <SemanticsNode>{};
final Map<int, CustomSemanticsAction> _actions = <int, CustomSemanticsAction>{}; final Map<int, CustomSemanticsAction> _actions = <int, CustomSemanticsAction>{};
/// The root node of the semantics tree, if any. /// The root node of the semantics tree, if any.
...@@ -2432,7 +2432,7 @@ class SemanticsOwner extends ChangeNotifier { ...@@ -2432,7 +2432,7 @@ class SemanticsOwner extends ChangeNotifier {
void sendSemanticsUpdate() { void sendSemanticsUpdate() {
if (_dirtyNodes.isEmpty) if (_dirtyNodes.isEmpty)
return; return;
final Set<int> customSemanticsActionIds = Set<int>(); final Set<int> customSemanticsActionIds = <int>{};
final List<SemanticsNode> visitedNodes = <SemanticsNode>[]; final List<SemanticsNode> visitedNodes = <SemanticsNode>[];
while (_dirtyNodes.isNotEmpty) { while (_dirtyNodes.isNotEmpty) {
final List<SemanticsNode> localDirtyNodes = _dirtyNodes.where((SemanticsNode node) => !_detachedNodes.contains(node)).toList(); final List<SemanticsNode> localDirtyNodes = _dirtyNodes.where((SemanticsNode node) => !_detachedNodes.contains(node)).toList();
...@@ -3551,7 +3551,7 @@ class SemanticsConfiguration { ...@@ -3551,7 +3551,7 @@ class SemanticsConfiguration {
/// * [RenderSemanticsGestureHandler.excludeFromScrolling] for an example of /// * [RenderSemanticsGestureHandler.excludeFromScrolling] for an example of
/// how tags are used. /// how tags are used.
void addTagForChildren(SemanticsTag tag) { void addTagForChildren(SemanticsTag tag) {
_tagsForChildren ??= Set<SemanticsTag>(); _tagsForChildren ??= <SemanticsTag>{};
_tagsForChildren.add(tag); _tagsForChildren.add(tag);
} }
......
...@@ -478,7 +478,7 @@ class RawKeyboard { ...@@ -478,7 +478,7 @@ class RawKeyboard {
} }
} }
final Set<LogicalKeyboardKey> _keysPressed = Set<LogicalKeyboardKey>(); final Set<LogicalKeyboardKey> _keysPressed = <LogicalKeyboardKey>{};
/// Returns the set of keys currently pressed. /// Returns the set of keys currently pressed.
Set<LogicalKeyboardKey> get keysPressed { Set<LogicalKeyboardKey> get keysPressed {
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:collection';
import 'package:flutter/animation.dart'; import 'package:flutter/animation.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
...@@ -278,7 +276,7 @@ class AnimatedSwitcher extends StatefulWidget { ...@@ -278,7 +276,7 @@ class AnimatedSwitcher extends StatefulWidget {
class _AnimatedSwitcherState extends State<AnimatedSwitcher> with TickerProviderStateMixin { class _AnimatedSwitcherState extends State<AnimatedSwitcher> with TickerProviderStateMixin {
_ChildEntry _currentEntry; _ChildEntry _currentEntry;
final Set<_ChildEntry> _outgoingEntries = LinkedHashSet<_ChildEntry>(); final Set<_ChildEntry> _outgoingEntries = <_ChildEntry>{};
List<Widget> _outgoingWidgets = const <Widget>[]; List<Widget> _outgoingWidgets = const <Widget>[];
int _childNumber = 0; int _childNumber = 0;
......
...@@ -83,7 +83,7 @@ class Form extends StatefulWidget { ...@@ -83,7 +83,7 @@ class Form extends StatefulWidget {
/// Typically obtained via [Form.of]. /// Typically obtained via [Form.of].
class FormState extends State<Form> { class FormState extends State<Form> {
int _generation = 0; int _generation = 0;
final Set<FormFieldState<dynamic>> _fields = Set<FormFieldState<dynamic>>(); final Set<FormFieldState<dynamic>> _fields = <FormFieldState<dynamic>>{};
// Called when a form field has changed. This will cause all form fields // Called when a form field has changed. This will cause all form fields
// to rebuild, useful if form fields have interdependencies. // to rebuild, useful if form fields have interdependencies.
......
...@@ -44,7 +44,7 @@ Future<Map<Type, dynamic>> _loadAll(Locale locale, Iterable<LocalizationsDelegat ...@@ -44,7 +44,7 @@ Future<Map<Type, dynamic>> _loadAll(Locale locale, Iterable<LocalizationsDelegat
// Only load the first delegate for each delegate type that supports // Only load the first delegate for each delegate type that supports
// locale.languageCode. // locale.languageCode.
final Set<Type> types = Set<Type>(); final Set<Type> types = <Type>{};
final List<LocalizationsDelegate<dynamic>> delegates = <LocalizationsDelegate<dynamic>>[]; final List<LocalizationsDelegate<dynamic>> delegates = <LocalizationsDelegate<dynamic>>[];
for (LocalizationsDelegate<dynamic> delegate in allDelegates) { for (LocalizationsDelegate<dynamic> delegate in allDelegates) {
if (!types.contains(delegate.type) && delegate.isSupported(locale)) { if (!types.contains(delegate.type) && delegate.isSupported(locale)) {
......
...@@ -1465,7 +1465,7 @@ class Navigator extends StatefulWidget { ...@@ -1465,7 +1465,7 @@ class Navigator extends StatefulWidget {
class NavigatorState extends State<Navigator> with TickerProviderStateMixin { class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
final GlobalKey<OverlayState> _overlayKey = GlobalKey<OverlayState>(); final GlobalKey<OverlayState> _overlayKey = GlobalKey<OverlayState>();
final List<Route<dynamic>> _history = <Route<dynamic>>[]; final List<Route<dynamic>> _history = <Route<dynamic>>[];
final Set<Route<dynamic>> _poppedRoutes = Set<Route<dynamic>>(); final Set<Route<dynamic>> _poppedRoutes = <Route<dynamic>>{};
/// The [FocusScopeNode] for the [FocusScope] that encloses the routes. /// The [FocusScopeNode] for the [FocusScope] that encloses the routes.
final FocusScopeNode focusScopeNode = FocusScopeNode(); final FocusScopeNode focusScopeNode = FocusScopeNode();
...@@ -2145,7 +2145,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -2145,7 +2145,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
} }
} }
final Set<int> _activePointers = Set<int>(); final Set<int> _activePointers = <int>{};
void _handlePointerDown(PointerDownEvent event) { void _handlePointerDown(PointerDownEvent event) {
_activePointers.add(event.pointer); _activePointers.add(event.pointer);
......
...@@ -297,7 +297,7 @@ class _AndroidViewState extends State<AndroidView> { ...@@ -297,7 +297,7 @@ class _AndroidViewState extends State<AndroidView> {
bool _initialized = false; bool _initialized = false;
static final Set<Factory<OneSequenceGestureRecognizer>> _emptyRecognizersSet = static final Set<Factory<OneSequenceGestureRecognizer>> _emptyRecognizersSet =
Set<Factory<OneSequenceGestureRecognizer>>(); <Factory<OneSequenceGestureRecognizer>>{};
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -380,7 +380,7 @@ class _UiKitViewState extends State<UiKitView> { ...@@ -380,7 +380,7 @@ class _UiKitViewState extends State<UiKitView> {
bool _initialized = false; bool _initialized = false;
static final Set<Factory<OneSequenceGestureRecognizer>> _emptyRecognizersSet = static final Set<Factory<OneSequenceGestureRecognizer>> _emptyRecognizersSet =
Set<Factory<OneSequenceGestureRecognizer>>(); <Factory<OneSequenceGestureRecognizer>>{};
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
......
...@@ -1363,7 +1363,7 @@ class RouteObserver<R extends Route<dynamic>> extends NavigatorObserver { ...@@ -1363,7 +1363,7 @@ class RouteObserver<R extends Route<dynamic>> extends NavigatorObserver {
void subscribe(RouteAware routeAware, R route) { void subscribe(RouteAware routeAware, R route) {
assert(routeAware != null); assert(routeAware != null);
assert(route != null); assert(route != null);
final Set<RouteAware> subscribers = _listeners.putIfAbsent(route, () => Set<RouteAware>()); final Set<RouteAware> subscribers = _listeners.putIfAbsent(route, () => <RouteAware>{});
if (subscribers.add(routeAware)) { if (subscribers.add(routeAware)) {
routeAware.didPush(); routeAware.didPush();
} }
......
...@@ -432,7 +432,7 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics { ...@@ -432,7 +432,7 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics {
break; break;
} }
final Set<SemanticsAction> actions = Set<SemanticsAction>(); final Set<SemanticsAction> actions = <SemanticsAction>{};
if (pixels > minScrollExtent) if (pixels > minScrollExtent)
actions.add(backward); actions.add(backward);
if (pixels < maxScrollExtent) if (pixels < maxScrollExtent)
......
...@@ -308,7 +308,7 @@ class _TableElement extends RenderObjectElement { ...@@ -308,7 +308,7 @@ class _TableElement extends RenderObjectElement {
} }
final Iterator<_TableElementRow> oldUnkeyedRows = _children.where((_TableElementRow row) => row.key == null).iterator; final Iterator<_TableElementRow> oldUnkeyedRows = _children.where((_TableElementRow row) => row.key == null).iterator;
final List<_TableElementRow> newChildren = <_TableElementRow>[]; final List<_TableElementRow> newChildren = <_TableElementRow>[];
final Set<List<Element>> taken = Set<List<Element>>(); final Set<List<Element>> taken = <List<Element>>{};
for (TableRow row in newWidget.children) { for (TableRow row in newWidget.children) {
List<Element> oldChildren; List<Element> oldChildren;
if (row.key != null && oldKeyedRows.containsKey(row.key)) { if (row.key != null && oldKeyedRows.containsKey(row.key)) {
......
...@@ -157,7 +157,7 @@ mixin TickerProviderStateMixin<T extends StatefulWidget> on State<T> implements ...@@ -157,7 +157,7 @@ mixin TickerProviderStateMixin<T extends StatefulWidget> on State<T> implements
@override @override
Ticker createTicker(TickerCallback onTick) { Ticker createTicker(TickerCallback onTick) {
_tickers ??= Set<_WidgetTicker>(); _tickers ??= <_WidgetTicker>{};
final _WidgetTicker result = _WidgetTicker(onTick, this, debugLabel: 'created by $this'); final _WidgetTicker result = _WidgetTicker(onTick, this, debugLabel: 'created by $this');
_tickers.add(result); _tickers.add(result);
return result; return result;
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:async'; import 'dart:async';
import 'dart:collection';
import 'dart:convert'; import 'dart:convert';
import 'dart:developer' as developer; import 'dart:developer' as developer;
import 'dart:math' as math; import 'dart:math' as math;
...@@ -2259,7 +2258,7 @@ class _WidgetInspectorState extends State<WidgetInspector> ...@@ -2259,7 +2258,7 @@ class _WidgetInspectorState extends State<WidgetInspector>
return size == null ? double.maxFinite : size.width * size.height; return size == null ? double.maxFinite : size.width * size.height;
} }
regularHits.sort((RenderObject a, RenderObject b) => _area(a).compareTo(_area(b))); regularHits.sort((RenderObject a, RenderObject b) => _area(a).compareTo(_area(b)));
final Set<RenderObject> hits = LinkedHashSet<RenderObject>(); final Set<RenderObject> hits = <RenderObject>{};
hits..addAll(edgeHits)..addAll(regularHits); hits..addAll(edgeHits)..addAll(regularHits);
return hits.toList(); return hits.toList();
} }
......
...@@ -89,7 +89,7 @@ void main() { ...@@ -89,7 +89,7 @@ void main() {
expect(config.getActionHandler(SemanticsAction.scrollRight), isNotNull); expect(config.getActionHandler(SemanticsAction.scrollRight), isNotNull);
config = SemanticsConfiguration(); config = SemanticsConfiguration();
renderObj.validActions = <SemanticsAction>[SemanticsAction.tap, SemanticsAction.scrollLeft].toSet(); renderObj.validActions = <SemanticsAction>{SemanticsAction.tap, SemanticsAction.scrollLeft};
renderObj.describeSemanticsConfiguration(config); renderObj.describeSemanticsConfiguration(config);
expect(config.getActionHandler(SemanticsAction.tap), isNotNull); expect(config.getActionHandler(SemanticsAction.tap), isNotNull);
......
...@@ -26,7 +26,7 @@ void main() { ...@@ -26,7 +26,7 @@ void main() {
expect(node.isTagged(tag1), isFalse); expect(node.isTagged(tag1), isFalse);
expect(node.isTagged(tag2), isFalse); expect(node.isTagged(tag2), isFalse);
node.tags = Set<SemanticsTag>()..add(tag1); node.tags = <SemanticsTag>{tag1};
expect(node.isTagged(tag1), isTrue); expect(node.isTagged(tag1), isTrue);
expect(node.isTagged(tag2), isFalse); expect(node.isTagged(tag2), isFalse);
...@@ -36,9 +36,7 @@ void main() { ...@@ -36,9 +36,7 @@ void main() {
}); });
test('getSemanticsData includes tags', () { test('getSemanticsData includes tags', () {
final Set<SemanticsTag> tags = Set<SemanticsTag>() final Set<SemanticsTag> tags = <SemanticsTag>{tag1, tag2};
..add(tag1)
..add(tag2);
final SemanticsNode node = SemanticsNode() final SemanticsNode node = SemanticsNode()
..rect = Rect.fromLTRB(0.0, 0.0, 10.0, 10.0) ..rect = Rect.fromLTRB(0.0, 0.0, 10.0, 10.0)
......
...@@ -20,7 +20,7 @@ class FakeAndroidPlatformViewsController { ...@@ -20,7 +20,7 @@ class FakeAndroidPlatformViewsController {
final Map<int, List<FakeAndroidMotionEvent>> motionEvents = <int, List<FakeAndroidMotionEvent>>{}; final Map<int, List<FakeAndroidMotionEvent>> motionEvents = <int, List<FakeAndroidMotionEvent>>{};
final Set<String> _registeredViewTypes = Set<String>(); final Set<String> _registeredViewTypes = <String>{};
int _textureCounter = 0; int _textureCounter = 0;
...@@ -153,7 +153,7 @@ class FakeIosPlatformViewsController { ...@@ -153,7 +153,7 @@ class FakeIosPlatformViewsController {
Iterable<FakeUiKitView> get views => _views.values; Iterable<FakeUiKitView> get views => _views.values;
final Map<int, FakeUiKitView> _views = <int, FakeUiKitView>{}; final Map<int, FakeUiKitView> _views = <int, FakeUiKitView>{};
final Set<String> _registeredViewTypes = Set<String>(); final Set<String> _registeredViewTypes = <String>{};
// When this completer is non null, the 'create' method channel call will be // When this completer is non null, the 'create' method channel call will be
// delayed until it completes. // delayed until it completes.
......
...@@ -241,7 +241,7 @@ void main() { ...@@ -241,7 +241,7 @@ void main() {
child: ABCModel( // The "inner" model child: ABCModel( // The "inner" model
a: 100 + _a, a: 100 + _a,
b: 100 + _b, b: 100 + _b,
aspects: Set<String>.of(<String>['a']), aspects: <String>{'a'},
child: Center( child: Center(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
...@@ -328,7 +328,7 @@ void main() { ...@@ -328,7 +328,7 @@ void main() {
int _a = 0; int _a = 0;
int _b = 1; int _b = 1;
int _c = 2; int _c = 2;
Set<String> _innerModelAspects = Set<String>.of(<String>['a']); Set<String> _innerModelAspects = <String>{'a'};
// Same as in abcPage in the "Inner InheritedModel shadows the outer one" // Same as in abcPage in the "Inner InheritedModel shadows the outer one"
// test except: the "Add b aspect" changes adds 'b' to the set of // test except: the "Add b aspect" changes adds 'b' to the set of
...@@ -406,14 +406,14 @@ void main() { ...@@ -406,14 +406,14 @@ void main() {
}, },
); );
_innerModelAspects = Set<String>.of(<String>['a']); _innerModelAspects = <String>{'a'};
await tester.pumpWidget(MaterialApp(home: abcPage)); await tester.pumpWidget(MaterialApp(home: abcPage));
expect(find.text('a: 100 [0]'), findsOneWidget); // showA depends on the inner model expect(find.text('a: 100 [0]'), findsOneWidget); // showA depends on the inner model
expect(find.text('b: 1 [0]'), findsOneWidget); // showB depends on the outer model expect(find.text('b: 1 [0]'), findsOneWidget); // showB depends on the outer model
expect(find.text('c: 2 [0]'), findsOneWidget); expect(find.text('c: 2 [0]'), findsOneWidget);
expect(find.text('a: 100 b: 101 c: null'), findsOneWidget); // inner model's a, b, c expect(find.text('a: 100 b: 101 c: null'), findsOneWidget); // inner model's a, b, c
_innerModelAspects = Set<String>.of(<String>['a', 'b']); _innerModelAspects = <String>{'a', 'b'};
await tester.tap(find.text('rebuild')); await tester.tap(find.text('rebuild'));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(find.text('a: 100 [1]'), findsOneWidget); // rebuilt showA still depend on the inner model expect(find.text('a: 100 [1]'), findsOneWidget); // rebuilt showA still depend on the inner model
...@@ -448,7 +448,7 @@ void main() { ...@@ -448,7 +448,7 @@ void main() {
expect(find.text('c: 3 [2]'), findsOneWidget); // rebuilt showC still depends on the outer model expect(find.text('c: 3 [2]'), findsOneWidget); // rebuilt showC still depends on the outer model
expect(find.text('a: 101 b: 102 c: null'), findsOneWidget); expect(find.text('a: 101 b: 102 c: null'), findsOneWidget);
_innerModelAspects = Set<String>.of(<String>['a', 'b', 'c']); _innerModelAspects = <String>{'a', 'b', 'c'};
await tester.tap(find.text('rebuild')); await tester.tap(find.text('rebuild'));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(find.text('a: 101 [3]'), findsOneWidget); // rebuilt showA still depend on the inner model expect(find.text('a: 101 [3]'), findsOneWidget); // rebuilt showA still depend on the inner model
...@@ -457,7 +457,7 @@ void main() { ...@@ -457,7 +457,7 @@ void main() {
expect(find.text('a: 101 b: 102 c: null'), findsOneWidget); // inner model's a, b, c expect(find.text('a: 101 b: 102 c: null'), findsOneWidget); // inner model's a, b, c
// Now the inner model supports no aspects // Now the inner model supports no aspects
_innerModelAspects = Set<String>.of(<String>[]); _innerModelAspects = <String>{};
await tester.tap(find.text('rebuild')); await tester.tap(find.text('rebuild'));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(find.text('a: 1 [4]'), findsOneWidget); // rebuilt showA now depends on the outer model expect(find.text('a: 1 [4]'), findsOneWidget); // rebuilt showA now depends on the outer model
......
...@@ -277,7 +277,7 @@ void main() { ...@@ -277,7 +277,7 @@ void main() {
}); });
testWidgets('builder is never called twice for same index', (WidgetTester tester) async { testWidgets('builder is never called twice for same index', (WidgetTester tester) async {
final Set<int> builtChildren = Set<int>(); final Set<int> builtChildren = <int>{};
final FixedExtentScrollController controller = final FixedExtentScrollController controller =
FixedExtentScrollController(); FixedExtentScrollController();
......
...@@ -590,11 +590,11 @@ void main() { ...@@ -590,11 +590,11 @@ void main() {
height: 100.0, height: 100.0,
child: AndroidView( child: AndroidView(
viewType: 'webview', viewType: 'webview',
gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[ gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{
Factory<VerticalDragGestureRecognizer>( Factory<VerticalDragGestureRecognizer>(
() => VerticalDragGestureRecognizer(), () => VerticalDragGestureRecognizer(),
), ),
].toSet(), },
layoutDirection: TextDirection.ltr, layoutDirection: TextDirection.ltr,
), ),
), ),
...@@ -727,11 +727,11 @@ void main() { ...@@ -727,11 +727,11 @@ void main() {
height: 100.0, height: 100.0,
child: AndroidView( child: AndroidView(
viewType: 'webview', viewType: 'webview',
gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[ gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{
Factory<OneSequenceGestureRecognizer>( Factory<OneSequenceGestureRecognizer>(
() => EagerGestureRecognizer(), () => EagerGestureRecognizer(),
), ),
].toSet(), },
layoutDirection: TextDirection.ltr, layoutDirection: TextDirection.ltr,
), ),
), ),
...@@ -760,11 +760,11 @@ void main() { ...@@ -760,11 +760,11 @@ void main() {
final AndroidView androidView = AndroidView( final AndroidView androidView = AndroidView(
viewType: 'webview', viewType: 'webview',
gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[ gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{
Factory<EagerGestureRecognizer>( Factory<EagerGestureRecognizer>(
() => EagerGestureRecognizer(), () => EagerGestureRecognizer(),
), ),
].toSet(), },
layoutDirection: TextDirection.ltr, layoutDirection: TextDirection.ltr,
); );
...@@ -786,9 +786,9 @@ void main() { ...@@ -786,9 +786,9 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
AndroidView( AndroidView(
viewType: 'webview', viewType: 'webview',
gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[ gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{
Factory<EagerGestureRecognizer>(constructRecognizer), Factory<EagerGestureRecognizer>(constructRecognizer),
].toSet(), },
layoutDirection: TextDirection.ltr, layoutDirection: TextDirection.ltr,
), ),
); );
...@@ -797,9 +797,9 @@ void main() { ...@@ -797,9 +797,9 @@ void main() {
AndroidView( AndroidView(
viewType: 'webview', viewType: 'webview',
hitTestBehavior: PlatformViewHitTestBehavior.translucent, hitTestBehavior: PlatformViewHitTestBehavior.translucent,
gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[ gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{
Factory<EagerGestureRecognizer>(constructRecognizer), Factory<EagerGestureRecognizer>(constructRecognizer),
].toSet(), },
layoutDirection: TextDirection.ltr, layoutDirection: TextDirection.ltr,
), ),
); );
...@@ -1214,11 +1214,11 @@ void main() { ...@@ -1214,11 +1214,11 @@ void main() {
height: 100.0, height: 100.0,
child: UiKitView( child: UiKitView(
viewType: 'webview', viewType: 'webview',
gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[ gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{
Factory<VerticalDragGestureRecognizer>( Factory<VerticalDragGestureRecognizer>(
() => VerticalDragGestureRecognizer(), () => VerticalDragGestureRecognizer(),
), ),
].toSet(), },
layoutDirection: TextDirection.ltr, layoutDirection: TextDirection.ltr,
), ),
), ),
...@@ -1338,11 +1338,11 @@ void main() { ...@@ -1338,11 +1338,11 @@ void main() {
height: 100.0, height: 100.0,
child: UiKitView( child: UiKitView(
viewType: 'webview', viewType: 'webview',
gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[ gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{
Factory<OneSequenceGestureRecognizer>( Factory<OneSequenceGestureRecognizer>(
() => EagerGestureRecognizer(), () => EagerGestureRecognizer(),
), ),
].toSet(), },
layoutDirection: TextDirection.ltr, layoutDirection: TextDirection.ltr,
), ),
), ),
...@@ -1407,9 +1407,9 @@ void main() { ...@@ -1407,9 +1407,9 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
UiKitView( UiKitView(
viewType: 'webview', viewType: 'webview',
gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[ gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{
Factory<EagerGestureRecognizer>(constructRecognizer), Factory<EagerGestureRecognizer>(constructRecognizer),
].toSet(), },
layoutDirection: TextDirection.ltr, layoutDirection: TextDirection.ltr,
), ),
); );
...@@ -1418,9 +1418,9 @@ void main() { ...@@ -1418,9 +1418,9 @@ void main() {
UiKitView( UiKitView(
viewType: 'webview', viewType: 'webview',
hitTestBehavior: PlatformViewHitTestBehavior.translucent, hitTestBehavior: PlatformViewHitTestBehavior.translucent,
gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[ gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{
Factory<EagerGestureRecognizer>(constructRecognizer), Factory<EagerGestureRecognizer>(constructRecognizer),
].toSet(), },
layoutDirection: TextDirection.ltr, layoutDirection: TextDirection.ltr,
), ),
); );
......
...@@ -61,7 +61,7 @@ class TestSemantics { ...@@ -61,7 +61,7 @@ class TestSemantics {
assert(decreasedValue != null), assert(decreasedValue != null),
assert(hint != null), assert(hint != null),
assert(children != null), assert(children != null),
tags = tags?.toSet() ?? Set<SemanticsTag>(); tags = tags?.toSet() ?? <SemanticsTag>{};
/// Creates an object with some test semantics data, with the [id] and [rect] /// Creates an object with some test semantics data, with the [id] and [rect]
/// set to the appropriate values for the root node. /// set to the appropriate values for the root node.
...@@ -92,7 +92,7 @@ class TestSemantics { ...@@ -92,7 +92,7 @@ class TestSemantics {
elevation = 0.0, elevation = 0.0,
thickness = 0.0, thickness = 0.0,
assert(children != null), assert(children != null),
tags = tags?.toSet() ?? Set<SemanticsTag>(); tags = tags?.toSet() ?? <SemanticsTag>{};
/// Creates an object with some test semantics data, with the [id] and [rect] /// Creates an object with some test semantics data, with the [id] and [rect]
/// set to the appropriate values for direct children of the root node. /// set to the appropriate values for direct children of the root node.
...@@ -131,7 +131,7 @@ class TestSemantics { ...@@ -131,7 +131,7 @@ class TestSemantics {
assert(hint != null), assert(hint != null),
transform = _applyRootChildScale(transform), transform = _applyRootChildScale(transform),
assert(children != null), assert(children != null),
tags = tags?.toSet() ?? Set<SemanticsTag>(); tags = tags?.toSet() ?? <SemanticsTag>{};
/// The unique identifier for this node. /// The unique identifier for this node.
/// ///
......
...@@ -573,7 +573,7 @@ class _MaterialLocalizationsDelegate extends LocalizationsDelegate<MaterialLocal ...@@ -573,7 +573,7 @@ class _MaterialLocalizationsDelegate extends LocalizationsDelegate<MaterialLocal
// Keep track of initialzed locales, or will fail on attempted double init. // Keep track of initialzed locales, or will fail on attempted double init.
// This can only happen if a locale with a stripped scriptCode has already // This can only happen if a locale with a stripped scriptCode has already
// been initialzed. This should be removed when scriptCode stripping is removed. // been initialzed. This should be removed when scriptCode stripping is removed.
final Set<String> initializedLocales = Set<String>(); final Set<String> initializedLocales = <String>{};
date_localizations.dateSymbols.forEach((String locale, dynamic data) { date_localizations.dateSymbols.forEach((String locale, dynamic data) {
// Strip scriptCode from the locale, as we do not distinguish between scripts // Strip scriptCode from the locale, as we do not distinguish between scripts
// for dates. // for dates.
......
...@@ -365,7 +365,7 @@ class _Reporter { ...@@ -365,7 +365,7 @@ class _Reporter {
String _lastProgressSuffix; String _lastProgressSuffix;
/// The set of all subscriptions to various streams. /// The set of all subscriptions to various streams.
final Set<StreamSubscription<void>> _subscriptions = Set<StreamSubscription<void>>(); final Set<StreamSubscription<void>> _subscriptions = <StreamSubscription<void>>{};
/// A callback called when the engine begins running [liveTest]. /// A callback called when the engine begins running [liveTest].
void _onTestStarted(LiveTest liveTest) { void _onTestStarted(LiveTest liveTest) {
......
...@@ -551,7 +551,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker ...@@ -551,7 +551,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker
@override @override
Ticker createTicker(TickerCallback onTick) { Ticker createTicker(TickerCallback onTick) {
_tickers ??= Set<_TestTicker>(); _tickers ??= <_TestTicker>{};
final _TestTicker result = _TestTicker(onTick, _removeTicker); final _TestTicker result = _TestTicker(onTick, _removeTicker);
_tickers.add(result); _tickers.add(result);
return result; return result;
......
...@@ -682,7 +682,7 @@ class GradleProject { ...@@ -682,7 +682,7 @@ class GradleProject {
.trim(); .trim();
// Extract build types and product flavors. // Extract build types and product flavors.
final Set<String> variants = Set<String>(); final Set<String> variants = <String>{};
for (String s in tasks.split('\n')) { for (String s in tasks.split('\n')) {
final Match match = _assembleTaskPattern.matchAsPrefix(s); final Match match = _assembleTaskPattern.matchAsPrefix(s);
if (match != null) { if (match != null) {
...@@ -691,8 +691,8 @@ class GradleProject { ...@@ -691,8 +691,8 @@ class GradleProject {
variants.add(variant); variants.add(variant);
} }
} }
final Set<String> buildTypes = Set<String>(); final Set<String> buildTypes = <String>{};
final Set<String> productFlavors = Set<String>(); final Set<String> productFlavors = <String>{};
for (final String variant1 in variants) { for (final String variant1 in variants) {
for (final String variant2 in variants) { for (final String variant2 in variants) {
if (variant2.startsWith(variant1) && variant2 != variant1) { if (variant2.startsWith(variant1) && variant2 != variant1) {
......
...@@ -320,7 +320,7 @@ Future<DevFSContent> _obtainLicenses( ...@@ -320,7 +320,7 @@ Future<DevFSContent> _obtainLicenses(
// example, a package might itself contain code from multiple third-party // example, a package might itself contain code from multiple third-party
// sources, and might need to include a license for each one.) // sources, and might need to include a license for each one.)
final Map<String, Set<String>> packageLicenses = <String, Set<String>>{}; final Map<String, Set<String>> packageLicenses = <String, Set<String>>{};
final Set<String> allPackages = Set<String>(); final Set<String> allPackages = <String>{};
for (String packageName in packageMap.map.keys) { for (String packageName in packageMap.map.keys) {
final Uri package = packageMap.map[packageName]; final Uri package = packageMap.map[packageName];
if (package != null && package.scheme == 'file') { if (package != null && package.scheme == 'file') {
...@@ -342,7 +342,7 @@ Future<DevFSContent> _obtainLicenses( ...@@ -342,7 +342,7 @@ Future<DevFSContent> _obtainLicenses(
packageNames = <String>[packageName]; packageNames = <String>[packageName];
licenseText = rawLicense; licenseText = rawLicense;
} }
packageLicenses.putIfAbsent(licenseText, () => Set<String>()) packageLicenses.putIfAbsent(licenseText, () => <String>{})
..addAll(packageNames); ..addAll(packageNames);
allPackages.addAll(packageNames); allPackages.addAll(packageNames);
} }
......
...@@ -118,7 +118,7 @@ class AOTSnapshotter { ...@@ -118,7 +118,7 @@ class AOTSnapshotter {
final String vmServicePath = fs.path.join(skyEnginePkg, 'sdk_ext', 'vmservice_io.dart'); final String vmServicePath = fs.path.join(skyEnginePkg, 'sdk_ext', 'vmservice_io.dart');
final List<String> inputPaths = <String>[uiPath, vmServicePath, mainPath]; final List<String> inputPaths = <String>[uiPath, vmServicePath, mainPath];
final Set<String> outputPaths = Set<String>(); final Set<String> outputPaths = <String>{};
final String depfilePath = fs.path.join(outputDir.path, 'snapshot.d'); final String depfilePath = fs.path.join(outputDir.path, 'snapshot.d');
final List<String> genSnapshotArgs = <String>[ final List<String> genSnapshotArgs = <String>[
...@@ -458,7 +458,7 @@ class JITSnapshotter { ...@@ -458,7 +458,7 @@ class JITSnapshotter {
genSnapshotArgs.addAll(extraGenSnapshotOptions); genSnapshotArgs.addAll(extraGenSnapshotOptions);
} }
final Set<String> outputPaths = Set<String>(); final Set<String> outputPaths = <String>{};
outputPaths.addAll(<String>[isolateSnapshotData]); outputPaths.addAll(<String>[isolateSnapshotData]);
if (!createPatch) { if (!createPatch) {
outputPaths.add(isolateSnapshotInstructions); outputPaths.add(isolateSnapshotInstructions);
......
...@@ -146,7 +146,7 @@ String getDisplayPath(String fullPath) { ...@@ -146,7 +146,7 @@ String getDisplayPath(String fullPath) {
/// available. /// available.
class ItemListNotifier<T> { class ItemListNotifier<T> {
ItemListNotifier() { ItemListNotifier() {
_items = Set<T>(); _items = <T>{};
} }
ItemListNotifier.from(List<T> items) { ItemListNotifier.from(List<T> items) {
......
...@@ -26,7 +26,7 @@ class AnalyzeContinuously extends AnalyzeBase { ...@@ -26,7 +26,7 @@ class AnalyzeContinuously extends AnalyzeBase {
String analysisTarget; String analysisTarget;
bool firstAnalysis = true; bool firstAnalysis = true;
Set<String> analyzedPaths = Set<String>(); Set<String> analyzedPaths = <String>{};
Map<String, List<AnalysisError>> analysisErrors = <String, List<AnalysisError>>{}; Map<String, List<AnalysisError>> analysisErrors = <String, List<AnalysisError>>{};
Stopwatch analysisTimer; Stopwatch analysisTimer;
int lastErrorCount = 0; int lastErrorCount = 0;
......
...@@ -52,7 +52,7 @@ class ChannelCommand extends FlutterCommand { ...@@ -52,7 +52,7 @@ class ChannelCommand extends FlutterCommand {
// Beware: currentBranch could contain PII. See getBranchName(). // Beware: currentBranch could contain PII. See getBranchName().
final String currentChannel = FlutterVersion.instance.channel; final String currentChannel = FlutterVersion.instance.channel;
final String currentBranch = FlutterVersion.instance.getBranchName(); final String currentBranch = FlutterVersion.instance.getBranchName();
final Set<String> seenChannels = Set<String>(); final Set<String> seenChannels = <String>{};
final List<String> rawOutput = <String>[]; final List<String> rawOutput = <String>[];
showAll = showAll || currentChannel != currentBranch; showAll = showAll || currentChannel != currentBranch;
......
...@@ -612,7 +612,7 @@ String _createUTIIdentifier(String organization, String name) { ...@@ -612,7 +612,7 @@ String _createUTIIdentifier(String organization, String name) {
return segments.join('.'); return segments.join('.');
} }
final Set<String> _packageDependencies = Set<String>.from(<String>[ const Set<String> _packageDependencies = <String>{
'analyzer', 'analyzer',
'args', 'args',
'async', 'async',
...@@ -639,7 +639,7 @@ final Set<String> _packageDependencies = Set<String>.from(<String>[ ...@@ -639,7 +639,7 @@ final Set<String> _packageDependencies = Set<String>.from(<String>[
'utf', 'utf',
'watcher', 'watcher',
'yaml', 'yaml',
]); };
/// Return null if the project name is legal. Return a validation message if /// Return null if the project name is legal. Return a validation message if
/// we should disallow the project name. /// we should disallow the project name.
......
...@@ -121,7 +121,7 @@ class IdeConfigCommand extends FlutterCommand { ...@@ -121,7 +121,7 @@ class IdeConfigCommand extends FlutterCommand {
return; return;
} }
final Set<String> manifest = Set<String>(); final Set<String> manifest = <String>{};
final List<FileSystemEntity> flutterFiles = _flutterRoot.listSync(recursive: true); final List<FileSystemEntity> flutterFiles = _flutterRoot.listSync(recursive: true);
for (FileSystemEntity entity in flutterFiles) { for (FileSystemEntity entity in flutterFiles) {
final String relativePath = fs.path.relative(entity.path, from: _flutterRoot.absolute.path); final String relativePath = fs.path.relative(entity.path, from: _flutterRoot.absolute.path);
......
...@@ -200,7 +200,7 @@ class UpdatePackagesCommand extends FlutterCommand { ...@@ -200,7 +200,7 @@ class UpdatePackagesCommand extends FlutterCommand {
// First, collect up the explicit dependencies: // First, collect up the explicit dependencies:
final List<PubspecYaml> pubspecs = <PubspecYaml>[]; final List<PubspecYaml> pubspecs = <PubspecYaml>[];
final Map<String, PubspecDependency> dependencies = <String, PubspecDependency>{}; final Map<String, PubspecDependency> dependencies = <String, PubspecDependency>{};
final Set<String> specialDependencies = Set<String>(); final Set<String> specialDependencies = <String>{};
for (Directory directory in packages) { // these are all the directories with pubspec.yamls we care about for (Directory directory in packages) { // these are all the directories with pubspec.yamls we care about
printTrace('Reading pubspec.yaml from: ${directory.path}'); printTrace('Reading pubspec.yaml from: ${directory.path}');
PubspecYaml pubspec; PubspecYaml pubspec;
...@@ -279,7 +279,7 @@ class UpdatePackagesCommand extends FlutterCommand { ...@@ -279,7 +279,7 @@ class UpdatePackagesCommand extends FlutterCommand {
for (PubspecDependency dependency in pubspec.dependencies) { for (PubspecDependency dependency in pubspec.dependencies) {
if (dependency.kind == DependencyKind.normal) { if (dependency.kind == DependencyKind.normal) {
tree._versions[package] = version; tree._versions[package] = version;
tree._dependencyTree[package] ??= Set<String>(); tree._dependencyTree[package] ??= <String>{};
tree._dependencyTree[package].add(dependency.name); tree._dependencyTree[package].add(dependency.name);
} }
} }
...@@ -341,7 +341,7 @@ class UpdatePackagesCommand extends FlutterCommand { ...@@ -341,7 +341,7 @@ class UpdatePackagesCommand extends FlutterCommand {
throwToolExit('Package $to not found in the dependency tree.'); throwToolExit('Package $to not found in the dependency tree.');
final Queue<_DependencyLink> traversalQueue = Queue<_DependencyLink>(); final Queue<_DependencyLink> traversalQueue = Queue<_DependencyLink>();
final Set<String> visited = Set<String>(); final Set<String> visited = <String>{};
final List<_DependencyLink> paths = <_DependencyLink>[]; final List<_DependencyLink> paths = <_DependencyLink>[];
traversalQueue.addFirst(_DependencyLink(from: null, to: from)); traversalQueue.addFirst(_DependencyLink(from: null, to: from));
...@@ -625,8 +625,8 @@ class PubspecYaml { ...@@ -625,8 +625,8 @@ class PubspecYaml {
void apply(PubDependencyTree versions, Set<String> specialDependencies) { void apply(PubDependencyTree versions, Set<String> specialDependencies) {
assert(versions != null); assert(versions != null);
final List<String> output = <String>[]; // the string data to output to the file, line by line final List<String> output = <String>[]; // the string data to output to the file, line by line
final Set<String> directDependencies = Set<String>(); // packages this pubspec directly depends on (i.e. not transitive) final Set<String> directDependencies = <String>{}; // packages this pubspec directly depends on (i.e. not transitive)
final Set<String> devDependencies = Set<String>(); final Set<String> devDependencies = <String>{};
Section section = Section.other; // the section we're currently handling Section section = Section.other; // the section we're currently handling
// the line number where we're going to insert the transitive dependencies. // the line number where we're going to insert the transitive dependencies.
...@@ -723,8 +723,8 @@ class PubspecYaml { ...@@ -723,8 +723,8 @@ class PubspecYaml {
final List<String> transitiveDevDependencyOutput = <String>[]; final List<String> transitiveDevDependencyOutput = <String>[];
// Which dependencies we need to handle for the transitive and dev dependency sections. // Which dependencies we need to handle for the transitive and dev dependency sections.
final Set<String> transitiveDependencies = Set<String>(); final Set<String> transitiveDependencies = <String>{};
final Set<String> transitiveDevDependencies = Set<String>(); final Set<String> transitiveDevDependencies = <String>{};
// Merge the lists of dependencies we've seen in this file from dependencies, dev dependencies, // Merge the lists of dependencies we've seen in this file from dependencies, dev dependencies,
// and the dependencies we know this file mentions that are already pinned // and the dependencies we know this file mentions that are already pinned
...@@ -735,7 +735,7 @@ class PubspecYaml { ...@@ -735,7 +735,7 @@ class PubspecYaml {
// Create a new set to hold the list of packages we've already processed, so // Create a new set to hold the list of packages we've already processed, so
// that we don't redundantly process them multiple times. // that we don't redundantly process them multiple times.
final Set<String> done = Set<String>(); final Set<String> done = <String>{};
for (String package in directDependencies) for (String package in directDependencies)
transitiveDependencies.addAll(versions.getTransitiveDependenciesFor(package, seen: done, exclude: implied)); transitiveDependencies.addAll(versions.getTransitiveDependenciesFor(package, seen: done, exclude: implied));
for (String package in devDependencies) for (String package in devDependencies)
...@@ -752,7 +752,7 @@ class PubspecYaml { ...@@ -752,7 +752,7 @@ class PubspecYaml {
transitiveDevDependencyOutput.add(' $package: ${versions.versionFor(package)} $kTransitiveMagicString'); transitiveDevDependencyOutput.add(' $package: ${versions.versionFor(package)} $kTransitiveMagicString');
// Build a sorted list of all dependencies for the checksum. // Build a sorted list of all dependencies for the checksum.
final Set<String> checksumDependencies = Set<String>() final Set<String> checksumDependencies = <String>{}
..addAll(directDependencies) ..addAll(directDependencies)
..addAll(devDependencies) ..addAll(devDependencies)
..addAll(transitiveDependenciesAsList) ..addAll(transitiveDependenciesAsList)
......
...@@ -11,7 +11,7 @@ class DependencyChecker { ...@@ -11,7 +11,7 @@ class DependencyChecker {
DependencyChecker(this.builder, this.assets); DependencyChecker(this.builder, this.assets);
final DartDependencySetBuilder builder; final DartDependencySetBuilder builder;
final Set<String> _dependencies = Set<String>(); final Set<String> _dependencies = <String>{};
final AssetBundle assets; final AssetBundle assets;
/// Returns [true] if any components have been modified after [threshold] or /// Returns [true] if any components have been modified after [threshold] or
......
...@@ -403,7 +403,7 @@ class DevFS { ...@@ -403,7 +403,7 @@ class DevFS {
final Directory rootDirectory; final Directory rootDirectory;
String _packagesFilePath; String _packagesFilePath;
final Map<Uri, DevFSContent> _entries = <Uri, DevFSContent>{}; final Map<Uri, DevFSContent> _entries = <Uri, DevFSContent>{};
final Set<String> assetPathsToEvict = Set<String>(); final Set<String> assetPathsToEvict = <String>{};
final List<Future<Map<String, dynamic>>> _pendingOperations = final List<Future<Map<String, dynamic>>> _pendingOperations =
<Future<Map<String, dynamic>>>[]; <Future<Map<String, dynamic>>>[];
...@@ -533,7 +533,7 @@ class DevFS { ...@@ -533,7 +533,7 @@ class DevFS {
// run with no changes is supposed to be fast (considering that it is // run with no changes is supposed to be fast (considering that it is
// initiated by user key press). // initiated by user key press).
final List<String> invalidatedFiles = <String>[]; final List<String> invalidatedFiles = <String>[];
final Set<Uri> filesUris = Set<Uri>(); final Set<Uri> filesUris = <Uri>{};
for (Uri uri in dirtyEntries.keys.toList()) { for (Uri uri in dirtyEntries.keys.toList()) {
if (!uri.path.startsWith(assetBuildDirPrefix)) { if (!uri.path.startsWith(assetBuildDirPrefix)) {
final DevFSContent content = dirtyEntries[uri]; final DevFSContent content = dirtyEntries[uri];
......
...@@ -391,9 +391,9 @@ void _validateFonts(YamlList fonts, List<String> errors) { ...@@ -391,9 +391,9 @@ void _validateFonts(YamlList fonts, List<String> errors) {
if (fonts == null) { if (fonts == null) {
return; return;
} }
final Set<int> fontWeights = Set<int>.from(const <int>[ const Set<int> fontWeights = <int>{
100, 200, 300, 400, 500, 600, 700, 800, 900, 100, 200, 300, 400, 500, 600, 700, 800, 900,
]); };
for (final YamlMap fontMap in fonts) { for (final YamlMap fontMap in fonts) {
for (dynamic key in fontMap.keys.where((dynamic key) => key != 'family' && key != 'fonts')) { for (dynamic key in fontMap.keys.where((dynamic key) => key != 'family' && key != 'fonts')) {
errors.add('Unexpected child "$key" found under "fonts".'); errors.add('Unexpected child "$key" found under "fonts".');
......
...@@ -733,7 +733,7 @@ Future<bool> upgradePbxProjWithFlutterAssets(IosProject project) async { ...@@ -733,7 +733,7 @@ Future<bool> upgradePbxProjWithFlutterAssets(IosProject project) async {
final RegExp oldAssets = RegExp(r'\/\* (flutter_assets|app\.flx)'); final RegExp oldAssets = RegExp(r'\/\* (flutter_assets|app\.flx)');
final StringBuffer buffer = StringBuffer(); final StringBuffer buffer = StringBuffer();
final Set<String> printedStatuses = Set<String>(); final Set<String> printedStatuses = <String>{};
for (final String line in lines) { for (final String line in lines) {
final Match match = oldAssets.firstMatch(line); final Match match = oldAssets.firstMatch(line);
......
...@@ -43,12 +43,12 @@ class FlutterVersion { ...@@ -43,12 +43,12 @@ class FlutterVersion {
String _repositoryUrl; String _repositoryUrl;
String get repositoryUrl => _repositoryUrl; String get repositoryUrl => _repositoryUrl;
static Set<String> officialChannels = Set<String>.from(<String>[ static const Set<String> officialChannels = <String>{
'master', 'master',
'dev', 'dev',
'beta', 'beta',
'stable', 'stable',
]); };
/// This maps old branch names to the names of branches that replaced them. /// This maps old branch names to the names of branches that replaced them.
/// ///
......
...@@ -272,7 +272,7 @@ class VMService { ...@@ -272,7 +272,7 @@ class VMService {
final Map<String, StreamController<ServiceEvent>> _eventControllers = final Map<String, StreamController<ServiceEvent>> _eventControllers =
<String, StreamController<ServiceEvent>>{}; <String, StreamController<ServiceEvent>>{};
final Set<String> _listeningFor = Set<String>(); final Set<String> _listeningFor = <String>{};
/// Whether our connection to the VM service has been closed; /// Whether our connection to the VM service has been closed;
bool get isClosed => _peer.isClosed; bool get isClosed => _peer.isClosed;
...@@ -749,7 +749,7 @@ class VM extends ServiceObjectOwner { ...@@ -749,7 +749,7 @@ class VM extends ServiceObjectOwner {
void _removeDeadIsolates(List<Isolate> newIsolates) { void _removeDeadIsolates(List<Isolate> newIsolates) {
// Build a set of new isolates. // Build a set of new isolates.
final Set<String> newIsolateSet = Set<String>(); final Set<String> newIsolateSet = <String>{};
for (Isolate iso in newIsolates) for (Isolate iso in newIsolates)
newIsolateSet.add(iso.id); newIsolateSet.add(iso.id);
......
...@@ -300,7 +300,7 @@ void main() { ...@@ -300,7 +300,7 @@ void main() {
const String packageName = 'doubleslashpkg'; const String packageName = 'doubleslashpkg';
await _createPackage(fs, packageName, 'somefile.txt', doubleSlash: true); await _createPackage(fs, packageName, 'somefile.txt', doubleSlash: true);
final Set<String> fileFilter = Set<String>(); final Set<String> fileFilter = <String>{};
final List<Uri> pkgUris = <Uri>[fs.path.toUri(basePath)]..addAll(_packages.values); final List<Uri> pkgUris = <Uri>[fs.path.toUri(basePath)]..addAll(_packages.values);
for (Uri pkgUri in pkgUris) { for (Uri pkgUri in pkgUris) {
if (!pkgUri.isAbsolute) { if (!pkgUri.isAbsolute) {
......
...@@ -114,7 +114,7 @@ void main() { ...@@ -114,7 +114,7 @@ void main() {
pathToReload: anyNamed('pathToReload'), pathToReload: anyNamed('pathToReload'),
)).thenAnswer((Invocation _) => Future<UpdateFSReport>.value( )).thenAnswer((Invocation _) => Future<UpdateFSReport>.value(
UpdateFSReport(success: true, syncedBytes: 1000, invalidatedSourcesCount: 1))); UpdateFSReport(success: true, syncedBytes: 1000, invalidatedSourcesCount: 1)));
when(mockDevFs.assetPathsToEvict).thenReturn(Set<String>()); when(mockDevFs.assetPathsToEvict).thenReturn(<String>{});
when(mockDevFs.baseUri).thenReturn(Uri.file('test')); when(mockDevFs.baseUri).thenReturn(Uri.file('test'));
setUp(() { setUp(() {
......
...@@ -62,7 +62,7 @@ baz=qux ...@@ -62,7 +62,7 @@ baz=qux
}); });
test('is pretty random', () { test('is pretty random', () {
final Set<String> set = Set<String>(); final Set<String> set = <String>{};
Uuid uuid = Uuid(); Uuid uuid = Uuid();
for (int i = 0; i < 64; i++) { for (int i = 0; i < 64; i++) {
......
...@@ -117,7 +117,7 @@ class FuchsiaRemoteConnection { ...@@ -117,7 +117,7 @@ class FuchsiaRemoteConnection {
final Map<int, PortForwarder> _dartVmPortMap = <int, PortForwarder>{}; final Map<int, PortForwarder> _dartVmPortMap = <int, PortForwarder>{};
/// Tracks stale ports so as not to reconnect while polling. /// Tracks stale ports so as not to reconnect while polling.
final Set<int> _stalePorts = Set<int>(); final Set<int> _stalePorts = <int>{};
/// A broadcast stream that emits events relating to Dart VM's as they update. /// A broadcast stream that emits events relating to Dart VM's as they update.
Stream<DartVmEvent> get onDartVmEvent => _onDartVmEvent; Stream<DartVmEvent> get onDartVmEvent => _onDartVmEvent;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment