From 835338ef636798f4c8eeed86583bc9b5a1f0929c Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Sat, 21 Sep 2024 10:22:49 +0800 Subject: [PATCH] (flutter) use scheduleFrameCallback to invoke requestFrame to match Flutter/vsync --- .../lib/thermion/widgets/thermion_widget.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/thermion_flutter/thermion_flutter/lib/thermion/widgets/thermion_widget.dart b/thermion_flutter/thermion_flutter/lib/thermion/widgets/thermion_widget.dart index d0a6bf94..c0d0eff4 100644 --- a/thermion_flutter/thermion_flutter/lib/thermion/widgets/thermion_widget.dart +++ b/thermion_flutter/thermion_flutter/lib/thermion/widgets/thermion_widget.dart @@ -56,10 +56,19 @@ class _ThermionWidgetState extends State { if (mounted) { setState(() {}); } + + _requestFrame(); }); super.initState(); } + void _requestFrame() { + WidgetsBinding.instance.scheduleFrameCallback((d) { + widget.viewer.requestFrame(); + _requestFrame(); + }); + } + bool _resizing = false; Timer? _resizeTimer;