⚙️
【Flutter】riverpodの追加 導入・設定まとめ
概要
Flutterプロジェクトにriverpodを追加する際、パッケージがいくつかあったり、機能を有効にするコードを追加しなければいけない。
ここを見ればOKとなるようなページを作成し効率化を図る。
パッケージの追加
dependencies
flutter pub add flutter_riverpod riverpod_annotation
dev_dependencies
flutter pub add -d custom_lint riverpod_lint riverpod_generator build_runner
flutter_lintの設定
analysis_options.yamlに以下を追加。
analyzer:
plugins:
- custom_lint
自動生成
flutter pub run build_runner build
Discussion