Skip to content

[web] Random images are not displayed after switching tabs #47328

@cbenhagen

Description

@cbenhagen

Bad:
Screenshot 2019-12-18 at 11 40 44
Good:
Screenshot 2019-12-18 at 11 40

The same thing happens on hot reloading or browser window resize. Debug and release modes behave the same.

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: DefaultTabController(
        length: 2,
        child: Scaffold(
          appBar: AppBar(
            bottom: TabBar(
              tabs: [
                Tab(icon: Icon(Icons.directions_transit)),
                Tab(icon: Icon(Icons.directions_bike)),
              ],
            ),
            title: Text('Tabs Demo'),
          ),
          body: TabBarView(
            children: [
              ImageGrid(),
              ImageGrid(),
            ],
          ),
        ),
      ),
    );
  }
}

class ImageGrid extends StatelessWidget {
  const ImageGrid({
    Key key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GridView.count(
      crossAxisCount: 24,
      childAspectRatio: 3 / 2,
      children: List.generate(1000, (index) {
        return Image.network('https://picsum.photos/seed/$index/300/200');
      }),
    );
  }
}
[✓] Flutter (Channel master, v1.13.3-pre.42, on Mac OS X 10.15.2 19C57, locale en-CH)
    • Flutter version 1.13.3-pre.42 at /Users/ben/Projects/Other_Projects/flutter
    • Framework revision a82a399733 (27 hours ago), 2019-12-16 23:28:02 -0800
    • Engine revision e0e0ac0a68
    • Dart version 2.8.0 (build 2.8.0-dev.0.0 45db297095)


[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/ben/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.2.1, Build version 11B53
    • CocoaPods version 1.8.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.40.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.7.0

[✓] Connected device (3 available)
    • macOS      • macOS      • darwin-x64     • Mac OS X 10.15.2 19C57
    • Chrome     • chrome     • web-javascript • Google Chrome 79.0.3945.88
    • Web Server • web-server • web-javascript • Flutter Tools

• No issues found!

Metadata

Metadata

Assignees

Labels

a: imagesLoading, displaying, rendering imagesc: performanceRelates to speed or footprint issues (see "perf:" labels)c: renderingUI glitches reported at the engine/skia or impeller rendering levele: web_htmlHTML rendering backend for Webperf: memoryPerformance issues related to memoryplatform-webWeb applications specifically

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions