>100 Views
March 06, 26
スライド概要
そろそろ Riverpod 3.0の話を しよう 2026.3.6 Mobile Act OSAKA 18 itok@そらかぜ
itok@そらかぜ • いとうけい(itok) • の中の人 • モバイルアプリエンジニア 兼 CEO • 副業でフリーランス的 • https://itok.jp/, https://sorakaze.co.jp/, @itokjp
所在地:京都市中京区 社員1人=自分
実績 自社 受託 公私合わせて200件以上のアプリ開発に携わる
iOS / Android / macOS / Windows / サーバ 一人でやってます(デザイン以外)
そらコーデ
関西圏のJR車内で広告でてます
そろそろ Riverpod 3.0の話を しよう
ここ最近の 開発プラットフォーム分布 SwiftUI (Swift) UIKit (Swift) Flutter (Dart)
Riverpod • A Reactive Caching and Data-binding Framework • https://riverpod.dev/
fi ffl Riverpod 3.0 • Uni cation of the Public APIs • Pause/Resume support • Provider life-cycle changes • O ine persistence (experimental) • Mutations (experimental) • Automatic retry • Ref.mounted • Generic support (code-generation) • New testing utilities • Statically safe scoping
fi Riverpod 3.0 • Uni cation of the Public APIs • Pause/Resume support • Provider life-cycle changes
fi Uni cation of the Public APIs
Uni cation of the Public APIs • Noti er • AutoDisposeNoti er • FamilyNoti er • AutoDisposeFamilyNoti er fi fi fi fi fi fi Noti er
Uni cation of the Public APIs • FutureProviderRef • StreamProviderRef • etc... fi Ref
Uni cation of the Public APIs • StateProvider • StateNoti erProvider • ChangeNoti erProvider 非推奨 fi fi fi riverpod/legacy.dart
Uni cation of the Public APIs クラスが統廃合されてシンプルに • 最初の学習コストが減りそう? fi •
Pause / Resume support
Pause / Resume support final subscription = ref.listen( todoListProvider, (previous, next) { // Do something with the new value }, ); subscription.pause(); subscription.resume();
Pause / Resume support • 任意のタイミングで止められるの便利 • 不要な発火を抑えることができる
Provider life-cycle changes
Provider life-cycle changes • listenしているwidgetが見えなくなると、自動で listenを止める(pause) • widgetが表示されるとlistenも再開(resume) • watchも同様 • resumeされた時に最新の値だけがやってくる
Provider life-cycle changes • たまに不安定・・・ • 「見えていない」の判定が難しいらしく止まらない ことがある • フィードバックもいろいろあがってるらしい
ffl そのほかの気になり • O ine persistence (experimental) • Mutations (experimental) • Automatic retry • Ref.mounted
Riverpod 3.0を使って 開発/保守を さらに安全/便利に