Skip to content
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

[Bug report] #711

Open
Lazydd opened this issue Nov 5, 2024 · 0 comments
Open

[Bug report] #711

Lazydd opened this issue Nov 5, 2024 · 0 comments

Comments

@Lazydd
Copy link

Lazydd commented Nov 5, 2024

Version

8.3.1

Platforms

Web

Device Model

chrome

flutter info

[√] Flutter (Channel stable, 3.24.4, on Microsoft Windows [版本 10.0.22631.4317], locale zh-CN)
    • Flutter version 3.24.4 on channel stable at D:\fvm\versions\3.24.4
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 603104015d (12 days ago), 2024-10-24 08:01:25 -0700
    • Engine revision db49896cf2
    • Dart version 3.5.4
    • DevTools version 2.37.3
    • Pub download mirror https://mirrors.tuna.tsinghua.edu.cn/dart-pub
    • Flutter download mirror https://mirrors.tuna.tsinghua.edu.cn/flutter

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at D:\flutter\androidsdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: D:\flutter\android\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11609105)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Visual Studio - develop Windows apps (Visual Studio 15 生成工具 2017 15.9.54)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
    • Visual Studio 15 生成工具 2017 version 15.9.33529.398
    • Windows 10 SDK version 10.0.17763.0
    X Visual Studio 2019 or later is required.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2024.1)
    • Android Studio at D:\flutter\android
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0--11609105)

[√] IntelliJ IDEA Community Edition (version 2023.1)
    • IntelliJ at D:\软\Idea\IntelliJ IDEA Community Edition 2023.1.3
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.22631.4317]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 130.0.6723.92
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 130.0.2849.68

[√] Network resources
    • All expected network resources are available.

How to reproduce?

image
这里打印的为啥一直是null,我用的是这里的例子例子
9的版本也这样

Logs

No response

Example code (optional)

class ImageWidget extends StatelessWidget {
  final String url;
  final String errUrl;

  final double? width;

  final double? height;

  final BoxFit? fit;

  const ImageWidget(
    this.url, {
    super.key,
    this.errUrl = 'https://raw.githubusercontent.com/fluttercandies/flutter_candies/master/gif/extended_text/special_text.jpg',
    this.width = double.infinity,
    this.height = double.infinity,
    this.fit = BoxFit.cover,
  });

  @override
  Widget build(BuildContext context) {
    return ExtendedImage.network(
      url,
      fit: fit,
      height: height,
      width: width,
      handleLoadingProgress: true,
      clearMemoryCacheIfFailed: true,
      clearMemoryCacheWhenDispose: true,
      cache: false,
      loadStateChanged: (ExtendedImageState state) {
        if (state.extendedImageLoadState == LoadState.loading) {
          final double? progress =
              state.loadingProgress?.expectedTotalBytes != null
                  ? state.loadingProgress!.cumulativeBytesLoaded /
                      state.loadingProgress!.expectedTotalBytes!
                  : null;
          debugPrint('==========> $progress');
          return Center(
            child: CircularProgressIndicator(value: progress ?? 0),
          );
        }
        if (state.extendedImageLoadState == LoadState.failed) {
          return Image.asset(
            errUrl,
            height: height,
            width: width,
            fit: BoxFit.cover,
          );
        }
        return null;
      },
      // progressIndicatorBuilder: (context, url, downloadProgress) => Center(
      //   child: CircularProgressIndicator(value: downloadProgress.progress),
      // ),
      // errorWidget: (context, url, error) => Image.asset(
      //   errUrl,
      //   height: height,
      //   width: width,
      //   fit: fit,
      // ),
    );
  }
}

Contact

No response

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

No branches or pull requests

1 participant