Skip to content

Commit

Permalink
fix: riverpod 2.6.1 の対応
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsutakein committed Jan 11, 2025
1 parent d0b17c6 commit 7b7808c
Show file tree
Hide file tree
Showing 86 changed files with 126 additions and 98 deletions.
3 changes: 2 additions & 1 deletion app/mobile/lib/router/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import 'package:feature_settings/feature_settings.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'app_router.g.dart';
Expand All @@ -37,7 +38,7 @@ part 'package:app_mobile/router/shell_branch/settings_branch.dart';
final rootNavigatorKey = GlobalKey<NavigatorState>();

@riverpod
GoRouter router(RouterRef ref) {
GoRouter router(Ref ref) {
final authenticator = ref.watch(authenticatorProvider);

return GoRouter(
Expand Down
2 changes: 1 addition & 1 deletion app/mobile/lib/router/app_router.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion core/analytics/lib/src/quest/quest_analytics.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'quest_analytics.g.dart';

@Riverpod(keepAlive: true)
QuestAnalytics questAnalytics(QuestAnalyticsRef ref) {
QuestAnalytics questAnalytics(Ref ref) {
throw UnimplementedError('questAnalytics');
}

Expand Down
2 changes: 1 addition & 1 deletion core/analytics/lib/src/quest/quest_analytics.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/analytics/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ resolution: workspace

dependencies:
core_common: any
riverpod: 2.6.1
riverpod_annotation: 2.6.1

dev_dependencies:
Expand Down
3 changes: 2 additions & 1 deletion core/analytics_firebase/lib/src/firebase_analytics.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import 'package:core_analytics_firebase/src/quest/firebase_quest_analytics.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'firebase_analytics.g.dart';

/// FirebaseAnalytics instance
@Riverpod(keepAlive: true)
FirebaseAnalytics firebaseAnalytics(FirebaseAnalyticsRef ref) {
FirebaseAnalytics firebaseAnalytics(Ref ref) {
throw UnimplementedError('firebaseAnalytics');
}

Expand Down
2 changes: 1 addition & 1 deletion core/analytics_firebase/lib/src/firebase_analytics.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/analytics_firebase/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies:
core_analytics: any
core_common: any
firebase_analytics: 11.3.5
riverpod: 2.6.1
riverpod_annotation: 2.6.1

dev_dependencies:
Expand Down
3 changes: 2 additions & 1 deletion core/authenticator/lib/src/authenticator.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import 'package:core_model/auth.dart';
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'authenticator.g.dart';

/// Authenticator instance
@Riverpod(keepAlive: true)
Authenticator authenticator(AuthenticatorRef ref) {
Authenticator authenticator(Ref ref) {
throw UnimplementedError('authenticator');
}

Expand Down
2 changes: 1 addition & 1 deletion core/authenticator/lib/src/authenticator.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/authenticator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ resolution: workspace
dependencies:
core_common: any
core_model: any
riverpod: 2.6.1
riverpod_annotation: 2.6.1

dev_dependencies:
Expand Down
3 changes: 2 additions & 1 deletion core/data/lib/src/legal_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import 'dart:async';
import 'package:core_common/extension.dart';
import 'package:core_datastore/agreed_version_data_store.dart';
import 'package:core_model/rule.dart';
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'legal_repository.g.dart';

@riverpod
LegalRepository legalRepository(LegalRepositoryRef ref) => LegalRepository(
LegalRepository legalRepository(Ref ref) => LegalRepository(
agreedVersionDataStore: ref.watch(agreedVersionDataStoreProvider),
);

Expand Down
2 changes: 1 addition & 1 deletion core/data/lib/src/legal_repository.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion core/data/lib/src/news_repository.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import 'package:core_model/feed.dart';
import 'package:core_network/news.dart';
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'news_repository.g.dart';

@riverpod
NewsRepository newsRepository(NewsRepositoryRef ref) => NewsRepository(
NewsRepository newsRepository(Ref ref) => NewsRepository(
remote: ref.watch(newsRemoteDataSourceProvider),
);

Expand Down
2 changes: 1 addition & 1 deletion core/data/lib/src/news_repository.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion core/data/lib/src/quest_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import 'package:core_common/extension.dart';
import 'package:core_database/quest_dao.dart';
import 'package:core_model/quest.dart';
import 'package:core_network/quest.dart';
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'quest_repository.g.dart';

@riverpod
QuestRepository questRepository(QuestRepositoryRef ref) => QuestRepository(
QuestRepository questRepository(Ref ref) => QuestRepository(
dao: ref.watch(questDaoProvider),
remote: ref.watch(questRemoteDataSourceProvider),
);
Expand Down
2 changes: 1 addition & 1 deletion core/data/lib/src/quest_repository.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion core/data/lib/src/user_settings_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import 'dart:async';

import 'package:core_datastore/theme_data_store.dart';
import 'package:core_model/theme.dart';
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'user_settings_repository.g.dart';

@riverpod
UserSettingsRepository userSettingsRepository(UserSettingsRepositoryRef ref) =>
UserSettingsRepository userSettingsRepository(Ref ref) =>
UserSettingsRepository(
themeDataStore: ref.watch(themeDataStoreProvider),
);
Expand Down
2 changes: 1 addition & 1 deletion core/data/lib/src/user_settings_repository.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/data/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:
core_datastore: any
core_model: any
core_network: any
riverpod: 2.6.1
riverpod_annotation: 2.6.1

dev_dependencies:
Expand Down
3 changes: 2 additions & 1 deletion core/database/lib/src/quest/quest_dao.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'package:core_model/quest.dart';
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'quest_dao.g.dart';

@Riverpod(keepAlive: true)
QuestDao questDao(QuestDaoRef ref) => throw UnimplementedError('questDao');
QuestDao questDao(Ref ref) => throw UnimplementedError('questDao');

abstract interface class QuestDao {
Future<Quest?> getById({required QuestId id});
Expand Down
2 changes: 1 addition & 1 deletion core/database/lib/src/quest/quest_dao.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/database/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ resolution: workspace
dependencies:
core_common: any
core_model: any
riverpod: 2.6.1
riverpod_annotation: 2.6.1

dev_dependencies:
Expand Down
3 changes: 2 additions & 1 deletion core/database_isar/lib/src/isar.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import 'package:core_database_isar/src/quest/isar_quest_dao.dart';
import 'package:isar/isar.dart';
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'isar.g.dart';

/// Isar instance
@Riverpod(keepAlive: true)
Isar isar(IsarRef ref) {
Isar isar(Ref ref) {
throw UnimplementedError('isar');
}

Expand Down
2 changes: 1 addition & 1 deletion core/database_isar/lib/src/isar.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/database_isar/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies:
isar:
hosted: https://pub.isar-community.dev/
version: 4.0.3
riverpod: 2.6.1
riverpod_annotation: 2.6.1

dev_dependencies:
Expand Down
3 changes: 2 additions & 1 deletion core/datastore/lib/src/agreed_version_data_store.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import 'dart:async';

import 'package:core_datastore/src/data_store.dart';
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'agreed_version_data_store.g.dart';

@riverpod
AgreedVersionDataStore agreedVersionDataStore(AgreedVersionDataStoreRef ref) =>
AgreedVersionDataStore agreedVersionDataStore(Ref ref) =>
AgreedVersionDataStore(
dataStore: ref.watch(dataStoreProvider),
);
Expand Down
2 changes: 1 addition & 1 deletion core/datastore/lib/src/agreed_version_data_store.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion core/datastore/lib/src/data_store.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'data_store.g.dart';

/// DataStore instance
@Riverpod(keepAlive: true)
DataStore dataStore(DataStoreRef ref) {
DataStore dataStore(Ref ref) {
throw UnimplementedError('dataStore');
}

Expand Down
2 changes: 1 addition & 1 deletion core/datastore/lib/src/data_store.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion core/datastore/lib/src/theme_data_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import 'dart:async';

import 'package:core_datastore/src/data_store.dart';
import 'package:core_model/theme.dart';
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'theme_data_store.g.dart';

@riverpod
ThemeDataStore themeDataStore(ThemeDataStoreRef ref) => ThemeDataStore(
ThemeDataStore themeDataStore(Ref ref) => ThemeDataStore(
dataStore: ref.watch(dataStoreProvider),
);

Expand Down
2 changes: 1 addition & 1 deletion core/datastore/lib/src/theme_data_store.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/datastore/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ resolution: workspace
dependencies:
core_common: any
core_model: any
riverpod: 2.6.1
riverpod_annotation: 2.6.1

dev_dependencies:
Expand Down
3 changes: 2 additions & 1 deletion core/domain/lib/src/use_case/auth/sign_in_use_case.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import 'package:core_authenticator/authenticator.dart';
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'sign_in_use_case.g.dart';

/// サインインする ユースケース
@riverpod
Raw<Future<void>> signInUseCase(
SignInUseCaseRef ref, {
Ref ref, {
required String email,
required String password,
}) async =>
Expand Down
2 changes: 1 addition & 1 deletion core/domain/lib/src/use_case/auth/sign_in_use_case.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion core/domain/lib/src/use_case/auth/sign_out_use_case.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import 'package:core_authenticator/authenticator.dart';
import 'package:riverpod/riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'sign_out_use_case.g.dart';

/// サインアウトする ユースケース
@riverpod
Raw<Future<void>> signOutUseCase(SignOutUseCaseRef ref) async =>
Raw<Future<void>> signOutUseCase(Ref ref) async =>
ref.watch(authenticatorProvider).signOut();
Loading

0 comments on commit 7b7808c

Please sign in to comment.