[ package:vm_service ] Mark `endTime`, `lastReadTime`, and `lastWriteTime` as nullable

These properties of `SocketStatistic` were mistakenly marked as
non-nullable but are not always returned as part of the response from
the service extension.

Change-Id: I996d8bdd9ff3b2acd00ce388582042b86fb95301
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237632
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
diff --git a/pkg/vm_service/CHANGELOG.md b/pkg/vm_service/CHANGELOG.md
index a5a8f8b..56c3736 100644
--- a/pkg/vm_service/CHANGELOG.md
+++ b/pkg/vm_service/CHANGELOG.md
@@ -1,5 +1,11 @@
 # Changelog
 
+## 8.2.2
+- Updated the following optional fields to be nullable in `SocketStatistic`:
+  - `endTime`
+  - `lastReadTime`
+  - `lastWriteTime`
+
 ## 8.2.1
 - Changed type of `UriList.uris` from `dynamic` to `List<String?>?`.
 - Remove `example/vm_service_asserts.dart'
diff --git a/pkg/vm_service/lib/src/dart_io_extensions.dart b/pkg/vm_service/lib/src/dart_io_extensions.dart
index 9e9faaf..8760a4d 100644
--- a/pkg/vm_service/lib/src/dart_io_extensions.dart
+++ b/pkg/vm_service/lib/src/dart_io_extensions.dart
@@ -212,13 +212,15 @@
 
   /// The time, in microseconds, that this socket was closed.
   @optional
-  final int endTime;
+  final int? endTime;
 
   /// The time, in microseconds, that this socket was last read from.
-  final int lastReadTime;
+  @optional
+  final int? lastReadTime;
 
   /// The time, in microseconds, that this socket was last written to.
-  final int lastWriteTime;
+  @optional
+  final int? lastWriteTime;
 
   /// The address of the socket.
   final String address;
diff --git a/pkg/vm_service/pubspec.yaml b/pkg/vm_service/pubspec.yaml
index 19d91ff..1f9fc98 100644
--- a/pkg/vm_service/pubspec.yaml
+++ b/pkg/vm_service/pubspec.yaml
@@ -3,7 +3,7 @@
   A library to communicate with a service implementing the Dart VM
   service protocol.
 
-version: 8.2.1
+version: 8.2.2
 
 homepage: https://github.com/dart-lang/sdk/tree/master/pkg/vm_service