mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
fix: flutter remove setState in initState (#8807)
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
@@ -48,6 +48,12 @@ class MyPopupMenuItemState<T, W extends PopupMenuChildrenItem<T>>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_initEnabled();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _initEnabled() async {
|
||||
if (widget.enabled != null) {
|
||||
enabled.value = widget.enabled!.value;
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ class _RemoteToolbarState extends State<RemoteToolbar> {
|
||||
initState() {
|
||||
super.initState();
|
||||
|
||||
Future.delayed(Duration.zero, () async {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
_fractionX.value = double.tryParse(await bind.sessionGetOption(
|
||||
sessionId: widget.ffi.sessionId,
|
||||
arg: 'remote-menubar-drag-x') ??
|
||||
@@ -1278,7 +1278,9 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_getLocalResolutionWayland();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_getLocalResolutionWayland();
|
||||
});
|
||||
}
|
||||
|
||||
Rect? scaledRect() {
|
||||
|
||||
@@ -1271,12 +1271,14 @@ class ActionIcon extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ActionIconState extends State<ActionIcon> {
|
||||
var hover = false.obs;
|
||||
final hover = false.obs;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
hover.value = false;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
hover.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user