bizz84 / bizz84/nested-navigation-demo-flutter
Issue: Changing one tab triggers the build method of other tabs.
- Dominant language
- Dart
- Stars
- 664
- Forks
- 137
- PR merge metrics
- No merged PRs in 30d
Description
I notice that changing 1 tab will trigger the build method of other tabs which is very bad for performance I think. For example, In `ColorsListPage` class, I added the log line in the build method, and when I change the tab I can see the build method of other tabs are called:
```dart
@override
Widget build(BuildContext context) {
log('Rebuild: $title.');
return Scaffold(
appBar: AppBar(
title: Text(
title,
),
backgroundColor: color,
),
body: Container(
color: Colors.white,
child: _buildList(),
));
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the ColorsListPage build method shown in the issue and reproduce the behavior by changing tabs while observing its log output. Trace the tab-change and nested-navigation entry points to identify why other tab pages rebuild; done means the unnecessary rebuilds no longer occur and the observed behavior is covered by an appropriate verification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100