플러터 웹뷰를 사용중에 화면을 당겨서 웹페이지 새로고침을 하는 기능이 있다.
이때, 새로고침이 완료되었음에도 상단에서 로딩 아이콘이 계속 돌아가는 이슈 해결 방법을 공유한다.
void initState() {
super.initState();
pullToRefreshController = kIsWeb
? null
: PullToRefreshController(
settings: PullToRefreshSettings(
color: Colors.black,
),
onRefresh: () async {
if (Platform.isAndroid) {
webController?.reload();
} else if (Platform.isIOS) {
webController?.loadUrl(
urlRequest:
URLRequest(
url: await webController?.getUrl()),
);
}
pullToRefreshController?.endRefreshing(); // 이 코드 추가
},
);
}
'에러' 카테고리의 다른 글
[Flutter/iOS] 아이폰 앱 크래시, 아이폰 앱 강제종료 (feat. Flavor) (3) | 2024.12.03 |
---|---|
[FCM] tokens multiple message send / 토큰으로 다중 알림 메시지 전송 (0) | 2024.11.13 |
[Flutter] CFBundleIconFiles is not of the required type for that key (1) | 2024.08.21 |
[Flutter] local notification plugin FCM 알림 에러 (1) | 2024.08.06 |
[iOS] Core data NSCocoaErrorDomain (0) | 2024.02.20 |