diff --git a/packages/image_picker/image_picker_for_web/example/integration_test/image_picker_for_web_test.dart b/packages/image_picker/image_picker_for_web/example/integration_test/image_picker_for_web_test.dart index 256fe3463b68..fffbd6d0be90 100644 --- a/packages/image_picker/image_picker_for_web/example/integration_test/image_picker_for_web_test.dart +++ b/packages/image_picker/image_picker_for_web/example/integration_test/image_picker_for_web_test.dart @@ -13,8 +13,8 @@ import 'package:integration_test/integration_test.dart'; const String expectedStringContents = 'Hello, world!'; const String otherStringContents = 'Hello again, world!'; -final Uint8List bytes = utf8.encode(expectedStringContents) as Uint8List; -final Uint8List otherBytes = utf8.encode(otherStringContents) as Uint8List; +final Uint8List bytes = const Utf8Encoder().convert(expectedStringContents); +final Uint8List otherBytes = const Utf8Encoder().convert(otherStringContents); final Map options = { 'type': 'text/plain', 'lastModified': DateTime.utc(2017, 12, 13).millisecondsSinceEpoch, diff --git a/packages/rfw/CHANGELOG.md b/packages/rfw/CHANGELOG.md index 347db107d360..cbee9e29c2e3 100644 --- a/packages/rfw/CHANGELOG.md +++ b/packages/rfw/CHANGELOG.md @@ -1,7 +1,8 @@ -## NEXT +## 1.0.10 * Fixes stale ignore: prefer_const_constructors. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Changes package internals to avoid explicit `as Uint8List` downcast. ## 1.0.9 diff --git a/packages/rfw/lib/src/dart/binary.dart b/packages/rfw/lib/src/dart/binary.dart index 76270b3c8033..e7242ef18e6f 100644 --- a/packages/rfw/lib/src/dart/binary.dart +++ b/packages/rfw/lib/src/dart/binary.dart @@ -521,7 +521,7 @@ class _BlobEncoder { } void _writeString(String value) { - final Uint8List buffer = utf8.encode(value) as Uint8List; + final Uint8List buffer = const Utf8Encoder().convert(value); _writeInt64(buffer.length); bytes.add(buffer); } diff --git a/packages/rfw/pubspec.yaml b/packages/rfw/pubspec.yaml index c15b97011cc2..1ab993f9eeb6 100644 --- a/packages/rfw/pubspec.yaml +++ b/packages/rfw/pubspec.yaml @@ -2,7 +2,7 @@ name: rfw description: "Remote Flutter widgets: a library for rendering declarative widget description files at runtime." repository: https://github.com/flutter/packages/tree/main/packages/rfw issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+rfw%22 -version: 1.0.9 +version: 1.0.10 environment: sdk: ">=3.0.0 <4.0.0"