-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: ページング機能のエラー発生時の復帰処理を実装する #173
Comments
僭越ながら取り組ませていただきます! |
@blendthink しかしながら fluttercommunity/plus_plugins#479 import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'connectivity_status_provider.g.dart';
@Riverpod(keepAlive: true)
class ConnectivityStatus extends _$ConnectivityStatus {
@override
Stream<bool> build() async* {
connectivityStatus();
}
void connectivityStatus() {
Connectivity().onConnectivityChanged.listen((connectivityResult) {
state = AsyncData(_isOnline(connectivityResult));
});
}
bool _isOnline(List<ConnectivityResult> connectivityResult) {
const networkSource = [
ConnectivityResult.mobile,
ConnectivityResult.wifi,
ConnectivityResult.ethernet,
];
final result =
connectivityResult.map(networkSource.contains).toList().contains(true);
return result;
}
} 動作例 2024-05-21.12.31.38.mov |
@Aosanori 本来であればオフラインかどうかの判定も重要なのですが、いったんオフライン独自の実装は除外して検討していただけると助かります 🙏
今回は、エラー発生時の復帰処理の実装ですので、オフラインかどうかはあまり気にせず、 API 実行時にエラーが発生したさいにどのように復帰させるかをご検討いただけると助かります! |
@blendthink |
@Aosanori |
承知いたしました! |
@blendthink 2024-05-21.17.34.39.mov |
@Aosanori |
承知いたしました!お忙しい中ご確認ありがとうございます! |
はい、その認識であっています 🙆♂️ |
承知いたしました!お忙しい中ありがとうございます! |
これに関する既存の Issue はありますか?
動機
#2 にて基礎的なページング機能は実装しますが、2ページ目以降にエラーが発生した場合の復帰処理は未実装です。
提案
2ページ目以降にエラーが発生した場合の復帰処理を実装する。
参考: #2 では 以下の記事を参考に実装予定です。
https://zenn.dev/k9i/articles/b8c333e1bb8b9b
The text was updated successfully, but these errors were encountered: