Skip to content

Conversation

@mkustermann
Copy link
Member

The change in [0] has propagated now everywhere, so we can use utf8.encode() instead of the longer const Utf8Encoder.convert().

Also it cleans up code like

  TypedData bytes;
  bytes.buffer.asByteData();

as that is not guaranteed to be correct, the correct version would be

  TypedData bytes;
  bytes.buffer.asByteData(bytes.offsetInBytes, bytes.lengthInBytes);

a shorter hand for that is:

  TypedData bytes;
  ByteData.sublistView(bytes);

[0] dart-lang/sdk#52801

@github-actions github-actions bot added tool Affects the "flutter" command-line tool. See also t: labels. framework flutter/packages/flutter repository. See also f: labels. labels Jul 14, 2023
@github-actions github-actions bot removed the tool Affects the "flutter" command-line tool. See also t: labels. label Jul 14, 2023
@mkustermann mkustermann requested a review from sstrickl July 14, 2023 12:05
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// using [ByteData.sublistView]. Lists of bytes can be used with APIs that
/// using [Uint8List.sublistView]. Lists of bytes can be used with APIs that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Done!

@goderbauer
Copy link
Member

(Triage): @mkustermann Is this ready to be submitted?

The change in [0] has propagated now everywhere, so we can use
`utf8.encode()` instead of the longer `const Utf8Encoder.convert()`.

Also it cleans up code like

```
  TypedData bytes;
  bytes.buffer.asByteData();
```

as that is not guaranteed to be correct, the correct version would be

```
  TypedData bytes;
  bytes.buffer.asByteData(bytes.offsetInBytes, bytes.lengthInBytes);
```

a shorter hand for that is:

```
  TypedData bytes;
  ByteData.sublistView(bytes);
```

[0] dart-lang/sdk#52801
@mkustermann
Copy link
Member Author

(Triage): @mkustermann Is this ready to be submitted?

Yes. Merging.

(Apologies, I was a few days OOO)

@mkustermann mkustermann merged commit 9c10151 into flutter:master Jul 24, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 24, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jul 24, 2023
flutter/flutter@a8c8c55...d7ed5dc

2023-07-24 [email protected] Roll Flutter Engine from 4734a709cbf2 to aa876f6bec69 (2 revisions) (flutter/flutter#131190)
2023-07-24 [email protected] Use utf8.encode() instead of longer const Utf8Encoder.convert() (flutter/flutter#130567)
2023-07-24 [email protected] Roll Flutter Engine from 402bceec81f4 to 4734a709cbf2 (2 revisions) (flutter/flutter#131175)
2023-07-24 [email protected] Roll Flutter Engine from c2c54f6406df to 402bceec81f4 (1 revision) (flutter/flutter#131174)
2023-07-24 [email protected] Roll Flutter Engine from 35eab1bcf335 to c2c54f6406df (2 revisions) (flutter/flutter#131173)
2023-07-24 [email protected] Roll Flutter Engine from 2ec1183e0dc3 to 35eab1bcf335 (1 revision) (flutter/flutter#131169)
2023-07-24 [email protected] Roll Flutter Engine from b314a29830f8 to 2ec1183e0dc3 (1 revision) (flutter/flutter#131167)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 31, 2023
…ter#130567)

The change in [0] has propagated now everywhere, so we can use
`utf8.encode()` instead of the longer `const Utf8Encoder.convert()`.

Also it cleans up code like

```
  TypedData bytes;
  bytes.buffer.asByteData();
```

as that is not guaranteed to be correct, the correct version would be

```
  TypedData bytes;
  bytes.buffer.asByteData(bytes.offsetInBytes, bytes.lengthInBytes);
```

a shorter hand for that is:

```
  TypedData bytes;
  ByteData.sublistView(bytes);
```

[0] dart-lang/sdk#52801
vashworth pushed a commit to vashworth/flutter that referenced this pull request Aug 2, 2023
…ter#130567)

The change in [0] has propagated now everywhere, so we can use
`utf8.encode()` instead of the longer `const Utf8Encoder.convert()`.

Also it cleans up code like

```
  TypedData bytes;
  bytes.buffer.asByteData();
```

as that is not guaranteed to be correct, the correct version would be

```
  TypedData bytes;
  bytes.buffer.asByteData(bytes.offsetInBytes, bytes.lengthInBytes);
```

a shorter hand for that is:

```
  TypedData bytes;
  ByteData.sublistView(bytes);
```

[0] dart-lang/sdk#52801
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants