Skip to content

PageView bug? #45777

@ghost

Description

i tried more than 4 days now to fix the following problem: https://youtu.be/J1sbdWLG260

As you can see, the pageview has multiple sites with different images but the problem is that since I replaced the AssetImage there with a NetworkImage it starts to hide the next site (or the one before or both)... i really hat this and everything i tried didnt work, it cant be a problem with my code because i tried many different codes too or just the normal pageview but anyways here it is:

code sample
final pageController = PageController(initialPage: 0, viewportFraction: 0.7, keepPage: true);
PageView.builder(
          controller: pageController,
          scrollDirection: Axis.horizontal,
          itemCount: list.length,//latestItems.length,
          dragStartBehavior: DragStartBehavior.down,
          physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
          itemBuilder: (context, index) {
            return AnimatedBuilder(
              animation: pageController,
              builder: (context, widget) {
                if (pageController.position.minScrollExtent == null ||
                    pageController.position.maxScrollExtent == null) {
                  Future.delayed(Duration(microseconds: 1), () {
                    setState(() {});
                  });
                  return Container();
                }
                double value = pageController.page - index;
                value = (1 - (value.abs() * 0.3)).clamp(0.0, 1.0);
                return Center(
                  child: NetworkImage(url[index]),);
              },
            );
          },
        )

https://i.stack.imgur.com/2Cy6g.jpg https://i.stack.imgur.com/FNV3p.jpg

I would love to get this working and would appreciate any help! :) Thank you (-> i can give you more details if needed)

Flutter doctor:

[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.18362.476], locale de-DE)
• Flutter version 1.9.1+hotfix.6 at C:\Users\besitzer\flutter
• Framework revision 68587a0 (3 months ago), 2019-09-13 19:46:58 -0700
• Engine revision b863200
• Dart version 2.5.0

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\besitzer\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.

[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 41.1.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[!] IntelliJ IDEA Community Edition (version 2017.2)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.5
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins

[√] VS Code (version 1.39.1)
• VS Code at C:\Users\besitzer\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.5.1

[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions