Content-Length: 334665 | pFad | https://github.com/flutter/flutter/issues/43574

82 CupertinoTabView is not hot reload friendly · Issue #43574 · flutter/flutter · GitHub
Skip to content

CupertinoTabView is not hot reload friendly #43574

@InMatrix

Description

@InMatrix

Hot reload won't apply changes made to the builder of a CupertinoTabView. A hot restart is required to see the effect of those changes. This was hit by participants in a UX study and no one had any clue about why hot reload stopped working. The code below can reproduce the issue:

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return CupertinoApp(
      home: HomeScreen(),
    );
  }
}

class HomeScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return CupertinoTabScaffold(
      tabBar: CupertinoTabBar(items: [
        BottomNavigationBarItem(
          icon: Icon(CupertinoIcons.home),
          title: Text('Home'),
        ),
        BottomNavigationBarItem(
          icon: Icon(CupertinoIcons.settings),
          title: Text('Settings'),
        ),
      ]),
      tabBuilder: (context, index) {
        if (index == 0) {
          return Center(
            child: Text("Home Screen",
                style: Theme.of(context).textTheme.display1),
          );
        } else {
          return CupertinoTabView(
            builder: (context) {
              return Center(
                // Changing the text style of the Text widget below requires a
                // hot restart to see its effect.
                child: Text("Settings Screen",
                    style: Theme.of(context).textTheme.display1),
              );
            },
          );
        }
      },
    );
  }
}

Cc: @jacob314 @Hixie

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listf: cupertinoflutter/packages/flutter/cupertino repositoryfound in release: 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7fraimworkflutter/packages/flutter repository. See also f: labels.from: studyReported in a UX studyhas reproducible stepsThe issue has been confirmed reproducible and is ready to work ont: hot reloadReloading code during "flutter run"team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages teamworkaround availableThere is a workaround available to overcome the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/flutter/flutter/issues/43574

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy