플러터 웹뷰를 사용중에 화면을 당겨서 웹페이지 새로고침을 하는 기능이 있다.
이때, 새로고침이 완료되었음에도 상단에서 로딩 아이콘이 계속 돌아가는 이슈 해결 방법을 공유한다.
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] CFBundleIconFiles is not of the required type for that key (0) | 2024.08.21 |
---|---|
[Flutter] local notification plugin FCM 알림 에러 (0) | 2024.08.06 |
[iOS] Core data NSCocoaErrorDomain (0) | 2024.02.20 |
[mac] zsh: command not found: pod 에러 해결 (1) | 2024.02.13 |
Android Material Date Picker 오류 (0) | 2022.01.24 |