mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Tabs occasionally tried to setState after dispose (#5784)
Fixes https://github.com/flutter/flutter/issues/5776
This commit is contained in:
parent
e7601e3fa5
commit
411db2d587
@ -3,10 +3,10 @@
|
||||
To run these benchmarks on a device:
|
||||
|
||||
```
|
||||
flutter run --release -t lib/gestures/velocity_tracker_data.dart
|
||||
flutter run --release -t lib/stocks/animation_bench.dart
|
||||
flutter run --release -t lib/stocks/build_bench.dart
|
||||
flutter run --release -t lib/stocks/layout_bench.dart
|
||||
flutter run --release lib/gestures/velocity_tracker_data.dart
|
||||
flutter run --release lib/stocks/animation_bench.dart
|
||||
flutter run --release lib/stocks/build_bench.dart
|
||||
flutter run --release lib/stocks/layout_bench.dart
|
||||
```
|
||||
|
||||
The results should be in the device logs.
|
||||
|
@ -11,7 +11,6 @@ const Duration kBenchmarkTime = const Duration(seconds: 15);
|
||||
|
||||
|
||||
Future<Null> main() async {
|
||||
assert(false); // don't run this in checked mode! Use --release.
|
||||
stock_data.StockDataFetcher.actuallyFetchData = false;
|
||||
|
||||
final Stopwatch watch = new Stopwatch();
|
||||
|
@ -977,10 +977,12 @@ class _TabBarState<T> extends ScrollableState<TabBar<T>> implements TabBarSelect
|
||||
_indicatorRect = _selection != null ? _tabIndicatorRect(_selection.index) : Rect.zero;
|
||||
_updateScrollBehavior();
|
||||
SchedulerBinding.instance.addPostFrameCallback((Duration timeStamp) {
|
||||
setState(() {
|
||||
// the changes were made at layout time
|
||||
// TODO(ianh): remove this setState: https://github.com/flutter/flutter/issues/5749
|
||||
});
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
// the changes were made at layout time
|
||||
// TODO(ianh): remove this setState: https://github.com/flutter/flutter/issues/5749
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user