bugfix: context entry was not updated when deleting the last entry in fullscreen
This commit is contained in:
parent
e6dc938be3
commit
b07f15b5fb
1 changed files with 7 additions and 0 deletions
|
@ -308,6 +308,13 @@ class FullscreenBodyState extends State<FullscreenBody> with SingleTickerProvide
|
|||
}
|
||||
|
||||
void _updateEntry() {
|
||||
if (_currentHorizontalPage != null && entries.isNotEmpty && _currentHorizontalPage >= entries.length) {
|
||||
// as of Flutter v1.20.2, `PageView` does not call `onPageChanged` when the last page is deleted
|
||||
// so we manually track the page change, and let the entry update follow
|
||||
_onHorizontalPageChanged(entries.length - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
final newEntry = _currentHorizontalPage != null && _currentHorizontalPage < entries.length ? entries[_currentHorizontalPage] : null;
|
||||
if (_entryNotifier.value == newEntry) return;
|
||||
_entryNotifier.value = newEntry;
|
||||
|
|
Loading…
Reference in a new issue