Skip to content

[ExtendedNetworkImageProvider] use bytesLoader to custom bytes loader#71

Open
normalllll wants to merge 1 commit into
fluttercandies:masterfrom
normalllll:master
Open

[ExtendedNetworkImageProvider] use bytesLoader to custom bytes loader#71
normalllll wants to merge 1 commit into
fluttercandies:masterfrom
normalllll:master

Conversation

@normalllll

Copy link
Copy Markdown

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
Copy Markdown
Member

What is the background of this PR requirement?

@normalllll

Copy link
Copy Markdown
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
Copy Markdown
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

normalllll commented Mar 22, 2025

Copy link
Copy Markdown
Author
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