Skip to content

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesvedder committed Nov 19, 2024
1 parent 14b72d7 commit 71e8070
Show file tree
Hide file tree
Showing 18 changed files with 53 additions and 43 deletions.
8 changes: 4 additions & 4 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ packages:
dependency: transitive
description:
name: charcode
sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306
sha256: fb0f1107cac15a5ea6ef0a6ef71a807b9e4267c713bb93e00e92d737cc8dbd8a
url: "https://pub.dev"
source: hosted
version: "1.3.1"
version: "1.4.0"
checked_yaml:
dependency: transitive
description:
Expand Down Expand Up @@ -873,10 +873,10 @@ packages:
dependency: transitive
description:
name: permission_handler_html
sha256: af26edbbb1f2674af65a8f4b56e1a6f526156bc273d0e65dd8075fab51c78851
sha256: "6b9cb54b7135073841a35513fba39e598b421702d5f4d92319992fd6eb5532a9"
url: "https://pub.dev"
source: hosted
version: "0.1.3+2"
version: "0.1.3+4"
permission_handler_platform_interface:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion designer_v2/lib/features/design/study_form_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class StudyFormViewModel extends FormViewModel<Study>
/// before the [StudyController]'s [Study] is available (see also: [AsyncValue])
@riverpod
StudyFormViewModel studyFormViewModel(
StudyFormViewModelRef ref,
Ref ref,
StudyID studyId,
) {
// print("studyFormViewModel");
Expand Down
29 changes: 15 additions & 14 deletions designer_v2/lib/features/design/study_form_providers.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:studyu_designer_v2/domain/study.dart';
import 'package:studyu_designer_v2/features/design/enrollment/consent_item_form_controller.dart';
Expand Down Expand Up @@ -26,7 +27,7 @@ part 'study_form_providers.g.dart';

@riverpod
StudyInfoFormViewModel studyInfoFormViewModel(
StudyInfoFormViewModelRef ref,
Ref ref,
StudyID studyId,
) {
return ref.watch(studyFormViewModelProvider(studyId)).studyInfoFormViewModel;
Expand All @@ -36,23 +37,23 @@ StudyInfoFormViewModel studyInfoFormViewModel(

@riverpod
EnrollmentFormViewModel enrollmentFormViewModel(
EnrollmentFormViewModelRef ref,
Ref ref,
StudyID studyId,
) {
return ref.watch(studyFormViewModelProvider(studyId)).enrollmentFormViewModel;
}

@riverpod
ScreenerQuestionFormViewModel screenerQuestionFormViewModel(
ScreenerQuestionFormViewModelRef ref,
Ref ref,
ScreenerQuestionFormRouteArgs args,
) {
return ref.watch(enrollmentFormViewModelProvider(args.studyId)).provide(args);
}

@riverpod
ConsentItemFormViewModel consentItemFormViewModel(
ConsentItemFormViewModelRef ref,
Ref ref,
ConsentItemFormRouteArgs args,
) {
return ref
Expand All @@ -65,7 +66,7 @@ ConsentItemFormViewModel consentItemFormViewModel(

@riverpod
InterventionsFormViewModel interventionsFormViewModel(
InterventionsFormViewModelRef ref,
Ref ref,
StudyID studyId,
) {
return ref
Expand All @@ -75,7 +76,7 @@ InterventionsFormViewModel interventionsFormViewModel(

@riverpod
InterventionFormViewModel interventionFormViewModel(
InterventionFormViewModelRef ref,
Ref ref,
InterventionFormRouteArgs args,
) {
return ref
Expand All @@ -85,7 +86,7 @@ InterventionFormViewModel interventionFormViewModel(

@riverpod
InterventionTaskFormViewModel interventionTaskFormViewModel(
InterventionTaskFormViewModelRef ref,
Ref ref,
InterventionTaskFormRouteArgs args,
) {
return ref.watch(interventionFormViewModelProvider(args)).provide(args);
Expand All @@ -95,7 +96,7 @@ InterventionTaskFormViewModel interventionTaskFormViewModel(

@riverpod
MeasurementsFormViewModel measurementsFormViewModel(
MeasurementsFormViewModelRef ref,
Ref ref,
StudyID studyId,
) {
return ref
Expand All @@ -105,7 +106,7 @@ MeasurementsFormViewModel measurementsFormViewModel(

@riverpod
MeasurementSurveyFormViewModel surveyFormViewModel(
SurveyFormViewModelRef ref,
Ref ref,
MeasurementFormRouteArgs args,
) {
return ref
Expand All @@ -115,7 +116,7 @@ MeasurementSurveyFormViewModel surveyFormViewModel(

@riverpod
QuestionFormViewModel surveyQuestionFormViewModel(
SurveyQuestionFormViewModelRef ref,
Ref ref,
SurveyQuestionFormRouteArgs args,
) {
return ref.watch(surveyFormViewModelProvider(args)).provide(args);
Expand All @@ -125,15 +126,15 @@ QuestionFormViewModel surveyQuestionFormViewModel(

@riverpod
ReportsFormViewModel reportsFormViewModel(
ReportsFormViewModelRef ref,
Ref ref,
StudyID studyId,
) {
return ref.watch(studyFormViewModelProvider(studyId)).reportsFormViewModel;
}

@riverpod
ReportItemFormViewModel reportItemFormViewModel(
ReportItemFormViewModelRef ref,
Ref ref,
ReportItemFormRouteArgs args,
) {
return ref
Expand All @@ -148,7 +149,7 @@ ReportItemFormViewModel reportItemFormViewModel(
/// a [StudyFormValidationSet.publish]
@riverpod
StudyFormViewModel studyPublishValidator(
StudyPublishValidatorRef ref,
Ref ref,
StudyID studyId,
) {
final state = ref.watch(studyControllerProvider(studyId));
Expand All @@ -165,7 +166,7 @@ StudyFormViewModel studyPublishValidator(
/// a [StudyFormValidationSet.test]
@riverpod
StudyFormViewModel studyTestValidator(
StudyTestValidatorRef ref,
Ref ref,
StudyID studyId,
) {
final state = ref.watch(studyControllerProvider(studyId));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:reactive_forms/reactive_forms.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:studyu_core/core.dart';
Expand Down Expand Up @@ -182,7 +183,7 @@ class InviteCodeFormViewModel extends FormViewModel<StudyInvite> {
/// before the [StudyController]'s [Study] is available (see also: [AsyncValue])
@riverpod
InviteCodeFormViewModel inviteCodeFormViewModel(
InviteCodeFormViewModelRef ref,
Ref ref,
StudyID studyId,
) {
// Reactively bind to and obtain [StudyController]'s current study
Expand Down
3 changes: 2 additions & 1 deletion designer_v2/lib/features/study/study_test_controller.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/foundation.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:studyu_designer_v2/domain/study.dart';
import 'package:studyu_designer_v2/features/study/study_controller.dart';
Expand Down Expand Up @@ -47,7 +48,7 @@ class StudyTestController extends _$StudyTestController {
/// Provide a controller parametrized by [StudyID]
@riverpod
PlatformController studyTestPlatformController(
StudyTestPlatformControllerRef ref,
Ref ref,
StudyID studyId,
) {
final state = ref.watch(studyTestControllerProvider(studyId));
Expand Down
7 changes: 4 additions & 3 deletions designer_v2/lib/localization/locale_providers.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:ui';

import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:studyu_designer_v2/constants.dart';
import 'package:studyu_designer_v2/localization/locale_state.dart';
Expand All @@ -10,14 +11,14 @@ part 'locale_providers.g.dart';
/// Platform Locale Provider
/// Returns the locale of the Platform.localeName
@riverpod
Locale platformLocale(PlatformLocaleRef ref) {
Locale platformLocale(Ref ref) {
// Get the platform language using platform specific implementations
return PlatformLocale().getPlatformLocale();
}

/// Supported Locales Provider
@riverpod
List<Locale> supportedLocales(SupportedLocalesRef ref) {
List<Locale> supportedLocales(Ref ref) {
return Config.supportedLocales.entries
.map((e) => Locale(e.key, e.value))
.toList();
Expand All @@ -26,6 +27,6 @@ List<Locale> supportedLocales(SupportedLocalesRef ref) {
/// Locale Provider
/// Provides the current locale, and automatically updates when the locale changes.
@riverpod
Locale locale(LocaleRef ref) {
Locale locale(Ref ref) {
return ref.watch(localeStateNotifierProvider).locale;
}
3 changes: 2 additions & 1 deletion designer_v2/lib/repositories/api_client.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:studyu_core/core.dart';
import 'package:studyu_designer_v2/domain/study.dart';
Expand Down Expand Up @@ -314,6 +315,6 @@ class StudyUApiClient extends SupabaseClientDependant
}

@riverpod
StudyUApiClient apiClient(ApiClientRef ref) => StudyUApiClient(
StudyUApiClient apiClient(Ref ref) => StudyUApiClient(
supabaseClient: ref.watch(supabaseClientProvider),
);
3 changes: 2 additions & 1 deletion designer_v2/lib/repositories/app_repository.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:studyu_core/core.dart';
import 'package:studyu_designer_v2/repositories/api_client.dart';
Expand Down Expand Up @@ -27,7 +28,7 @@ class AppRepository implements IAppRepository {
}

@riverpod
Future<AppConfig> appConfig(AppConfigRef ref) async {
Future<AppConfig> appConfig(Ref ref) async {
final apiClient = ref.watch(apiClientProvider);
return await AppRepository(apiClient).fetchAppConfig();
}
3 changes: 2 additions & 1 deletion designer_v2/lib/repositories/auth_repository.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';
import 'dart:convert';

import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:rxdart/subjects.dart';
import 'package:studyu_designer_v2/features/app_controller.dart';
Expand Down Expand Up @@ -165,7 +166,7 @@ class AuthRepository implements IAuthRepository {
}

@riverpod
AuthRepository authRepository(AuthRepositoryRef ref) {
AuthRepository authRepository(Ref ref) {
final authRepository = AuthRepository(
supabaseClient: ref.watch(supabaseClientProvider),
);
Expand Down
2 changes: 1 addition & 1 deletion designer_v2/lib/repositories/invite_code_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class InviteCodeRepositoryDelegate

@riverpod
InviteCodeRepository inviteCodeRepository(
InviteCodeRepositoryRef ref,
Ref ref,
StudyID studyId,
) {
print("inviteCodeRepositoryProvider($studyId");
Expand Down
2 changes: 1 addition & 1 deletion designer_v2/lib/repositories/study_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class StudyRepositoryDelegate extends IModelRepositoryDelegate<Study> {
}

@riverpod
StudyRepository studyRepository(StudyRepositoryRef ref) => StudyRepository(
StudyRepository studyRepository(Ref ref) => StudyRepository(
apiClient: ref.watch(apiClientProvider),
authRepository: ref.watch(authRepositoryProvider),
ref: ref,
Expand Down
2 changes: 1 addition & 1 deletion designer_v2/lib/repositories/user_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class UserRepository implements IUserRepository {
}

@riverpod
UserRepository userRepository(UserRepositoryRef ref) {
UserRepository userRepository(Ref ref) {
return UserRepository(
authRepository: ref.watch(authRepositoryProvider),
apiClient: ref.watch(apiClientProvider),
Expand Down
3 changes: 2 additions & 1 deletion designer_v2/lib/routing/router.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:studyu_designer_v2/common_views/pages/error_page.dart';
Expand All @@ -22,7 +23,7 @@ part 'router.g.dart';
/// route changes in the app. See router_intent.dart for more details.
@riverpod
GoRouter router(RouterRef ref) {
GoRouter router(Ref ref) {
final authRepository = ref.watch(authRepositoryProvider);
final appController = ref.watch(appControllerProvider.notifier);
const defaultLocation = studiesRouteName;
Expand Down
3 changes: 2 additions & 1 deletion designer_v2/lib/services/clipboard.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'clipboard.g.dart';
Expand All @@ -16,6 +17,6 @@ class ClipboardService implements IClipboardService {
}

@riverpod
IClipboardService clipboardService(ClipboardServiceRef ref) {
IClipboardService clipboardService(Ref ref) {
return ClipboardService();
}
3 changes: 2 additions & 1 deletion designer_v2/lib/services/notification_service.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:async';

import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:rxdart/subjects.dart';
import 'package:studyu_designer_v2/services/notification_types.dart';
Expand Down Expand Up @@ -60,7 +61,7 @@ class NotificationService implements INotificationService {
}

@Riverpod(keepAlive: true)
NotificationService notificationService(NotificationServiceRef ref) {
NotificationService notificationService(Ref ref) {
ref.onDispose(() => print('NotificationService disposed'));

return NotificationService();
Expand Down
12 changes: 6 additions & 6 deletions designer_v2/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,10 @@ packages:
dependency: transitive
description:
name: riverpod_analyzer_utils
sha256: dc53a659cb543b203cdc35cd4e942ed08ea893eb6ef12029301323bdf18c5d95
sha256: c6b8222b2b483cb87ae77ad147d6408f400c64f060df7a225b127f4afef4f8c8
url: "https://pub.dev"
source: hosted
version: "0.5.7"
version: "0.5.8"
riverpod_annotation:
dependency: "direct main"
description:
Expand All @@ -1013,18 +1013,18 @@ packages:
dependency: "direct dev"
description:
name: riverpod_generator
sha256: "54458dac2fea976990dc9ed379060db6ae5c8790143f1963fedd0fb99980a326"
sha256: "63546d70952015f0981361636bf8f356d9cfd9d7f6f0815e3c07789a41233188"
url: "https://pub.dev"
source: hosted
version: "2.6.2"
version: "2.6.3"
riverpod_lint:
dependency: "direct dev"
description:
name: riverpod_lint
sha256: "326efc199b87f21053b9a2afbf2aea26c41b3bf6f8ba346ce69126ee17d16ebd"
sha256: "83e4caa337a9840469b7b9bd8c2351ce85abad80f570d84146911b32086fbd99"
url: "https://pub.dev"
source: hosted
version: "2.6.2"
version: "2.6.3"
rxdart:
dependency: "direct main"
description:
Expand Down
4 changes: 2 additions & 2 deletions designer_v2/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ dev_dependencies:
json_diff: ^0.2.1
lint: ^2.3.0
patrol_finders: ^2.3.0
riverpod_generator: ^2.6.2
riverpod_lint: ^2.6.2
riverpod_generator: ^2.6.3
riverpod_lint: ^2.6.3
test: ^1.24.9

flutter:
Expand Down
Loading

0 comments on commit 71e8070

Please sign in to comment.