fix: flutter remove setState in initState (#8807)

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow
2024-07-24 14:00:49 +08:00
committed by GitHub
parent 57d1b1ecc4
commit 79a1f888d6
12 changed files with 69 additions and 31 deletions

View File

@@ -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()) {