Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[ios_platform_images] remove deprecated APIs #6693

Merged
merged 7 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/ios_platform_images/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT
## 0.2.1

* Updates minimum Flutter version to 2.10.
* Updates minimum Flutter version to 3.3.0.
* Removes usage of deprecated [ImageProvider.load].
* Ignores unnecessary import warnings in preparation for [upcoming Flutter changes](https://github.com/flutter/flutter/pull/106316).

## 0.2.0+9
Expand Down
19 changes: 5 additions & 14 deletions packages/ios_platform_images/lib/ios_platform_images.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// found in the LICENSE file.

import 'dart:async';
// TODO(a14n): remove this import once Flutter 3.1 or later reaches stable (including flutter/flutter#106316)
// ignore: unnecessary_import
import 'dart:typed_data';
import 'dart:ui' as ui;

import 'package:flutter/foundation.dart'
Expand Down Expand Up @@ -64,12 +61,9 @@ class _FutureMemoryImage extends ImageProvider<_FutureMemoryImage> {
return SynchronousFuture<_FutureMemoryImage>(this);
}

// ignore:deprecated_member_use
/// See [ImageProvider.load].
// TODO(jmagman): Implement the new API once it lands, https://github.com/flutter/flutter/issues/103556
@override
// ignore: deprecated_member_use
ImageStreamCompleter load(_FutureMemoryImage key, DecoderCallback decode) {
ImageStreamCompleter loadBuffer(
_FutureMemoryImage key, DecoderBufferCallback decode) {
return _FutureImageStreamCompleter(
codec: _loadAsync(key, decode),
futureScale: _futureScale,
Expand All @@ -78,13 +72,10 @@ class _FutureMemoryImage extends ImageProvider<_FutureMemoryImage> {

Future<ui.Codec> _loadAsync(
_FutureMemoryImage key,
// ignore: deprecated_member_use
DecoderCallback decode,
) async {
DecoderBufferCallback decode,
) {
assert(key == this);
return _futureBytes.then((Uint8List bytes) {
return decode(bytes);
});
return _futureBytes.then(ui.ImmutableBuffer.fromUint8List).then(decode);
}

/// See [ImageProvider.operator==].
Expand Down
4 changes: 2 additions & 2 deletions packages/ios_platform_images/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: ios_platform_images
description: A plugin to share images between Flutter and iOS in add-to-app setups.
repository: https://github.com/flutter/plugins/tree/main/packages/ios_platform_images
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+ios_platform_images%22
version: 0.2.0+9
version: 0.2.1

environment:
sdk: ">=2.14.0 <3.0.0"
flutter: ">=2.10.0"
flutter: ">=3.3.0"
Copy link
Member

Choose a reason for hiding this comment

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

@stuartmorgan said upping to 3.3 was okay per trailing stable policies in flutter/flutter#101965 (comment).

Copy link
Contributor

Choose a reason for hiding this comment

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


flutter:
plugin:
Expand Down