Skip to content

[Material 3] : Text disappears while navigating between tabs inside of a TabView #126561

@chanan

Description

@chanan

Is there an existing issue for this?

Steps to reproduce

  1. Start new application
  2. Inside of a Scaffold, place a Column, with a TabView with 3 tabs. Inside of each tab place a Text.
  3. Click on the back and forth on the tabs

Expected results

The text should render correctly..

Actual results

Text randomly appears and disappears as you click on the tab headers

Code sample

Code sample
import 'package:flutter/material.dart';

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      initialIndex: 0,
      length: 3,
      child: Scaffold(
        appBar: AppBar(
          title: const Text('ListView Text Issue'),
        ),
        bottomNavigationBar: BottomNavigationBar(
          items: const [
            BottomNavigationBarItem(
              icon: Icon(Icons.abc),
              label: 'ABC',
            ),
            BottomNavigationBarItem(
              icon: Icon(Icons.access_alarm),
              label: 'Alarm',
            ),
          ],
        ),
        body: const Padding(
          padding: EdgeInsets.all(8),
          child: Column(
            children: [
              Text('Click on the tabs and see if the text goes crazy'),
              TabBar(
                tabs: [
                  Tab(
                    text: 'Tab 1',
                  ),
                  Tab(
                    text: 'Tab 2',
                  ),
                  Tab(
                    text: 'Tab 3',
                  ),
                ],
              ),
              Expanded(
                child: TabBarView(
                  children: [
                    Text('Tab 1'),
                    Text('Tab 2'),
                    Text('Tab 3'),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Full Repo: https://github.com/chanan/listview_text_issue

Screenshots or Video

Screenshots / Video demonstration
Flutter.-.Tabview.bug.mp4

Logs

Logs
Running directly from Android Studio

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.0, on Microsoft Windows [Version 10.0.22624.1755], locale en-US)
    • Flutter version 3.10.0 on channel stable at c:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 84a1e904f4 (2 days ago), 2023-05-09 07:41:44 -0700
    • Engine revision d44b5a94c9
    • Dart version 3.0.0
    • DevTools version 2.23.1

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

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\chana\AppData\Local\Android\sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

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

[✓] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.22)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.33130.400
    • Windows 10 SDK version 10.0.19041.0

[✓] Android Studio (version 2022.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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 11.0.15+0-b2043.56-9505619)

[!] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android\android-studio-preview
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] IntelliJ IDEA Community Edition (version 2022.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.3.1
    • 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

[✓] VS Code (version 1.77.3)
    • VS Code at C:\Users\chana\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.62.0

[✓] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.22624.1755]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 112.0.5615.138
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 113.0.1774.35

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

! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listf: material designflutter/packages/flutter/material repository.f: scrollingViewports, list views, slivers, etc.found in release: 3.10Found to occur in 3.10found in release: 3.11Found to occur in 3.11frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions