mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-05-22 23:12:16 +00:00
Improve Performance
`_resize(fit)` was called on every Build. `_resize` posts a WidgetsBinding frame callback unconditionally. If fit hasn't changed, this is wasted work.
This commit is contained in:
parent
47f3296e9e
commit
3aa5c73dba
1 changed files with 3 additions and 0 deletions
|
|
@ -1948,7 +1948,10 @@ mp.register_script_message('call_button_${button.id}_long', button${button.id}lo
|
|||
);
|
||||
}
|
||||
|
||||
BoxFit? _lastFit;
|
||||
void _resize(BoxFit fit) async {
|
||||
if (fit == _lastFit) return;
|
||||
_lastFit = fit;
|
||||
// Wait for the widget tree to settle before updating fit
|
||||
await WidgetsBinding.instance.endOfFrame;
|
||||
if (mounted) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue