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
f5a99025
Unverified
Commit
f5a99025
authored
Apr 06, 2020
by
Alexandre Ardhuin
Committed by
GitHub
Apr 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable avoid_equals_and_hash_code_on_mutable_classes (#52507)
parent
80bc3f4a
Changes
76
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
76 changed files
with
308 additions
and
199 deletions
+308
-199
analysis_options.yaml
analysis_options.yaml
+1
-1
analyze.dart
dev/bots/analyze.dart
+93
-92
analyze_test.dart
dev/bots/test/analyze_test.dart
+3
-3
adb_test.dart
dev/devicelab/test/adb_test.dart
+3
-1
sections.dart
...on_tests/flutter_gallery/lib/demo/animation/sections.dart
+1
-0
demo.dart
dev/integration_tests/flutter_gallery/lib/gallery/demo.dart
+2
-1
demos.dart
dev/integration_tests/flutter_gallery/lib/gallery/demos.dart
+1
-0
options.dart
...ntegration_tests/flutter_gallery/lib/gallery/options.dart
+2
-1
scales.dart
...integration_tests/flutter_gallery/lib/gallery/scales.dart
+2
-0
localizations_utils.dart
dev/tools/localization/localizations_utils.dart
+2
-1
vitool.dart
dev/tools/vitool/lib/vitool.dart
+3
-0
nav_bar.dart
packages/flutter/lib/src/cupertino/nav_bar.dart
+1
-0
velocity_tracker.dart
packages/flutter/lib/src/gestures/velocity_tracker.dart
+1
-0
app_bar_theme.dart
packages/flutter/lib/src/material/app_bar_theme.dart
+1
-0
banner_theme.dart
packages/flutter/lib/src/material/banner_theme.dart
+1
-0
bottom_app_bar_theme.dart
packages/flutter/lib/src/material/bottom_app_bar_theme.dart
+1
-0
bottom_sheet_theme.dart
packages/flutter/lib/src/material/bottom_sheet_theme.dart
+1
-0
button_bar_theme.dart
packages/flutter/lib/src/material/button_bar_theme.dart
+1
-0
button_theme.dart
packages/flutter/lib/src/material/button_theme.dart
+1
-0
card_theme.dart
packages/flutter/lib/src/material/card_theme.dart
+1
-0
chip.dart
packages/flutter/lib/src/material/chip.dart
+1
-0
chip_theme.dart
packages/flutter/lib/src/material/chip_theme.dart
+1
-0
dialog_theme.dart
packages/flutter/lib/src/material/dialog_theme.dart
+1
-0
divider_theme.dart
packages/flutter/lib/src/material/divider_theme.dart
+1
-0
dropdown.dart
packages/flutter/lib/src/material/dropdown.dart
+1
-0
floating_action_button_theme.dart
...lutter/lib/src/material/floating_action_button_theme.dart
+1
-0
input_decorator.dart
packages/flutter/lib/src/material/input_decorator.dart
+3
-0
navigation_rail_theme.dart
packages/flutter/lib/src/material/navigation_rail_theme.dart
+1
-0
popup_menu_theme.dart
packages/flutter/lib/src/material/popup_menu_theme.dart
+1
-0
slider_theme.dart
packages/flutter/lib/src/material/slider_theme.dart
+3
-0
snack_bar_theme.dart
packages/flutter/lib/src/material/snack_bar_theme.dart
+1
-0
tab_bar_theme.dart
packages/flutter/lib/src/material/tab_bar_theme.dart
+1
-0
theme_data.dart
packages/flutter/lib/src/material/theme_data.dart
+3
-1
toggle_buttons_theme.dart
packages/flutter/lib/src/material/toggle_buttons_theme.dart
+1
-0
tooltip_theme.dart
packages/flutter/lib/src/material/tooltip_theme.dart
+1
-0
_network_image_io.dart
packages/flutter/lib/src/painting/_network_image_io.dart
+1
-0
_network_image_web.dart
packages/flutter/lib/src/painting/_network_image_web.dart
+1
-0
colors.dart
packages/flutter/lib/src/painting/colors.dart
+1
-0
image_cache.dart
packages/flutter/lib/src/painting/image_cache.dart
+1
-0
image_provider.dart
packages/flutter/lib/src/painting/image_provider.dart
+4
-0
image_resolution.dart
packages/flutter/lib/src/painting/image_resolution.dart
+1
-0
keyboard_key.dart
packages/flutter/lib/src/services/keyboard_key.dart
+2
-0
raw_keyboard.dart
packages/flutter/lib/src/services/raw_keyboard.dart
+1
-0
system_chrome.dart
packages/flutter/lib/src/services/system_chrome.dart
+1
-0
text_input.dart
packages/flutter/lib/src/services/text_input.dart
+1
-0
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+4
-0
icon_theme_data.dart
packages/flutter/lib/src/widgets/icon_theme_data.dart
+1
-0
page_storage.dart
packages/flutter/lib/src/widgets/page_storage.dart
+2
-1
shortcuts.dart
packages/flutter/lib/src/widgets/shortcuts.dart
+2
-0
widget_inspector.dart
packages/flutter/lib/src/widgets/widget_inspector.dart
+3
-1
image_provider_test.dart
packages/flutter/test/painting/image_provider_test.dart
+1
-1
fake_platform_views.dart
packages/flutter/test/services/fake_platform_views.dart
+23
-10
platform_views_test.dart
packages/flutter/test/services/platform_views_test.dart
+10
-10
image_resolution_test.dart
packages/flutter/test/widgets/image_resolution_test.dart
+1
-1
image_test.dart
packages/flutter/test/widgets/image_test.dart
+1
-0
key_test.dart
packages/flutter/test/widgets/key_test.dart
+1
-0
shortcuts_test.dart
packages/flutter/test/widgets/shortcuts_test.dart
+3
-0
driver.dart
packages/flutter_driver/lib/src/driver/driver.dart
+1
-0
matchers_test.dart
packages/flutter_test/test/matchers_test.dart
+9
-8
asset.dart
packages/flutter_tools/lib/src/asset.dart
+2
-1
fingerprint.dart
packages/flutter_tools/lib/src/base/fingerprint.dart
+23
-13
version.dart
packages/flutter_tools/lib/src/base/version.dart
+3
-0
device.dart
packages/flutter_tools/lib/src/device.dart
+4
-0
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+8
-6
emulator.dart
packages/flutter_tools/lib/src/emulator.dart
+4
-1
ios_emulators.dart
packages/flutter_tools/lib/src/ios/ios_emulators.dart
+1
-1
linux_doctor.dart
packages/flutter_tools/lib/src/linux/linux_doctor.dart
+2
-2
proxy_validator.dart
packages/flutter_tools/lib/src/proxy_validator.dart
+2
-2
vscode.dart
packages/flutter_tools/lib/src/vscode/vscode.dart
+1
-1
web_validator.dart
packages/flutter_tools/lib/src/web/web_validator.dart
+1
-1
doctor_test.dart
...utter_tools/test/commands.shard/hermetic/doctor_test.dart
+18
-18
android_emulator_test.dart
...ols/test/general.shard/android/android_emulator_test.dart
+1
-1
fingerprint_test.dart
...utter_tools/test/general.shard/base/fingerprint_test.dart
+9
-9
emulator_test.dart
packages/flutter_tools/test/general.shard/emulator_test.dart
+5
-5
linux_doctor_test.dart
...ter_tools/test/general.shard/linux/linux_doctor_test.dart
+4
-4
web_validator_test.dart
...tter_tools/test/general.shard/web/web_validator_test.dart
+1
-1
No files found.
analysis_options.yaml
View file @
f5a99025
...
...
@@ -59,7 +59,7 @@ linter:
-
avoid_classes_with_only_static_members
# - avoid_double_and_int_checks # only useful when targeting JS runtime
-
avoid_empty_else
# - avoid_equals_and_hash_code_on_mutable_classes # not yet tested
-
avoid_equals_and_hash_code_on_mutable_classes
-
avoid_field_initializers_in_const_classes
-
avoid_function_literals_in_foreach_calls
# - avoid_implementing_value_types # not yet tested
...
...
dev/bots/analyze.dart
View file @
f5a99025
This diff is collapsed.
Click to expand it.
dev/bots/test/analyze_test.dart
View file @
f5a99025
...
...
@@ -95,7 +95,7 @@ void main() {
test
(
'analyze.dart - verifyNoBinaries - positive'
,
()
async
{
final
String
result
=
await
capture
(()
=>
verifyNoBinaries
(
testRootPath
,
grandfatheredBinaries:
<
Hash256
>{
Hash256
(
0x39A050CD69434936
,
0
,
0
,
0
)},
grandfatheredBinaries:
<
Hash256
>{
const
Hash256
(
0x39A050CD69434936
,
0
,
0
,
0
)},
),
exitCode:
Platform
.
isWindows
?
0
:
1
);
if
(!
Platform
.
isWindows
)
{
// The output starts with the call to git ls-files, the details of which
...
...
@@ -117,8 +117,8 @@ void main() {
await
capture
(()
=>
verifyNoBinaries
(
testRootPath
,
grandfatheredBinaries:
<
Hash256
>{
Hash256
(
0xA8100AE6AA1940D0
,
0xB663BB31CD466142
,
0xEBBDBD5187131B92
,
0xD93818987832EB89
),
// sha256("\xff")
Hash256
(
0x155644D3F13D98BF
,
0
,
0
,
0
),
const
Hash256
(
0xA8100AE6AA1940D0
,
0xB663BB31CD466142
,
0xEBBDBD5187131B92
,
0xD93818987832EB89
),
// sha256("\xff")
const
Hash256
(
0x155644D3F13D98BF
,
0
,
0
,
0
),
},
),
exitCode:
0
);
});
...
...
dev/devicelab/test/adb_test.dart
View file @
f5a99025
...
...
@@ -7,6 +7,7 @@ import 'dart:async';
import
'package:collection/collection.dart'
show
ListEquality
,
MapEquality
;
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:meta/meta.dart'
;
import
'common.dart'
;
...
...
@@ -124,8 +125,9 @@ CommandArgs cmd({
typedef
ExitErrorFactory
=
dynamic
Function
();
@immutable
class
CommandArgs
{
CommandArgs
({
this
.
command
,
this
.
arguments
,
this
.
environment
});
const
CommandArgs
({
this
.
command
,
this
.
arguments
,
this
.
environment
});
final
String
command
;
final
List
<
String
>
arguments
;
...
...
dev/integration_tests/flutter_gallery/lib/demo/animation/sections.dart
View file @
f5a99025
...
...
@@ -26,6 +26,7 @@ class SectionDetail {
final
String
imageAssetPackage
;
}
@immutable
class
Section
{
const
Section
({
this
.
title
,
...
...
dev/integration_tests/flutter_gallery/lib/gallery/demo.dart
View file @
f5a99025
...
...
@@ -12,8 +12,9 @@ import 'demos.dart';
import
'example_code_parser.dart'
;
import
'syntax_highlighter.dart'
;
@immutable
class
ComponentDemoTabData
{
ComponentDemoTabData
({
const
ComponentDemoTabData
({
this
.
demoWidget
,
this
.
exampleCodeTag
,
this
.
description
,
...
...
dev/integration_tests/flutter_gallery/lib/gallery/demos.dart
View file @
f5a99025
...
...
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
import
'../demo/all.dart'
;
import
'icons.dart'
;
@immutable
class
GalleryDemoCategory
{
const
GalleryDemoCategory
.
_
({
@required
this
.
name
,
...
...
dev/integration_tests/flutter_gallery/lib/gallery/options.dart
View file @
f5a99025
...
...
@@ -7,8 +7,9 @@ import 'package:flutter/material.dart';
import
'about.dart'
;
import
'scales.dart'
;
@immutable
class
GalleryOptions
{
GalleryOptions
({
const
GalleryOptions
({
this
.
themeMode
,
this
.
textScaleFactor
,
this
.
visualDensity
,
...
...
dev/integration_tests/flutter_gallery/lib/gallery/scales.dart
View file @
f5a99025
...
...
@@ -4,6 +4,7 @@
import
'package:flutter/material.dart'
;
@immutable
class
GalleryTextScaleValue
{
const
GalleryTextScaleValue
(
this
.
scale
,
this
.
label
);
...
...
@@ -37,6 +38,7 @@ const List<GalleryTextScaleValue> kAllGalleryTextScaleValues = <GalleryTextScale
GalleryTextScaleValue
(
2.0
,
'Huge'
),
];
@immutable
class
GalleryVisualDensityValue
{
const
GalleryVisualDensityValue
(
this
.
visualDensity
,
this
.
label
);
...
...
dev/tools/localization/localizations_utils.dart
View file @
f5a99025
...
...
@@ -18,8 +18,9 @@ int sortFilesByPath (FileSystemEntity a, FileSystemEntity b) {
}
/// Simple data class to hold parsed locale. Does not promise validity of any data.
@immutable
class
LocaleInfo
implements
Comparable
<
LocaleInfo
>
{
LocaleInfo
({
const
LocaleInfo
({
this
.
languageCode
,
this
.
scriptCode
,
this
.
countryCode
,
...
...
dev/tools/vitool/lib/vitool.dart
View file @
f5a99025
...
...
@@ -260,6 +260,7 @@ List<Point<double>> parsePoints(String points) {
}
/// Data for a single animation frame.
@immutable
class
FrameData
{
const
FrameData
(
this
.
size
,
this
.
paths
);
...
...
@@ -285,6 +286,7 @@ class FrameData {
}
/// Represents an SVG path element.
@immutable
class
SvgPath
{
const
SvgPath
(
this
.
id
,
this
.
commands
,
{
this
.
opacity
=
1.0
});
...
...
@@ -348,6 +350,7 @@ class SvgPath {
/// * "Z" => SvgPathCommand('Z', [])
/// * "C 1.0, 1.0 2.0, 2.0 3.0, 3.0" SvgPathCommand('C', [Point(1.0, 1.0),
/// Point(2.0, 2.0), Point(3.0, 3.0)])
@immutable
class
SvgPathCommand
{
const
SvgPathCommand
(
this
.
type
,
this
.
points
);
...
...
packages/flutter/lib/src/cupertino/nav_bar.dart
View file @
f5a99025
...
...
@@ -52,6 +52,7 @@ const Border _kDefaultNavBarBorder = Border(
// all transition between each other (per Navigator) via Hero transitions.
const
_HeroTag
_defaultHeroTag
=
_HeroTag
(
null
);
@immutable
class
_HeroTag
{
const
_HeroTag
(
this
.
navigator
);
...
...
packages/flutter/lib/src/gestures/velocity_tracker.dart
View file @
f5a99025
...
...
@@ -11,6 +11,7 @@ import 'lsq_solver.dart';
export
'dart:ui'
show
Offset
;
/// A velocity in two dimensions.
@immutable
class
Velocity
{
/// Creates a velocity.
///
...
...
packages/flutter/lib/src/material/app_bar_theme.dart
View file @
f5a99025
...
...
@@ -27,6 +27,7 @@ import 'theme.dart';
///
/// * [ThemeData], which describes the overall theme information for the
/// application.
@immutable
class
AppBarTheme
with
Diagnosticable
{
/// Creates a theme that can be used for [ThemeData.AppBarTheme].
const
AppBarTheme
({
...
...
packages/flutter/lib/src/material/banner_theme.dart
View file @
f5a99025
...
...
@@ -23,6 +23,7 @@ import 'theme.dart';
///
/// * [ThemeData], which describes the overall theme information for the
/// application.
@immutable
class
MaterialBannerThemeData
with
Diagnosticable
{
/// Creates a theme that can be used for [MaterialBannerTheme] or
...
...
packages/flutter/lib/src/material/bottom_app_bar_theme.dart
View file @
f5a99025
...
...
@@ -25,6 +25,7 @@ import 'theme.dart';
///
/// * [ThemeData], which describes the overall theme information for the
/// application.
@immutable
class
BottomAppBarTheme
with
Diagnosticable
{
/// Creates a theme that can be used for [ThemeData.BottomAppBarTheme].
const
BottomAppBarTheme
({
...
...
packages/flutter/lib/src/material/bottom_sheet_theme.dart
View file @
f5a99025
...
...
@@ -24,6 +24,7 @@ import 'package:flutter/rendering.dart';
///
/// * [ThemeData], which describes the overall theme information for the
/// application.
@immutable
class
BottomSheetThemeData
with
Diagnosticable
{
/// Creates a theme that can be used for [ThemeData.bottomSheetTheme].
const
BottomSheetThemeData
({
...
...
packages/flutter/lib/src/material/button_bar_theme.dart
View file @
f5a99025
...
...
@@ -24,6 +24,7 @@ import 'theme.dart';
/// its subtree.
/// * [ButtonBar], which uses this to configure itself and its children
/// button widgets.
@immutable
class
ButtonBarThemeData
with
Diagnosticable
{
/// Constructs the set of properties used to configure [ButtonBar] widgets.
///
...
...
packages/flutter/lib/src/material/button_theme.dart
View file @
f5a99025
...
...
@@ -248,6 +248,7 @@ class ButtonTheme extends InheritedTheme {
/// A button theme can be specified as part of the overall Material theme
/// using [ThemeData.buttonTheme]. The Material theme's button theme data
/// can be overridden with [ButtonTheme].
@immutable
class
ButtonThemeData
with
Diagnosticable
{
/// Create a button theme object that can be used with [ButtonTheme]
/// or [ThemeData].
...
...
packages/flutter/lib/src/material/card_theme.dart
View file @
f5a99025
...
...
@@ -26,6 +26,7 @@ import 'theme.dart';
///
/// * [ThemeData], which describes the overall theme information for the
/// application.
@immutable
class
CardTheme
with
Diagnosticable
{
/// Creates a theme that can be used for [ThemeData.cardTheme].
...
...
packages/flutter/lib/src/material/chip.dart
View file @
f5a99025
...
...
@@ -2157,6 +2157,7 @@ class _RenderChipElement extends RenderObjectElement {
}
}
@immutable
class
_ChipRenderTheme
{
const
_ChipRenderTheme
({
@required
this
.
avatar
,
...
...
packages/flutter/lib/src/material/chip_theme.dart
View file @
f5a99025
...
...
@@ -168,6 +168,7 @@ class ChipTheme extends InheritedTheme {
/// * [Theme] widget, which performs a similar function to [ChipTheme],
/// but for overall themes.
/// * [ThemeData], which has a default [ChipThemeData].
@immutable
class
ChipThemeData
with
Diagnosticable
{
/// Create a [ChipThemeData] given a set of exact values. All the values
/// must be specified except for [shadowColor], [selectedShadowColor],
...
...
packages/flutter/lib/src/material/dialog_theme.dart
View file @
f5a99025
...
...
@@ -27,6 +27,7 @@ import 'theme.dart';
/// * [Dialog], a material dialog that can be customized using this [DialogTheme].
/// * [ThemeData], which describes the overall theme information for the
/// application.
@immutable
class
DialogTheme
with
Diagnosticable
{
/// Creates a dialog theme that can be used for [ThemeData.dialogTheme].
const
DialogTheme
({
...
...
packages/flutter/lib/src/material/divider_theme.dart
View file @
f5a99025
...
...
@@ -26,6 +26,7 @@ import 'theme.dart';
///
/// * [ThemeData], which describes the overall theme information for the
/// application.
@immutable
class
DividerThemeData
with
Diagnosticable
{
/// Creates a theme that can be used for [DividerTheme] or
...
...
packages/flutter/lib/src/material/dropdown.dart
View file @
f5a99025
...
...
@@ -368,6 +368,7 @@ class _DropdownMenuRouteLayout<T> extends SingleChildLayoutDelegate {
// We box the return value so that the return value can be null. Otherwise,
// canceling the route (which returns null) would get confused with actually
// returning a real null value.
@immutable
class
_DropdownRouteResult
<
T
>
{
const
_DropdownRouteResult
(
this
.
result
);
...
...
packages/flutter/lib/src/material/floating_action_button_theme.dart
View file @
f5a99025
...
...
@@ -26,6 +26,7 @@ import 'package:flutter/rendering.dart';
///
/// * [ThemeData], which describes the overall theme information for the
/// application.
@immutable
class
FloatingActionButtonThemeData
with
Diagnosticable
{
/// Creates a theme that can be used for
/// [ThemeData.floatingActionButtonTheme].
...
...
packages/flutter/lib/src/material/input_decorator.dart
View file @
f5a99025
...
...
@@ -40,6 +40,7 @@ class _InputBorderGap extends ChangeNotifier {
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes, this class is not used in collection
bool
operator
==(
Object
other
)
{
if
(
identical
(
this
,
other
))
return
true
;
...
...
@@ -51,6 +52,7 @@ class _InputBorderGap extends ChangeNotifier {
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes, this class is not used in collection
int
get
hashCode
=>
hashValues
(
start
,
extent
);
}
...
...
@@ -489,6 +491,7 @@ enum _DecorationSlot {
}
// An analog of InputDecoration for the _Decorator widget.
@immutable
class
_Decoration
{
const
_Decoration
({
@required
this
.
contentPadding
,
...
...
packages/flutter/lib/src/material/navigation_rail_theme.dart
View file @
f5a99025
...
...
@@ -33,6 +33,7 @@ import 'theme_data.dart';
///
/// * [ThemeData], which describes the overall theme information for the
/// application.
@immutable
class
NavigationRailThemeData
with
Diagnosticable
{
/// Creates a theme that can be used for [ThemeData.navigationRailTheme].
const
NavigationRailThemeData
({
...
...
packages/flutter/lib/src/material/popup_menu_theme.dart
View file @
f5a99025
...
...
@@ -29,6 +29,7 @@ import 'theme.dart';
///
/// * [ThemeData], which describes the overall theme information for the
/// application.
@immutable
class
PopupMenuThemeData
with
Diagnosticable
{
/// Creates the set of properties used to configure [PopupMenuTheme].
const
PopupMenuThemeData
({
...
...
packages/flutter/lib/src/material/slider_theme.dart
View file @
f5a99025
...
...
@@ -305,6 +305,7 @@ enum Thumb {
/// {@macro flutter.material.slider.seeAlso.rangeSliderValueIndicatorShape}
/// {@macro flutter.material.slider.seeAlso.rangeSliderTrackShape}
/// {@macro flutter.material.slider.seeAlso.rangeSliderTickMarkShape}
@immutable
class
SliderThemeData
with
Diagnosticable
{
/// Create a [SliderThemeData] given a set of exact values. All the values
/// must be specified.
...
...
@@ -2866,6 +2867,7 @@ typedef RangeThumbSelector = Thumb Function(
/// This object is passed into [RangeSlider.values] to set its values, and it
/// is emitted in [RangeSlider.onChange], [RangeSlider.onChangeStart], and
/// [RangeSlider.onChangeEnd] when the values change.
@immutable
class
RangeValues
{
/// Creates pair of start and end values.
const
RangeValues
(
this
.
start
,
this
.
end
);
...
...
@@ -2905,6 +2907,7 @@ class RangeValues {
///
/// Used in combination with [RangeSlider.showValueIndicator] to display
/// labels above the thumbs.
@immutable
class
RangeLabels
{
/// Creates pair of start and end labels.
const
RangeLabels
(
this
.
start
,
this
.
end
);
...
...
packages/flutter/lib/src/material/snack_bar_theme.dart
View file @
f5a99025
...
...
@@ -46,6 +46,7 @@ enum SnackBarBehavior {
///
/// * [ThemeData], which describes the overall theme information for the
/// application.
@immutable
class
SnackBarThemeData
with
Diagnosticable
{
/// Creates a theme that can be used for [ThemeData.snackBarTheme].
...
...
packages/flutter/lib/src/material/tab_bar_theme.dart
View file @
f5a99025
...
...
@@ -23,6 +23,7 @@ import 'theme.dart';
/// * [TabBar], a widget that displays a horizontal row of tabs.
/// * [ThemeData], which describes the overall theme information for the
/// application.
@immutable
class
TabBarTheme
with
Diagnosticable
{
/// Creates a tab bar theme that can be used with [ThemeData.tabBarTheme].
const
TabBarTheme
({
...
...
packages/flutter/lib/src/material/theme_data.dart
View file @
f5a99025
...
...
@@ -1636,8 +1636,9 @@ class MaterialBasedCupertinoThemeData extends CupertinoThemeData {
}
}
@immutable
class
_IdentityThemeDataCacheKey
{
_IdentityThemeDataCacheKey
(
this
.
baseTheme
,
this
.
localTextGeometry
);
const
_IdentityThemeDataCacheKey
(
this
.
baseTheme
,
this
.
localTextGeometry
);
final
ThemeData
baseTheme
;
final
TextTheme
localTextGeometry
;
...
...
@@ -1713,6 +1714,7 @@ class _FifoCache<K, V> {
/// * [ThemeData.visualDensity], where this property is used to specify the base
/// horizontal density of Material components.
/// * [Material design guidance on density](https://material.io/design/layout/applying-density.html).
@immutable
class
VisualDensity
with
Diagnosticable
{
/// A const constructor for [VisualDensity].
///
...
...
packages/flutter/lib/src/material/toggle_buttons_theme.dart
View file @
f5a99025
...
...
@@ -24,6 +24,7 @@ import 'theme.dart';
///
/// * [ToggleButtonsTheme], which describes the actual configuration of a
/// toggle buttons theme.
@immutable
class
ToggleButtonsThemeData
with
Diagnosticable
{
/// Creates the set of color and border properties used to configure
/// [ToggleButtons].
...
...
packages/flutter/lib/src/material/tooltip_theme.dart
View file @
f5a99025
...
...
@@ -23,6 +23,7 @@ import 'theme.dart';
/// subtree.
/// * [TooltipThemeData], which describes the actual configuration of a
/// tooltip theme.
@immutable
class
TooltipThemeData
with
Diagnosticable
{
/// Creates the set of properties used to configure [Tooltip]s.
const
TooltipThemeData
({
...
...
packages/flutter/lib/src/painting/_network_image_io.dart
View file @
f5a99025
...
...
@@ -15,6 +15,7 @@ import 'image_provider.dart' as image_provider;
import
'image_stream.dart'
;
/// The dart:io implementation of [image_provider.NetworkImage].
@immutable
class
NetworkImage
extends
image_provider
.
ImageProvider
<
image_provider
.
NetworkImage
>
implements
image_provider
.
NetworkImage
{
/// Creates an object that fetches the image at the given URL.
///
...
...
packages/flutter/lib/src/painting/_network_image_web.dart
View file @
f5a99025
...
...
@@ -13,6 +13,7 @@ import 'image_stream.dart';
/// The dart:html implementation of [image_provider.NetworkImage].
///
/// NetworkImage on the web does not support decoding to a specified size.
@immutable
class
NetworkImage
extends
image_provider
.
ImageProvider
<
image_provider
.
NetworkImage
>
implements
image_provider
.
NetworkImage
{
...
...
packages/flutter/lib/src/painting/colors.dart
View file @
f5a99025
...
...
@@ -425,6 +425,7 @@ class HSLColor {
/// primary and accent color swatches.
/// * [material.Colors], which defines all of the standard material design
/// colors.
@immutable
class
ColorSwatch
<
T
>
extends
Color
{
/// Creates a color that has a small table of related colors called a "swatch".
///
...
...
packages/flutter/lib/src/painting/image_cache.dart
View file @
f5a99025
...
...
@@ -530,6 +530,7 @@ class ImageCache {
///
/// To obtain an [ImageCacheStatus], use [ImageCache.statusForKey] or
/// [ImageProvider.obtainCacheStatus].
@immutable
class
ImageCacheStatus
{
const
ImageCacheStatus
.
_
({
this
.
pending
=
false
,
...
...
packages/flutter/lib/src/painting/image_provider.dart
View file @
f5a99025
...
...
@@ -674,6 +674,7 @@ abstract class AssetBundleImageProvider extends ImageProvider<AssetBundleImageKe
}
}
@immutable
class
_SizeAwareCacheKey
{
const
_SizeAwareCacheKey
(
this
.
providerCacheKey
,
this
.
width
,
this
.
height
);
...
...
@@ -818,6 +819,7 @@ abstract class NetworkImage extends ImageProvider<NetworkImage> {
/// See also:
///
/// * [Image.file] for a shorthand of an [Image] widget backed by [FileImage].
@immutable
class
FileImage
extends
ImageProvider
<
FileImage
>
{
/// Creates an object that decodes a [File] as an image.
///
...
...
@@ -890,6 +892,7 @@ class FileImage extends ImageProvider<FileImage> {
/// See also:
///
/// * [Image.memory] for a shorthand of an [Image] widget backed by [MemoryImage].
@immutable
class
MemoryImage
extends
ImageProvider
<
MemoryImage
>
{
/// Creates an object that decodes a [Uint8List] buffer as an image.
///
...
...
@@ -1008,6 +1011,7 @@ class MemoryImage extends ImageProvider<MemoryImage> {
///
/// * [Image.asset] for a shorthand of an [Image] widget backed by
/// [ExactAssetImage] when using a scale.
@immutable
class
ExactAssetImage
extends
AssetBundleImageProvider
{
/// Creates an object that fetches the given image from an asset bundle.
///
...
...
packages/flutter/lib/src/painting/image_resolution.dart
View file @
f5a99025
...
...
@@ -120,6 +120,7 @@ const String _kAssetManifestFileName = 'AssetManifest.json';
///
/// * [Image.asset] for a shorthand of an [Image] widget backed by [AssetImage]
/// when used without a scale.
@immutable
class
AssetImage
extends
AssetBundleImageProvider
{
/// Creates an object that fetches an image from an asset bundle.
///
...
...
packages/flutter/lib/src/services/keyboard_key.dart
View file @
f5a99025
...
...
@@ -121,6 +121,7 @@ abstract class KeyboardKey with Diagnosticable {
/// to keyboard events.
/// * [RawKeyboardListener], a widget used to listen to and supply handlers for
/// keyboard events.
@immutable
class
LogicalKeyboardKey
extends
KeyboardKey
{
/// Creates a LogicalKeyboardKey object with an optional key label and debug
/// name.
...
...
@@ -2043,6 +2044,7 @@ class LogicalKeyboardKey extends KeyboardKey {
/// to keyboard events.
/// * [RawKeyboardListener], a widget used to listen to and supply handlers for
/// keyboard events.
@immutable
class
PhysicalKeyboardKey
extends
KeyboardKey
{
/// Creates a PhysicalKeyboardKey object with an optional debug name.
///
...
...
packages/flutter/lib/src/services/raw_keyboard.dart
View file @
f5a99025
...
...
@@ -623,6 +623,7 @@ class RawKeyboard {
void
clearKeysPressed
()
=>
_keysPressed
.
clear
();
}
@immutable
class
_ModifierSidePair
extends
Object
{
const
_ModifierSidePair
(
this
.
modifier
,
this
.
side
);
...
...
packages/flutter/lib/src/services/system_chrome.dart
View file @
f5a99025
...
...
@@ -83,6 +83,7 @@ enum SystemUiOverlay {
/// Specifies a preference for the style of the system overlays.
///
/// Used by [SystemChrome.setSystemUIOverlayStyle].
@immutable
class
SystemUiOverlayStyle
{
/// Creates a new [SystemUiOverlayStyle].
const
SystemUiOverlayStyle
({
...
...
packages/flutter/lib/src/services/text_input.dart
View file @
f5a99025
...
...
@@ -82,6 +82,7 @@ enum SmartQuotesType {
/// This class stays as close to [Enum] interface as possible, and allows
/// for additional flags for some input types. For example, numeric input
/// can specify whether it supports decimal numbers and/or signed numbers.
@immutable
class
TextInputType
{
const
TextInputType
.
_
(
this
.
index
)
:
signed
=
null
,
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
f5a99025
...
...
@@ -2887,7 +2887,9 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
// Custom implementation of `operator ==` optimized for the ".of" pattern
// used with `InheritedWidgets`.
@nonVirtual
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool
operator
==(
Object
other
)
=>
identical
(
this
,
other
);
// Custom implementation of hash code optimized for the ".of" pattern used
...
...
@@ -2904,7 +2906,9 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
//
// * https://dart.dev/articles/dart-vm/numeric-computation, which
// explains how numbers are represented in Dart.
@nonVirtual
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int
get
hashCode
=>
_cachedHash
;
final
int
_cachedHash
=
_nextHashCode
=
(
_nextHashCode
+
1
)
%
0xffffff
;
static
int
_nextHashCode
=
1
;
...
...
packages/flutter/lib/src/widgets/icon_theme_data.dart
View file @
f5a99025
...
...
@@ -18,6 +18,7 @@ import 'framework.dart' show BuildContext;
/// To obtain the current icon theme, use [IconTheme.of]. To convert an icon
/// theme to a version with all the fields filled in, use [new
/// IconThemeData.fallback].
@immutable
class
IconThemeData
with
Diagnosticable
{
/// Creates an icon theme data.
///
...
...
packages/flutter/lib/src/widgets/page_storage.dart
View file @
f5a99025
...
...
@@ -38,8 +38,9 @@ class PageStorageKey<T> extends ValueKey<T> {
const
PageStorageKey
(
T
value
)
:
super
(
value
);
}
@immutable
class
_StorageEntryIdentifier
{
_StorageEntryIdentifier
(
this
.
keys
)
const
_StorageEntryIdentifier
(
this
.
keys
)
:
assert
(
keys
!=
null
);
final
List
<
PageStorageKey
<
dynamic
>>
keys
;
...
...
packages/flutter/lib/src/widgets/shortcuts.dart
View file @
f5a99025
...
...
@@ -82,6 +82,7 @@ class KeySet<T extends KeyboardKey> {
final
HashSet
<
T
>
_keys
;
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes, to remove in NNBD with a late final hashcode
bool
operator
==(
Object
other
)
{
if
(
other
.
runtimeType
!=
runtimeType
)
{
return
false
;
...
...
@@ -99,6 +100,7 @@ class KeySet<T extends KeyboardKey> {
int
_hashCode
;
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes, to remove in NNBD with a late final hashcode
int
get
hashCode
{
// Return cached hash code if available.
if
(
_hashCode
!=
null
)
{
...
...
packages/flutter/lib/src/widgets/widget_inspector.dart
View file @
f5a99025
...
...
@@ -2426,6 +2426,7 @@ class _RenderInspectorOverlay extends RenderBox {
}
}
@immutable
class
_TransformedRect
{
_TransformedRect
(
RenderObject
object
)
:
rect
=
object
.
semanticBounds
,
...
...
@@ -2451,8 +2452,9 @@ class _TransformedRect {
///
/// The equality operator can be used to determine whether the overlay needs to
/// be rendered again.
@immutable
class
_InspectorOverlayRenderState
{
_InspectorOverlayRenderState
({
const
_InspectorOverlayRenderState
({
@required
this
.
overlayRect
,
@required
this
.
selected
,
@required
this
.
candidates
,
...
...
packages/flutter/test/painting/image_provider_test.dart
View file @
f5a99025
...
...
@@ -553,7 +553,7 @@ Future<Size> _resolveAndGetSize(ImageProvider imageProvider,
// This version of MemoryImage guarantees obtainKey returns a future that has not been
// completed synchronously.
class
AsyncKeyMemoryImage
extends
MemoryImage
{
AsyncKeyMemoryImage
(
Uint8List
bytes
)
:
super
(
bytes
);
const
AsyncKeyMemoryImage
(
Uint8List
bytes
)
:
super
(
bytes
);
@override
Future
<
MemoryImage
>
obtainKey
(
ImageConfiguration
configuration
)
{
...
...
packages/flutter/test/services/fake_platform_views.dart
View file @
f5a99025
...
...
@@ -157,7 +157,7 @@ class FakeAndroidPlatformViewsController {
if
(
resizeCompleter
!=
null
)
{
await
resizeCompleter
.
future
;
}
_views
[
id
]
.
size
=
Size
(
width
,
height
);
_views
[
id
]
=
_views
[
id
].
copyWith
(
size:
Size
(
width
,
height
)
);
return
Future
<
dynamic
>.
sync
(()
=>
null
);
}
...
...
@@ -195,7 +195,7 @@ class FakeAndroidPlatformViewsController {
message:
'Trying to resize a platform view with unknown id:
$id
'
,
);
_views
[
id
]
.
layoutDirection
=
layoutDirection
;
_views
[
id
]
=
_views
[
id
].
copyWith
(
layoutDirection:
layoutDirection
)
;
return
Future
<
dynamic
>.
sync
(()
=>
null
);
}
...
...
@@ -377,14 +377,23 @@ class FakeHtmlPlatformViewsController {
}
}
@immutable
class
FakeAndroidPlatformView
{
FakeAndroidPlatformView
(
this
.
id
,
this
.
type
,
this
.
size
,
this
.
layoutDirection
,
[
this
.
creationParams
]);
const
FakeAndroidPlatformView
(
this
.
id
,
this
.
type
,
this
.
size
,
this
.
layoutDirection
,
[
this
.
creationParams
]);
final
int
id
;
final
String
type
;
final
Uint8List
creationParams
;
Size
size
;
int
layoutDirection
;
final
Size
size
;
final
int
layoutDirection
;
FakeAndroidPlatformView
copyWith
({
Size
size
,
int
layoutDirection
})
=>
FakeAndroidPlatformView
(
id
,
type
,
size
??
this
.
size
,
layoutDirection
??
this
.
layoutDirection
,
creationParams
,
);
@override
bool
operator
==(
Object
other
)
{
...
...
@@ -393,12 +402,13 @@ class FakeAndroidPlatformView {
return
other
is
FakeAndroidPlatformView
&&
other
.
id
==
id
&&
other
.
type
==
type
&&
other
.
creationParams
==
creationParams
&&
other
.
size
==
size
;
&&
listEquals
<
int
>(
other
.
creationParams
,
creationParams
)
&&
other
.
size
==
size
&&
other
.
layoutDirection
==
layoutDirection
;
}
@override
int
get
hashCode
=>
hashValues
(
id
,
type
,
size
,
layoutDirection
);
int
get
hashCode
=>
hashValues
(
id
,
type
,
hashList
(
creationParams
),
size
,
layoutDirection
);
@override
String
toString
()
{
...
...
@@ -406,6 +416,7 @@ class FakeAndroidPlatformView {
}
}
@immutable
class
FakeAndroidMotionEvent
{
const
FakeAndroidMotionEvent
(
this
.
action
,
this
.
pointerIds
,
this
.
pointers
);
...
...
@@ -431,8 +442,9 @@ class FakeAndroidMotionEvent {
}
}
@immutable
class
FakeUiKitView
{
FakeUiKitView
(
this
.
id
,
this
.
type
,
[
this
.
creationParams
]);
const
FakeUiKitView
(
this
.
id
,
this
.
type
,
[
this
.
creationParams
]);
final
int
id
;
final
String
type
;
...
...
@@ -457,8 +469,9 @@ class FakeUiKitView {
}
}
@immutable
class
FakeHtmlPlatformView
{
FakeHtmlPlatformView
(
this
.
id
,
this
.
type
);
const
FakeHtmlPlatformView
(
this
.
id
,
this
.
type
);
final
int
id
;
final
String
type
;
...
...
packages/flutter/test/services/platform_views_test.dart
View file @
f5a99025
...
...
@@ -40,8 +40,8 @@ void main() {
expect
(
viewsController
.
views
,
unorderedEquals
(<
FakeAndroidPlatformView
>[
FakeAndroidPlatformView
(
0
,
'webview'
,
const
Size
(
100.0
,
100.0
),
AndroidViewController
.
kAndroidLayoutDirectionLtr
),
FakeAndroidPlatformView
(
1
,
'webview'
,
const
Size
(
200.0
,
300.0
),
AndroidViewController
.
kAndroidLayoutDirectionRtl
),
const
FakeAndroidPlatformView
(
0
,
'webview'
,
Size
(
100.0
,
100.0
),
AndroidViewController
.
kAndroidLayoutDirectionLtr
),
const
FakeAndroidPlatformView
(
1
,
'webview'
,
Size
(
200.0
,
300.0
),
AndroidViewController
.
kAndroidLayoutDirectionRtl
),
]));
});
...
...
@@ -70,7 +70,7 @@ void main() {
expect
(
viewsController
.
views
,
unorderedEquals
(<
FakeAndroidPlatformView
>[
FakeAndroidPlatformView
(
0
,
'webview'
,
const
Size
(
100.0
,
100.0
),
AndroidViewController
.
kAndroidLayoutDirectionLtr
),
const
FakeAndroidPlatformView
(
0
,
'webview'
,
Size
(
100.0
,
100.0
),
AndroidViewController
.
kAndroidLayoutDirectionLtr
),
]));
});
...
...
@@ -96,8 +96,8 @@ void main() {
expect
(
viewsController
.
views
,
unorderedEquals
(<
FakeAndroidPlatformView
>[
FakeAndroidPlatformView
(
0
,
'webview'
,
const
Size
(
100.0
,
100.0
),
AndroidViewController
.
kAndroidLayoutDirectionLtr
),
FakeAndroidPlatformView
(
1
,
'webview'
,
const
Size
(
500.0
,
500.0
),
AndroidViewController
.
kAndroidLayoutDirectionLtr
),
const
FakeAndroidPlatformView
(
0
,
'webview'
,
Size
(
100.0
,
100.0
),
AndroidViewController
.
kAndroidLayoutDirectionLtr
),
const
FakeAndroidPlatformView
(
1
,
'webview'
,
Size
(
500.0
,
500.0
),
AndroidViewController
.
kAndroidLayoutDirectionLtr
),
]));
});
...
...
@@ -137,7 +137,7 @@ void main() {
expect
(
viewsController
.
views
,
unorderedEquals
(<
FakeAndroidPlatformView
>[
FakeAndroidPlatformView
(
0
,
'webview'
,
const
Size
(
100.0
,
100.0
),
AndroidViewController
.
kAndroidLayoutDirectionLtr
),
const
FakeAndroidPlatformView
(
0
,
'webview'
,
Size
(
100.0
,
100.0
),
AndroidViewController
.
kAndroidLayoutDirectionLtr
),
]));
});
...
...
@@ -150,7 +150,7 @@ void main() {
expect
(
viewsController
.
views
,
unorderedEquals
(<
FakeAndroidPlatformView
>[
FakeAndroidPlatformView
(
0
,
'webview'
,
const
Size
(
100.0
,
100.0
),
AndroidViewController
.
kAndroidLayoutDirectionRtl
),
const
FakeAndroidPlatformView
(
0
,
'webview'
,
Size
(
100.0
,
100.0
),
AndroidViewController
.
kAndroidLayoutDirectionRtl
),
]));
});
});
...
...
@@ -183,8 +183,8 @@ void main() {
expect
(
viewsController
.
views
,
unorderedEquals
(<
FakeUiKitView
>[
FakeUiKitView
(
0
,
'webview'
),
FakeUiKitView
(
1
,
'webview'
),
const
FakeUiKitView
(
0
,
'webview'
),
const
FakeUiKitView
(
1
,
'webview'
),
]),
);
});
...
...
@@ -214,7 +214,7 @@ void main() {
expect
(
viewsController
.
views
,
unorderedEquals
(<
FakeUiKitView
>[
FakeUiKitView
(
0
,
'webview'
),
const
FakeUiKitView
(
0
,
'webview'
),
]));
});
...
...
packages/flutter/test/widgets/image_resolution_test.dart
View file @
f5a99025
...
...
@@ -103,7 +103,7 @@ class FakeImageStreamCompleter extends ImageStreamCompleter {
}
class
TestAssetImage
extends
AssetImage
{
TestAssetImage
(
String
name
)
:
super
(
name
);
const
TestAssetImage
(
String
name
)
:
super
(
name
);
@override
ImageStreamCompleter
load
(
AssetBundleImageKey
key
,
DecoderCallback
decode
)
{
...
...
packages/flutter/test/widgets/image_test.dart
View file @
f5a99025
...
...
@@ -1622,6 +1622,7 @@ void main() {
});
}
@immutable
class
ConfigurationAwareKey
{
const
ConfigurationAwareKey
(
this
.
provider
,
this
.
configuration
)
:
assert
(
provider
!=
null
),
...
...
packages/flutter/test/widgets/key_test.dart
View file @
f5a99025
...
...
@@ -9,6 +9,7 @@ class TestValueKey<T> extends ValueKey<T> {
const
TestValueKey
(
T
value
)
:
super
(
value
);
}
@immutable
class
NotEquals
{
const
NotEquals
();
@override
...
...
packages/flutter/test/widgets/shortcuts_test.dart
View file @
f5a99025
...
...
@@ -68,6 +68,7 @@ void main() {
LogicalKeyboardKey
.
keyC
,
LogicalKeyboardKey
.
keyD
,
);
// ignore: prefer_const_literals_to_create_immutables, https://github.com/dart-lang/linter/issues/2026
final
LogicalKeySet
setFromSet
=
LogicalKeySet
.
fromSet
(<
LogicalKeyboardKey
>{
LogicalKeyboardKey
.
keyA
,
LogicalKeyboardKey
.
keyB
,
...
...
@@ -123,6 +124,7 @@ void main() {
LogicalKeyboardKey
.
keyB
,
LogicalKeyboardKey
.
keyA
,
);
// ignore: prefer_const_literals_to_create_immutables, https://github.com/dart-lang/linter/issues/2026
final
LogicalKeySet
set4
=
LogicalKeySet
.
fromSet
(<
LogicalKeyboardKey
>{
LogicalKeyboardKey
.
keyD
,
LogicalKeyboardKey
.
keyC
,
...
...
@@ -138,6 +140,7 @@ void main() {
expect
(
map
.
containsKey
(
LogicalKeySet
(
LogicalKeyboardKey
.
keyA
)),
isTrue
);
expect
(
set2
,
// ignore: prefer_const_literals_to_create_immutables, https://github.com/dart-lang/linter/issues/2026
equals
(
LogicalKeySet
.
fromSet
(<
LogicalKeyboardKey
>{
LogicalKeyboardKey
.
keyA
,
LogicalKeyboardKey
.
keyB
,
...
...
packages/flutter_driver/lib/src/driver/driver.dart
View file @
f5a99025
...
...
@@ -748,6 +748,7 @@ class CommonFinders {
}
/// An immutable 2D floating-point offset used by Flutter Driver.
@immutable
class
DriverOffset
{
/// Creates an offset.
const
DriverOffset
(
this
.
dx
,
this
.
dy
);
...
...
packages/flutter_test/test/matchers_test.dart
View file @
f5a99025
...
...
@@ -240,27 +240,27 @@ void main() {
test
(
'isSameColorAs'
,
()
{
expect
(
const
Color
(
0x87654321
),
isSameColorAs
(
_CustomColor
(
0x87654321
)),
isSameColorAs
(
const
_CustomColor
(
0x87654321
)),
);
expect
(
_CustomColor
(
0x87654321
),
const
_CustomColor
(
0x87654321
),
isSameColorAs
(
const
Color
(
0x87654321
)),
);
expect
(
const
Color
(
0x12345678
),
isNot
(
isSameColorAs
(
_CustomColor
(
0x87654321
))),
isNot
(
isSameColorAs
(
const
_CustomColor
(
0x87654321
))),
);
expect
(
_CustomColor
(
0x87654321
),
const
_CustomColor
(
0x87654321
),
isNot
(
isSameColorAs
(
const
Color
(
0x12345678
))),
);
expect
(
_CustomColor
(
0xFF123456
),
isSameColorAs
(
_CustomColor
(
0xFF123456
)..
isEqual
=
false
),
const
_CustomColor
(
0xFF123456
),
isSameColorAs
(
const
_CustomColor
(
0xFF123456
,
isEqual:
false
)
),
);
});
...
...
@@ -704,9 +704,10 @@ class _FakeSemanticsNode extends SemanticsNode {
SemanticsData
getSemanticsData
()
=>
data
;
}
@immutable
class
_CustomColor
extends
Color
{
_CustomColor
(
int
value
)
:
super
(
value
);
bool
isEqual
;
const
_CustomColor
(
int
value
,
{
this
.
isEqual
}
)
:
super
(
value
);
final
bool
isEqual
;
@override
bool
operator
==(
Object
other
)
=>
isEqual
??
super
==
other
;
...
...
packages/flutter_tools/lib/src/asset.dart
View file @
f5a99025
...
...
@@ -273,8 +273,9 @@ class _ManifestAssetBundle implements AssetBundle {
List
<
File
>
additionalDependencies
=
<
File
>[];
}
@immutable
class
_Asset
{
_Asset
({
this
.
baseDir
,
this
.
relativeUri
,
this
.
entryUri
});
const
_Asset
({
this
.
baseDir
,
this
.
relativeUri
,
this
.
entryUri
});
final
String
baseDir
;
...
...
packages/flutter_tools/lib/src/base/fingerprint.dart
View file @
f5a99025
...
...
@@ -98,39 +98,49 @@ class Fingerprinter {
/// properties.
///
/// See [Fingerprinter].
@immutable
class
Fingerprint
{
Fingerprint
.
fromBuildInputs
(
Map
<
String
,
String
>
properties
,
Iterable
<
String
>
inputPaths
)
{
const
Fingerprint
.
_
({
Map
<
String
,
String
>
checksums
,
Map
<
String
,
String
>
properties
,
})
:
_checksums
=
checksums
,
_properties
=
properties
;
factory
Fingerprint
.
fromBuildInputs
(
Map
<
String
,
String
>
properties
,
Iterable
<
String
>
inputPaths
)
{
final
Iterable
<
File
>
files
=
inputPaths
.
map
<
File
>(
globals
.
fs
.
file
);
final
Iterable
<
File
>
missingInputs
=
files
.
where
((
File
file
)
=>
!
file
.
existsSync
());
if
(
missingInputs
.
isNotEmpty
)
{
throw
Exception
(
'Missing input files:
\n
'
+
missingInputs
.
join
(
'
\n
'
));
}
_checksums
=
<
String
,
String
>{};
for
(
final
File
file
in
files
)
{
final
List
<
int
>
bytes
=
file
.
readAsBytesSync
();
_checksums
[
file
.
path
]
=
md5
.
convert
(
bytes
).
toString
();
}
_properties
=
<
String
,
String
>{...
properties
};
return
Fingerprint
.
_
(
// ignore: prefer_const_literals_to_create_immutables, https://github.com/dart-lang/linter/issues/2025
checksums:
<
String
,
String
>{
for
(
final
File
file
in
files
)
file
.
path
:
md5
.
convert
(
file
.
readAsBytesSync
()).
toString
(),
},
properties:
<
String
,
String
>{...
properties
},
);
}
/// Creates a Fingerprint from serialized JSON.
///
/// Throws [Exception], if there is a version mismatch between the
/// serializing framework and this framework.
Fingerprint
.
fromJson
(
String
jsonData
)
{
factory
Fingerprint
.
fromJson
(
String
jsonData
)
{
final
Map
<
String
,
dynamic
>
content
=
castStringKeyedMap
(
json
.
decode
(
jsonData
));
final
String
version
=
content
[
'version'
]
as
String
;
if
(
version
!=
globals
.
flutterVersion
.
frameworkRevision
)
{
throw
Exception
(
'Incompatible fingerprint version:
$version
'
);
}
_checksums
=
castStringKeyedMap
(
content
[
'files'
])?.
cast
<
String
,
String
>()
??
<
String
,
String
>{};
_properties
=
castStringKeyedMap
(
content
[
'properties'
])?.
cast
<
String
,
String
>()
??
<
String
,
String
>{};
return
Fingerprint
.
_
(
checksums:
castStringKeyedMap
(
content
[
'files'
])?.
cast
<
String
,
String
>()
??
<
String
,
String
>{},
properties:
castStringKeyedMap
(
content
[
'properties'
])?.
cast
<
String
,
String
>()
??
<
String
,
String
>{},
);
}
Map
<
String
,
String
>
_checksums
;
Map
<
String
,
String
>
_properties
;
final
Map
<
String
,
String
>
_checksums
;
final
Map
<
String
,
String
>
_properties
;
String
toJson
()
=>
json
.
encode
(<
String
,
dynamic
>{
'version'
:
globals
.
flutterVersion
.
frameworkRevision
,
...
...
packages/flutter_tools/lib/src/base/version.dart
View file @
f5a99025
...
...
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:meta/meta.dart'
;
@immutable
class
Version
implements
Comparable
<
Version
>
{
/// Creates a new [Version] object.
factory
Version
(
int
major
,
int
minor
,
int
patch
,
{
String
text
})
{
...
...
packages/flutter_tools/lib/src/device.dart
View file @
f5a99025
...
...
@@ -480,10 +480,14 @@ abstract class Device {
Future
<
void
>
takeScreenshot
(
File
outputFile
)
=>
Future
<
void
>.
error
(
'unimplemented'
);
@nonVirtual
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int
get
hashCode
=>
id
.
hashCode
;
@nonVirtual
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool
operator
==(
Object
other
)
{
if
(
identical
(
this
,
other
))
{
return
true
;
...
...
packages/flutter_tools/lib/src/doctor.dart
View file @
f5a99025
...
...
@@ -481,14 +481,15 @@ class GroupedValidator extends DoctorValidator {
}
}
@immutable
class
ValidationResult
{
/// [ValidationResult.type] should only equal [ValidationResult.installed]
/// if no [messages] are hints or errors.
ValidationResult
(
this
.
type
,
this
.
messages
,
{
this
.
statusInfo
});
const
ValidationResult
(
this
.
type
,
this
.
messages
,
{
this
.
statusInfo
});
factory
ValidationResult
.
crash
(
Object
error
,
[
StackTrace
stackTrace
])
{
return
ValidationResult
(
ValidationType
.
crash
,
<
ValidationMessage
>[
ValidationMessage
.
error
(
const
ValidationMessage
.
error
(
'Due to an error, the doctor check did not complete. '
'If the error message below is not helpful, '
'please let us know about this issue at https://github.com/flutter/flutter/issues.'
),
...
...
@@ -555,10 +556,11 @@ class ValidationResult {
}
}
@immutable
class
ValidationMessage
{
ValidationMessage
(
this
.
message
)
:
type
=
ValidationMessageType
.
information
;
ValidationMessage
.
error
(
this
.
message
)
:
type
=
ValidationMessageType
.
error
;
ValidationMessage
.
hint
(
this
.
message
)
:
type
=
ValidationMessageType
.
hint
;
const
ValidationMessage
(
this
.
message
)
:
type
=
ValidationMessageType
.
information
;
const
ValidationMessage
.
error
(
this
.
message
)
:
type
=
ValidationMessageType
.
error
;
const
ValidationMessage
.
hint
(
this
.
message
)
:
type
=
ValidationMessageType
.
hint
;
final
ValidationMessageType
type
;
bool
get
isError
=>
type
==
ValidationMessageType
.
error
;
...
...
@@ -714,7 +716,7 @@ abstract class IntelliJValidator extends DoctorValidator {
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[];
if
(
pluginsPath
==
null
)
{
messages
.
add
(
ValidationMessage
.
error
(
'Invalid IntelliJ version number.'
));
messages
.
add
(
const
ValidationMessage
.
error
(
'Invalid IntelliJ version number.'
));
}
else
{
messages
.
add
(
ValidationMessage
(
userMessages
.
intellijLocation
(
installPath
)));
...
...
packages/flutter_tools/lib/src/emulator.dart
View file @
f5a99025
...
...
@@ -5,6 +5,8 @@
import
'dart:async'
;
import
'dart:math'
as
math
;
import
'package:meta/meta.dart'
;
import
'android/android_emulator.dart'
;
import
'android/android_sdk.dart'
;
import
'base/context.dart'
;
...
...
@@ -214,8 +216,9 @@ abstract class EmulatorDiscovery {
Future
<
List
<
Emulator
>>
get
emulators
;
}
@immutable
abstract
class
Emulator
{
Emulator
(
this
.
id
,
this
.
hasConfig
);
const
Emulator
(
this
.
id
,
this
.
hasConfig
);
final
String
id
;
final
bool
hasConfig
;
...
...
packages/flutter_tools/lib/src/ios/ios_emulators.dart
View file @
f5a99025
...
...
@@ -22,7 +22,7 @@ class IOSEmulators extends EmulatorDiscovery {
}
class
IOSEmulator
extends
Emulator
{
IOSEmulator
(
String
id
)
:
super
(
id
,
true
);
const
IOSEmulator
(
String
id
)
:
super
(
id
,
true
);
@override
String
get
name
=>
'iOS Simulator'
;
...
...
packages/flutter_tools/lib/src/linux/linux_doctor.dart
View file @
f5a99025
...
...
@@ -37,7 +37,7 @@ class LinuxDoctorValidator extends DoctorValidator {
}
if
(
clangResult
==
null
||
clangResult
.
exitCode
!=
0
)
{
validationType
=
ValidationType
.
missing
;
messages
.
add
(
ValidationMessage
.
error
(
'clang++ is not installed'
));
messages
.
add
(
const
ValidationMessage
.
error
(
'clang++ is not installed'
));
}
else
{
final
String
firstLine
=
(
clangResult
.
stdout
as
String
).
split
(
'
\n
'
).
first
.
trim
();
final
String
versionString
=
RegExp
(
r'[0-9]+\.[0-9]+\.[0-9]+'
).
firstMatch
(
firstLine
).
group
(
0
);
...
...
@@ -64,7 +64,7 @@ class LinuxDoctorValidator extends DoctorValidator {
}
if
(
makeResult
==
null
||
makeResult
.
exitCode
!=
0
)
{
validationType
=
ValidationType
.
missing
;
messages
.
add
(
ValidationMessage
.
error
(
'make is not installed'
));
messages
.
add
(
const
ValidationMessage
.
error
(
'make is not installed'
));
}
else
{
final
String
firstLine
=
(
makeResult
.
stdout
as
String
).
split
(
'
\n
'
).
first
.
trim
();
messages
.
add
(
ValidationMessage
(
firstLine
));
...
...
packages/flutter_tools/lib/src/proxy_validator.dart
View file @
f5a99025
...
...
@@ -28,10 +28,10 @@ class ProxyValidator extends DoctorValidator {
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[];
if
(
_httpProxy
.
isNotEmpty
)
{
messages
.
add
(
ValidationMessage
(
'HTTP_PROXY is set'
));
messages
.
add
(
const
ValidationMessage
(
'HTTP_PROXY is set'
));
if
(
_noProxy
.
isEmpty
)
{
messages
.
add
(
ValidationMessage
.
hint
(
'NO_PROXY is not set'
));
messages
.
add
(
const
ValidationMessage
.
hint
(
'NO_PROXY is not set'
));
}
else
{
messages
.
add
(
ValidationMessage
(
'NO_PROXY is
$_noProxy
'
));
for
(
final
String
host
in
const
<
String
>[
'127.0.0.1'
,
'localhost'
])
{
...
...
packages/flutter_tools/lib/src/vscode/vscode.dart
View file @
f5a99025
...
...
@@ -30,7 +30,7 @@ class VsCode {
// If the extensions directory doesn't exist at all, the listSync()
// below will fail, so just bail out early.
final
ValidationMessage
notInstalledMessage
=
ValidationMessage
.
error
(
const
ValidationMessage
notInstalledMessage
=
ValidationMessage
.
error
(
'Flutter extension not installed; install from
\n
$extensionMarketplaceUrl
'
);
if
(!
globals
.
fs
.
isDirectorySync
(
extensionDirectory
))
{
_validationMessages
.
add
(
notInstalledMessage
);
...
...
packages/flutter_tools/lib/src/web/web_validator.dart
View file @
f5a99025
...
...
@@ -36,7 +36,7 @@ class WebValidator extends DoctorValidator {
ValidationMessage
(
'
$kChromeEnvironment
=
$chrome
'
)
else
if
(!
canRunChrome
)
ValidationMessage
.
hint
(
'Cannot find Chrome. Try setting '
const
ValidationMessage
.
hint
(
'Cannot find Chrome. Try setting '
'
$kChromeEnvironment
to a Chrome executable.'
)
else
ValidationMessage
(
'Chrome at
$chrome
'
),
...
...
packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart
View file @
f5a99025
...
...
@@ -801,11 +801,11 @@ class PassingValidator extends DoctorValidator {
@override
Future
<
ValidationResult
>
validate
()
async
{
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
const
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
ValidationMessage
(
'A helpful message'
),
ValidationMessage
(
'A second, somewhat longer helpful message'
),
];
return
ValidationResult
(
ValidationType
.
installed
,
messages
,
statusInfo:
'with statusInfo'
);
return
const
ValidationResult
(
ValidationType
.
installed
,
messages
,
statusInfo:
'with statusInfo'
);
}
}
...
...
@@ -814,12 +814,12 @@ class MissingValidator extends DoctorValidator {
@override
Future
<
ValidationResult
>
validate
()
async
{
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
const
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
ValidationMessage
.
error
(
'A useful error message'
),
ValidationMessage
(
'A message that is not an error'
),
ValidationMessage
.
hint
(
'A hint message'
),
];
return
ValidationResult
(
ValidationType
.
missing
,
messages
);
return
const
ValidationResult
(
ValidationType
.
missing
,
messages
);
}
}
...
...
@@ -828,12 +828,12 @@ class NotAvailableValidator extends DoctorValidator {
@override
Future
<
ValidationResult
>
validate
()
async
{
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
const
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
ValidationMessage
.
error
(
'A useful error message'
),
ValidationMessage
(
'A message that is not an error'
),
ValidationMessage
.
hint
(
'A hint message'
),
];
return
ValidationResult
(
ValidationType
.
notAvailable
,
messages
);
return
const
ValidationResult
(
ValidationType
.
notAvailable
,
messages
);
}
}
...
...
@@ -842,12 +842,12 @@ class PartialValidatorWithErrors extends DoctorValidator {
@override
Future
<
ValidationResult
>
validate
()
async
{
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
const
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
ValidationMessage
.
error
(
'An error message indicating partial installation'
),
ValidationMessage
.
hint
(
'Maybe a hint will help the user'
),
ValidationMessage
(
'An extra message with some verbose details'
),
];
return
ValidationResult
(
ValidationType
.
partial
,
messages
);
return
const
ValidationResult
(
ValidationType
.
partial
,
messages
);
}
}
...
...
@@ -856,11 +856,11 @@ class PartialValidatorWithHintsOnly extends DoctorValidator {
@override
Future
<
ValidationResult
>
validate
()
async
{
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
const
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
ValidationMessage
.
hint
(
'There is a hint here'
),
ValidationMessage
(
'But there is no error'
),
];
return
ValidationResult
(
ValidationType
.
partial
,
messages
);
return
const
ValidationResult
(
ValidationType
.
partial
,
messages
);
}
}
...
...
@@ -1006,10 +1006,10 @@ class PassingGroupedValidator extends DoctorValidator {
@override
Future
<
ValidationResult
>
validate
()
async
{
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
const
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
ValidationMessage
(
'A helpful message'
),
];
return
ValidationResult
(
ValidationType
.
installed
,
messages
);
return
const
ValidationResult
(
ValidationType
.
installed
,
messages
);
}
}
...
...
@@ -1018,10 +1018,10 @@ class MissingGroupedValidator extends DoctorValidator {
@override
Future
<
ValidationResult
>
validate
()
async
{
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
const
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
ValidationMessage
.
error
(
'A useful error message'
),
];
return
ValidationResult
(
ValidationType
.
missing
,
messages
);
return
const
ValidationResult
(
ValidationType
.
missing
,
messages
);
}
}
...
...
@@ -1030,10 +1030,10 @@ class PartialGroupedValidator extends DoctorValidator {
@override
Future
<
ValidationResult
>
validate
()
async
{
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
const
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
ValidationMessage
.
error
(
'An error message for partial installation'
),
];
return
ValidationResult
(
ValidationType
.
partial
,
messages
);
return
const
ValidationResult
(
ValidationType
.
partial
,
messages
);
}
}
...
...
@@ -1042,10 +1042,10 @@ class PassingGroupedValidatorWithStatus extends DoctorValidator {
@override
Future
<
ValidationResult
>
validate
()
async
{
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
const
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[
ValidationMessage
(
'A different message'
),
];
return
ValidationResult
(
ValidationType
.
installed
,
messages
,
statusInfo:
'A status message'
);
return
const
ValidationResult
(
ValidationType
.
installed
,
messages
,
statusInfo:
'A status message'
);
}
}
...
...
packages/flutter_tools/test/general.shard/android/android_emulator_test.dart
View file @
f5a99025
...
...
@@ -31,7 +31,7 @@ void main() {
const
String
emulatorID
=
'1234'
;
final
AndroidEmulator
emulator
=
AndroidEmulator
(
emulatorID
,
<
String
,
String
>{
'name'
:
'test'
},
const
<
String
,
String
>{
'name'
:
'test'
},
);
expect
(
emulator
.
id
,
emulatorID
);
expect
(
emulator
.
hasConfig
,
true
);
...
...
packages/flutter_tools/test/general.shard/base/fingerprint_test.dart
View file @
f5a99025
...
...
@@ -64,10 +64,10 @@ void main() {
},
);
final
Fingerprint
fingerprint
=
fingerprinter
.
buildFingerprint
();
expect
(
fingerprint
,
Fingerprint
.
fromBuildInputs
(<
String
,
String
>{
expect
(
fingerprint
,
Fingerprint
.
fromBuildInputs
(
const
<
String
,
String
>{
'foo'
:
'bar'
,
'wibble'
:
'wobble'
,
},
<
String
>[
'a.dart'
]));
},
const
<
String
>[
'a.dart'
]));
},
overrides:
contextOverrides
);
testUsingContext
(
'creates fingerprint with file checksums'
,
()
{
...
...
@@ -85,10 +85,10 @@ void main() {
},
);
final
Fingerprint
fingerprint
=
fingerprinter
.
buildFingerprint
();
expect
(
fingerprint
,
Fingerprint
.
fromBuildInputs
(<
String
,
String
>{
expect
(
fingerprint
,
Fingerprint
.
fromBuildInputs
(
const
<
String
,
String
>{
'bar'
:
'baz'
,
'wobble'
:
'womble'
,
},
<
String
>[
'a.dart'
,
'b.dart'
]));
},
const
<
String
>[
'a.dart'
,
'b.dart'
]));
},
overrides:
contextOverrides
);
testUsingContext
(
'fingerprint does not match if not present'
,
()
{
...
...
@@ -248,7 +248,7 @@ void main() {
testUsingContext
(
'throws if any input file does not exist'
,
()
{
globals
.
fs
.
file
(
'a.dart'
).
createSync
();
expect
(
()
=>
Fingerprint
.
fromBuildInputs
(
<
String
,
String
>{},
<
String
>[
'a.dart'
,
'b.dart'
]),
()
=>
Fingerprint
.
fromBuildInputs
(
const
<
String
,
String
>{},
const
<
String
>[
'a.dart'
,
'b.dart'
]),
throwsException
,
);
},
overrides:
<
Type
,
Generator
>{
...
...
@@ -259,7 +259,7 @@ void main() {
testUsingContext
(
'populates checksums for valid files'
,
()
{
globals
.
fs
.
file
(
'a.dart'
).
writeAsStringSync
(
'This is a'
);
globals
.
fs
.
file
(
'b.dart'
).
writeAsStringSync
(
'This is b'
);
final
Fingerprint
fingerprint
=
Fingerprint
.
fromBuildInputs
(
<
String
,
String
>{},
<
String
>[
'a.dart'
,
'b.dart'
]);
final
Fingerprint
fingerprint
=
Fingerprint
.
fromBuildInputs
(
const
<
String
,
String
>{},
const
<
String
>[
'a.dart'
,
'b.dart'
]);
final
Map
<
String
,
dynamic
>
jsonObject
=
castStringKeyedMap
(
json
.
decode
(
fingerprint
.
toJson
()));
expect
(
jsonObject
[
'files'
],
hasLength
(
2
));
...
...
@@ -271,14 +271,14 @@ void main() {
});
testUsingContext
(
'includes framework version'
,
()
{
final
Fingerprint
fingerprint
=
Fingerprint
.
fromBuildInputs
(
<
String
,
String
>{},
<
String
>[]);
final
Fingerprint
fingerprint
=
Fingerprint
.
fromBuildInputs
(
const
<
String
,
String
>{},
const
<
String
>[]);
final
Map
<
String
,
dynamic
>
jsonObject
=
castStringKeyedMap
(
json
.
decode
(
fingerprint
.
toJson
()));
expect
(
jsonObject
[
'version'
],
mockVersion
.
frameworkRevision
);
},
overrides:
<
Type
,
Generator
>{
FlutterVersion:
()
=>
mockVersion
});
testUsingContext
(
'includes provided properties'
,
()
{
final
Fingerprint
fingerprint
=
Fingerprint
.
fromBuildInputs
(
<
String
,
String
>{
'a'
:
'A'
,
'b'
:
'B'
},
<
String
>[]);
final
Fingerprint
fingerprint
=
Fingerprint
.
fromBuildInputs
(
const
<
String
,
String
>{
'a'
:
'A'
,
'b'
:
'B'
},
const
<
String
>[]);
final
Map
<
String
,
dynamic
>
jsonObject
=
castStringKeyedMap
(
json
.
decode
(
fingerprint
.
toJson
()));
expect
(
jsonObject
[
'properties'
],
hasLength
(
2
));
...
...
@@ -347,7 +347,7 @@ void main() {
final
String
jsonString
=
json
.
encode
(<
String
,
dynamic
>{
'version'
:
kVersion
,
});
expect
(
Fingerprint
.
fromJson
(
jsonString
),
Fingerprint
.
fromBuildInputs
(
<
String
,
String
>{},
<
String
>[]));
expect
(
Fingerprint
.
fromJson
(
jsonString
),
Fingerprint
.
fromBuildInputs
(
const
<
String
,
String
>{},
const
<
String
>[]));
},
overrides:
<
Type
,
Generator
>{
FlutterVersion:
()
=>
mockVersion
,
});
...
...
packages/flutter_tools/test/general.shard/emulator_test.dart
View file @
f5a99025
...
...
@@ -45,11 +45,11 @@ void main() {
});
testUsingContext
(
'getEmulatorsById'
,
()
async
{
final
_MockEmulator
emulator1
=
const
_MockEmulator
emulator1
=
_MockEmulator
(
'Nexus_5'
,
'Nexus 5'
,
'Google'
);
final
_MockEmulator
emulator2
=
const
_MockEmulator
emulator2
=
_MockEmulator
(
'Nexus_5X_API_27_x86'
,
'Nexus 5X'
,
'Google'
);
final
_MockEmulator
emulator3
=
const
_MockEmulator
emulator3
=
_MockEmulator
(
'iOS Simulator'
,
'iOS Simulator'
,
'Apple'
);
final
List
<
Emulator
>
emulators
=
<
Emulator
>[
emulator1
,
...
...
@@ -137,7 +137,7 @@ void main() {
});
});
testUsingContext
(
'runs correct launch commands'
,
()
async
{
final
Emulator
emulator
=
IOSEmulator
(
'ios'
);
const
Emulator
emulator
=
IOSEmulator
(
'ios'
);
await
emulator
.
launch
();
expect
(
didAttemptToRunSimulator
,
equals
(
true
));
},
overrides:
<
Type
,
Generator
>{
...
...
@@ -160,7 +160,7 @@ class TestEmulatorManager extends EmulatorManager {
}
class
_MockEmulator
extends
Emulator
{
_MockEmulator
(
String
id
,
this
.
name
,
this
.
manufacturer
)
const
_MockEmulator
(
String
id
,
this
.
name
,
this
.
manufacturer
)
:
super
(
id
,
true
);
@override
...
...
packages/flutter_tools/test/general.shard/linux/linux_doctor_test.dart
View file @
f5a99025
...
...
@@ -27,7 +27,7 @@ void main() {
final
ValidationResult
result
=
await
linuxDoctorValidator
.
validate
();
expect
(
result
.
type
,
ValidationType
.
installed
);
expect
(
result
.
messages
,
<
ValidationMessage
>[
expect
(
result
.
messages
,
const
<
ValidationMessage
>[
ValidationMessage
(
'clang++ 4.0.1'
),
ValidationMessage
(
'GNU Make 4.1'
),
]);
...
...
@@ -50,7 +50,7 @@ void main() {
final
ValidationResult
result
=
await
linuxDoctorValidator
.
validate
();
expect
(
result
.
type
,
ValidationType
.
partial
);
expect
(
result
.
messages
,
<
ValidationMessage
>[
expect
(
result
.
messages
,
const
<
ValidationMessage
>[
ValidationMessage
.
error
(
'clang++ 2.0.1 is below minimum version of 3.4.0'
),
ValidationMessage
(
'GNU Make 4.1'
),
]);
...
...
@@ -73,7 +73,7 @@ void main() {
final
ValidationResult
result
=
await
linuxDoctorValidator
.
validate
();
expect
(
result
.
type
,
ValidationType
.
missing
);
expect
(
result
.
messages
,
<
ValidationMessage
>[
expect
(
result
.
messages
,
const
<
ValidationMessage
>[
ValidationMessage
(
'clang++ 4.0.1'
),
ValidationMessage
.
error
(
'make is not installed'
),
]);
...
...
@@ -96,7 +96,7 @@ void main() {
final
ValidationResult
result
=
await
linuxDoctorValidator
.
validate
();
expect
(
result
.
type
,
ValidationType
.
missing
);
expect
(
result
.
messages
,
<
ValidationMessage
>[
expect
(
result
.
messages
,
const
<
ValidationMessage
>[
ValidationMessage
.
error
(
'clang++ is not installed'
),
ValidationMessage
(
'GNU Make 4.1'
),
]);
...
...
packages/flutter_tools/test/general.shard/web/web_validator_test.dart
View file @
f5a99025
...
...
@@ -63,7 +63,7 @@ void main() {
final
ValidationResult
result
=
await
webValidator
.
validate
();
expect
(
result
.
messages
,
<
ValidationMessage
>[
expect
(
result
.
messages
,
const
<
ValidationMessage
>[
ValidationMessage
.
hint
(
'Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.'
),
]);
...
...
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