Skip to content

[ExtendedNetworkImageProvider] use bytesLoader to custom bytes loader #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

normalllll
Copy link

Custom image bytes loader, it does not support web

@normalllll normalllll requested a review from zmtzawqlp as a code owner March 19, 2025 19:49
@zmtzawqlp
Copy link
Member

What is the background of this PR requirement?

@normalllll
Copy link
Author

Use non-Dart built-in IO to make network requests, such as using HTTP3 or native to make request, and after/before process the request.

@zmtzawqlp
Copy link
Member

Use non-Dart built-in IO to make network requests, such as using HTTP3 or native to make request, and after/before process the request.

is there any introduce or demo to show how to use it for the users?

@normalllll
Copy link
Author

normalllll commented Mar 22, 2025

ExtendedImage(
      image: ExtendedNetworkImageProvider(
        url,
        cache: true,
        printError: false,
        bytesLoader: (void Function(ImageChunkEvent event) chunkEvent) async {
          return await downloadToMemory(
            url: url,
            progressCallback: (int received, int total) {
              chunkEvent(ImageChunkEvent(cumulativeBytesLoaded: received, expectedTotalBytes: total));
            },
          );
        },
      ),
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants