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:
@@ -55,14 +55,14 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
||||
super.initState();
|
||||
if (!isWeb) _uniLinksSubscription = listenUniLinks();
|
||||
if (_idController.text.isEmpty) {
|
||||
() async {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
final lastRemoteId = await bind.mainGetLastRemoteId();
|
||||
if (lastRemoteId != _idController.id) {
|
||||
setState(() {
|
||||
_idController.id = lastRemoteId;
|
||||
});
|
||||
}
|
||||
}();
|
||||
});
|
||||
}
|
||||
if (isAndroid) {
|
||||
if (!bind.isCustomClient()) {
|
||||
|
||||
@@ -83,9 +83,11 @@ class _RemotePageState extends State<RemotePage> {
|
||||
initSharedStates(widget.id);
|
||||
gFFI.chatModel
|
||||
.changeCurrentKey(MessageKey(widget.id, ChatModel.clientModeID));
|
||||
gFFI.chatModel.voiceCallStatus.value = VoiceCallStatus.notStarted;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
gFFI.chatModel.voiceCallStatus.value = VoiceCallStatus.notStarted;
|
||||
gFFI.dialogManager.loadMobileActionsOverlayVisible();
|
||||
});
|
||||
_blockableOverlayState.applyFfi(gFFI);
|
||||
gFFI.dialogManager.loadMobileActionsOverlayVisible();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -118,7 +118,7 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
||||
_hideNetwork =
|
||||
bind.mainGetBuildinOption(key: kOptionHideNetworkSetting) == 'Y';
|
||||
|
||||
() async {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
var update = false;
|
||||
|
||||
if (_hasIgnoreBattery) {
|
||||
@@ -177,7 +177,7 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
||||
if (update) {
|
||||
setState(() {});
|
||||
}
|
||||
}();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user