Github to G3 sync: https://github.com/google/webdriver.dart/pull/216

Webdriver new version: 2.1.1

Fix for cl/256391459.

PiperOrigin-RevId: 256631772
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ab2d943..db252ae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,10 @@
+## v2.1.1
+
+* Forward-compatible fix for upcoming Dart SDK breaking change
+  (`HttpClientResponse` implementing `Stream<Uint8List>`)
+
 ## v2.1.0
+
 * Full support of JsonWire and W3C protocol specs in sync and async WebDriver.
 
 ## v2.0.0
diff --git a/lib/src/request/async_io_request_client.dart b/lib/src/request/async_io_request_client.dart
index 9d0c380..8e0cc08 100644
--- a/lib/src/request/async_io_request_client.dart
+++ b/lib/src/request/async_io_request_client.dart
@@ -49,7 +49,7 @@
       final response = await httpRequest.close();
 
       return WebDriverResponse(response.statusCode, response.reasonPhrase,
-          await utf8.decodeStream(response));
+          await utf8.decodeStream(response.cast<List<int>>()));
     } finally {
       _lock.release();
     }
diff --git a/lib/support/forwarder.dart b/lib/support/forwarder.dart
index 58c23ef..dc44938 100644
--- a/lib/support/forwarder.dart
+++ b/lib/support/forwarder.dart
@@ -90,7 +90,7 @@
       }
       Map<dynamic, dynamic> params;
       if (request.method == 'POST') {
-        String requestBody = await utf8.decodeStream(request);
+        String requestBody = await utf8.decodeStream(request.cast<List<int>>());
         if (requestBody != null && requestBody.isNotEmpty) {
           params = json.decode(requestBody) as Map<dynamic, dynamic>;
         }
diff --git a/pubspec.yaml b/pubspec.yaml
index 39bb7d3..8fed1b8 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
 name: webdriver
-version: 2.1.0
+version: 2.1.1
 authors:
   - Marc Fisher II <fisherii@google.com>
   - Matt Staats<staats@google.com>
@@ -9,7 +9,7 @@
   Requires the use of WebDriver remote server.
 homepage: https://github.com/google/webdriver.dart
 environment:
-  sdk: '>=2.0.0-dev.23.0 <3.0.0'
+  sdk: '>=2.0.0 <3.0.0'
 dependencies:
   archive: '>=1.0.0 <3.0.0'
   matcher: ^0.12.3