Start using `@immutable` annotations (#9152)

There are more places we can use this annotation, but this patch just gets us
started.
diff --git a/dev/benchmarks/microbenchmarks/pubspec.yaml b/dev/benchmarks/microbenchmarks/pubspec.yaml
index 44fcf2a..52005fc 100644
--- a/dev/benchmarks/microbenchmarks/pubspec.yaml
+++ b/dev/benchmarks/microbenchmarks/pubspec.yaml
@@ -1,7 +1,7 @@
 name: microbenchmarks
 description: Small benchmarks for very specific parts of the Flutter framework.
 dependencies:
-  meta: ^1.0.3
+  meta: ^1.0.5
   flutter:
     sdk: flutter
   flutter_test:
diff --git a/dev/devicelab/pubspec.yaml b/dev/devicelab/pubspec.yaml
index 9d2aef1..1281596 100644
--- a/dev/devicelab/pubspec.yaml
+++ b/dev/devicelab/pubspec.yaml
@@ -9,7 +9,7 @@
 
 dependencies:
   args: ^0.13.4
-  meta: ^1.0.4
+  meta: ^1.0.5
   path: ^1.4.0
   process: 2.0.3
   stack_trace: ^1.4.0
diff --git a/packages/flutter/lib/foundation.dart b/packages/flutter/lib/foundation.dart
index e21c0ae..6221f08 100644
--- a/packages/flutter/lib/foundation.dart
+++ b/packages/flutter/lib/foundation.dart
@@ -10,6 +10,7 @@
 library foundation;
 
 export 'package:meta/meta.dart' show
+  immutable,
   mustCallSuper,
   optionalTypeArgs,
   protected,
diff --git a/packages/flutter/lib/src/material/mergeable_material.dart b/packages/flutter/lib/src/material/mergeable_material.dart
index 7c6cea0..205ceeb 100644
--- a/packages/flutter/lib/src/material/mergeable_material.dart
+++ b/packages/flutter/lib/src/material/mergeable_material.dart
@@ -643,8 +643,8 @@
     this.boxShadows
   }) : super(children: children, mainAxis: mainAxis);
 
-  List<MergeableMaterialItem> items;
-  List<BoxShadow> boxShadows;
+  final List<MergeableMaterialItem> items;
+  final List<BoxShadow> boxShadows;
 
   @override
   RenderListBody createRenderObject(BuildContext context) {
diff --git a/packages/flutter/lib/src/painting/box_painter.dart b/packages/flutter/lib/src/painting/box_painter.dart
index ff9089d..b9ccc11 100644
--- a/packages/flutter/lib/src/painting/box_painter.dart
+++ b/packages/flutter/lib/src/painting/box_painter.dart
@@ -33,6 +33,7 @@
 /// An immutable set of radii for each corner of a rectangle.
 ///
 /// Used by [BoxDecoration] when the shape is a [BoxShape.rectangle].
+@immutable
 class BorderRadius {
   /// Creates a border radius where all radii are [radius].
   const BorderRadius.all(Radius radius) : this.only(
@@ -151,6 +152,7 @@
 }
 
 /// A side of a border of a box.
+@immutable
 class BorderSide {
   /// Creates the side of a border.
   ///
@@ -250,6 +252,7 @@
 }
 
 /// A border of a box, comprised of four sides.
+@immutable
 class Border {
   /// Creates a border.
   ///
@@ -502,6 +505,7 @@
 /// (e.g., has a border radius or a circular shape).
 ///
 /// This class is similar to CSS box-shadow.
+@immutable
 class BoxShadow {
   /// Creates a box shadow.
   ///
@@ -611,6 +615,7 @@
 }
 
 /// A 2D gradient.
+@immutable
 abstract class Gradient {
   /// Abstract const constructor. This constructor enables subclasses to provide
   /// const constructors so that they can be used in const expressions.
@@ -963,6 +968,7 @@
 ///
 /// The image is painted using [paintImage], which describes the meanings of the
 /// various fields on this class in more detail.
+@immutable
 class BackgroundImage {
   /// Creates a background image.
   ///
diff --git a/packages/flutter/lib/src/painting/colors.dart b/packages/flutter/lib/src/painting/colors.dart
index 20b3c87..5d0bfda 100644
--- a/packages/flutter/lib/src/painting/colors.dart
+++ b/packages/flutter/lib/src/painting/colors.dart
@@ -4,11 +4,14 @@
 
 import 'dart:ui' show Color, lerpDouble, hashValues;
 
+import 'package:flutter/foundation.dart';
+
 /// A color represented using [alpha], [hue], [saturation], and [value].
 ///
 /// An [HSVColor] is represented in a parameter space that's motivated by human
 /// perception. The representation is useful for some color computations (e.g.,
 /// rotating the hue through the colors of the rainbow).
+@immutable
 class HSVColor {
   /// Creates a color.
   ///
diff --git a/packages/flutter/lib/src/painting/decoration.dart b/packages/flutter/lib/src/painting/decoration.dart
index 9f9f714..95d55a0 100644
--- a/packages/flutter/lib/src/painting/decoration.dart
+++ b/packages/flutter/lib/src/painting/decoration.dart
@@ -24,6 +24,7 @@
 /// method to obtain a [BoxPainter]. [Decoration] objects can be
 /// shared between boxes; [BoxPainter] objects can cache resources to
 /// make painting on a particular surface faster.
+@immutable
 abstract class Decoration {
   /// Abstract const constructor. This constructor enables subclasses to provide
   /// const constructors so that they can be used in const expressions.
diff --git a/packages/flutter/lib/src/painting/edge_insets.dart b/packages/flutter/lib/src/painting/edge_insets.dart
index 2bea989..0beff5b 100644
--- a/packages/flutter/lib/src/painting/edge_insets.dart
+++ b/packages/flutter/lib/src/painting/edge_insets.dart
@@ -4,6 +4,8 @@
 
 import 'dart:ui' as ui show lerpDouble, WindowPadding;
 
+import 'package:flutter/foundation.dart';
+
 import 'basic_types.dart';
 
 /// The two cardinal directions in two dimensions.
@@ -19,6 +21,7 @@
 ///
 /// Typically used for an offset from each of the four sides of a box. For
 /// example, the padding inside a box can be represented using this class.
+@immutable
 class EdgeInsets {
   /// Creates insets from offsets from the left, top, right, and bottom.
   const EdgeInsets.fromLTRB(this.left, this.top, this.right, this.bottom);
diff --git a/packages/flutter/lib/src/painting/fractional_offset.dart b/packages/flutter/lib/src/painting/fractional_offset.dart
index 7d05a8d..2529da1 100644
--- a/packages/flutter/lib/src/painting/fractional_offset.dart
+++ b/packages/flutter/lib/src/painting/fractional_offset.dart
@@ -4,12 +4,15 @@
 
 import 'dart:ui' as ui show lerpDouble;
 
+import 'package:flutter/foundation.dart';
+
 import 'basic_types.dart';
 
 /// An offset that's expressed as a fraction of a Size.
 ///
 /// FractionalOffset(1.0, 0.0) represents the top right of the Size,
 /// FractionalOffset(0.0, 1.0) represents the bottom left of the Size,
+@immutable
 class FractionalOffset {
   /// Creates a fractional offset.
   ///
diff --git a/packages/flutter/lib/src/painting/text_span.dart b/packages/flutter/lib/src/painting/text_span.dart
index 95aa0ed..0b5f824 100644
--- a/packages/flutter/lib/src/painting/text_span.dart
+++ b/packages/flutter/lib/src/painting/text_span.dart
@@ -45,6 +45,7 @@
 ///  * [Text]
 ///  * [RichText]
 ///  * [TextPainter]
+@immutable
 class TextSpan {
   /// Creates a [TextSpan] with the given values.
   ///
diff --git a/packages/flutter/lib/src/painting/text_style.dart b/packages/flutter/lib/src/painting/text_style.dart
index b2d8d98..5083b01 100644
--- a/packages/flutter/lib/src/painting/text_style.dart
+++ b/packages/flutter/lib/src/painting/text_style.dart
@@ -4,9 +4,12 @@
 
 import 'dart:ui' as ui show ParagraphStyle, TextStyle, lerpDouble;
 
+import 'package:flutter/foundation.dart';
+
 import 'basic_types.dart';
 
 /// An immutable style in which paint text.
+@immutable
 class TextStyle {
   /// Creates a text style.
   const TextStyle({
diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart
index 5a9f342..3db759a 100644
--- a/packages/flutter/lib/src/rendering/object.dart
+++ b/packages/flutter/lib/src/rendering/object.dart
@@ -520,6 +520,7 @@
 ///
 /// * The [toString] method, which should describe the constraints so that they
 ///   appear in a usefully readable form in the output of [debugDumpRenderTree].
+@immutable
 abstract class Constraints {
   /// Abstract const constructor. This constructor enables subclasses to provide
   /// const constructors so that they can be used in const expressions.
diff --git a/packages/flutter/lib/src/rendering/sliver.dart b/packages/flutter/lib/src/rendering/sliver.dart
index e77926a..c8940ed 100644
--- a/packages/flutter/lib/src/rendering/sliver.dart
+++ b/packages/flutter/lib/src/rendering/sliver.dart
@@ -422,6 +422,7 @@
 ///
 /// A sliver can occupy space in several different ways, which is why this class
 /// contains multiple values.
+@immutable
 class SliverGeometry {
   /// Creates an object that describes the amount of space occupied by a sliver.
   ///
diff --git a/packages/flutter/lib/src/rendering/sliver_grid.dart b/packages/flutter/lib/src/rendering/sliver_grid.dart
index d4c0840..26110da 100644
--- a/packages/flutter/lib/src/rendering/sliver_grid.dart
+++ b/packages/flutter/lib/src/rendering/sliver_grid.dart
@@ -21,6 +21,7 @@
 ///    to describe the child's placement.
 ///  * [RenderSliverGrid], which uses this class during its
 ///    [RenderSliverGrid.performLayout] method.
+@immutable
 class SliverGridGeometry {
   /// Creates an object that describes the placement of a child in a [RenderSliverGrid].
   const SliverGridGeometry({
@@ -99,6 +100,7 @@
 ///    delegates's layout.
 ///  * [RenderSliverGrid], which uses this class during its
 ///    [RenderSliverGrid.performLayout] method.
+@immutable
 abstract class SliverGridLayout {
   /// Abstract const constructor. This constructor enables subclasses to provide
   /// const constructors so that they can be used in const expressions.
diff --git a/packages/flutter/lib/src/widgets/form.dart b/packages/flutter/lib/src/widgets/form.dart
index 6df0a30..589e276 100644
--- a/packages/flutter/lib/src/widgets/form.dart
+++ b/packages/flutter/lib/src/widgets/form.dart
@@ -56,7 +56,7 @@
   ///
   /// If the callback returns a Future that resolves to false, the form's route
   /// will not be popped.
-  WillPopCallback onWillPop;
+  final WillPopCallback onWillPop;
 
   @override
   FormState createState() => new FormState();
diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart
index 3502c8d..d263873 100644
--- a/packages/flutter/lib/src/widgets/framework.dart
+++ b/packages/flutter/lib/src/widgets/framework.dart
@@ -391,6 +391,7 @@
 ///    be read by descendant widgets.
 ///  * [StatelessWidget], for widgets that always build the same way given a
 ///    particular configuration and ambient state.
+@immutable
 abstract class Widget {
   /// Initializes [key] for subclasses.
   const Widget({ this.key });
diff --git a/packages/flutter/lib/src/widgets/will_pop_scope.dart b/packages/flutter/lib/src/widgets/will_pop_scope.dart
index 62ebb2b..8acd574 100644
--- a/packages/flutter/lib/src/widgets/will_pop_scope.dart
+++ b/packages/flutter/lib/src/widgets/will_pop_scope.dart
@@ -34,7 +34,7 @@
   ///
   /// If the callback returns a Future that resolves to false, the enclosing
   /// route will not be popped.
-  WillPopCallback onWillPop;
+  final WillPopCallback onWillPop;
 
   @override
   _WillPopScopeState createState() => new _WillPopScopeState();
diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml
index d17efa6..73efec325 100644
--- a/packages/flutter/pubspec.yaml
+++ b/packages/flutter/pubspec.yaml
@@ -8,7 +8,7 @@
   collection: '>=1.9.1 <2.0.0'
   http: '>=0.11.3+12'
   intl: '>=0.14.0 <0.15.0'
-  meta: ^1.0.4
+  meta: ^1.0.5
   typed_data: ^1.1.3
   vector_math: '>=2.0.3 <3.0.0'
 
diff --git a/packages/flutter/test/widgets/global_keys_moving_test.dart b/packages/flutter/test/widgets/global_keys_moving_test.dart
index 393344b..b5ad55f 100644
--- a/packages/flutter/test/widgets/global_keys_moving_test.dart
+++ b/packages/flutter/test/widgets/global_keys_moving_test.dart
@@ -31,7 +31,8 @@
 class KeyedWrapper extends StatelessWidget {
   KeyedWrapper(this.key1, this.key2);
 
-  Key key1, key2;
+  final Key key1;
+  final Key key2;
 
   @override
   Widget build(BuildContext context) {
diff --git a/packages/flutter_driver/pubspec.yaml b/packages/flutter_driver/pubspec.yaml
index e5ff53c..3847719 100644
--- a/packages/flutter_driver/pubspec.yaml
+++ b/packages/flutter_driver/pubspec.yaml
@@ -11,7 +11,7 @@
   file: 2.3.2
   json_rpc_2: '^2.0.0'
   matcher: '>=0.12.0 <1.0.0'
-  meta: ^1.0.4
+  meta: ^1.0.5
   path: '^1.4.0'
   web_socket_channel: '^1.0.0'
   vm_service_client: '0.2.2+4'
diff --git a/packages/flutter_tools/pubspec.yaml b/packages/flutter_tools/pubspec.yaml
index 7a2e085e..2bb843f 100644
--- a/packages/flutter_tools/pubspec.yaml
+++ b/packages/flutter_tools/pubspec.yaml
@@ -19,7 +19,7 @@
   json_rpc_2: ^2.0.0
   json_schema: 1.0.6
   linter: 0.1.30
-  meta: ^1.0.4
+  meta: ^1.0.5
   mustache: ^0.2.5
   package_config: '>=0.1.5 <2.0.0'
   platform: 2.0.0