Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lishaduck committed Oct 23, 2024
1 parent 2b793de commit f5f86a0
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 54 deletions.
2 changes: 1 addition & 1 deletion lib/app/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppRouter extends RootStackRouter {
AppRouter({required this.ref});

/// Gain access to the needed providers.
final Ref<AppRouter> ref;
final Ref ref;

@override
final defaultRouteType = const RouteType.custom(
Expand Down
13 changes: 7 additions & 6 deletions lib/features/auth/application/auth_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ library;

import "dart:typed_data";

import "package:hooks_riverpod/hooks_riverpod.dart";
import "package:riverpod_annotation/riverpod_annotation.dart";

import "../data/auth_repository.dart";
Expand Down Expand Up @@ -44,33 +45,33 @@ base class PirateAuthService extends _$PirateAuthService {
///
/// Use [pirateAuthServiceProvider] for more granular output.
@Riverpod(keepAlive: true)
Future<PirateUserEntity> user(UserRef ref) async => await ref.watch(
Future<PirateUserEntity> user(Ref ref) async => await ref.watch(
pirateAuthServiceProvider.selectAsync((value) => value.user),
);

/// Get the current user's name.
///
/// Named as such to prevent a naming conflict with riverpod.
@riverpod
Future<String> username(UsernameRef ref) async =>
Future<String> username(Ref ref) async =>
await ref.watch(userProvider.selectAsync((value) => value.name));

/// Get the current user's email address.
@riverpod
Future<String> email(EmailRef ref) async =>
Future<String> email(Ref ref) async =>
await ref.watch(userProvider.selectAsync((value) => value.email));

/// Get the current user's avatar.
@riverpod
Future<Uint8List> avatar(AvatarRef ref) async =>
Future<Uint8List> avatar(Ref ref) async =>
await ref.watch(userProvider.selectAsync((value) => value.avatar));

/// Get the current user's account type.
@riverpod
Future<AccountType> accountType(AccountTypeRef ref) async =>
Future<AccountType> accountType(Ref ref) async =>
await ref.watch(userProvider.selectAsync((value) => value.accountType));

/// Get the current user's ID.
@riverpod
Future<int> id(IdRef ref) async =>
Future<int> id(Ref ref) async =>
await ref.watch(userProvider.selectAsync((value) => value.id));
3 changes: 2 additions & 1 deletion lib/features/auth/data/auth_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "dart:typed_data";
import "package:appwrite/appwrite.dart";
import "package:appwrite/enums.dart";
import "package:appwrite/models.dart";
import "package:hooks_riverpod/hooks_riverpod.dart";
import "package:riverpod_annotation/riverpod_annotation.dart";

import "../../../utils/api.dart";
Expand Down Expand Up @@ -123,7 +124,7 @@ final fakeUser = PirateUserEntity(

/// Get the authentication data provider.
@Riverpod(keepAlive: true)
AuthRepository auth(AuthRef ref) {
AuthRepository auth(Ref ref) {
final account = ref.watch(accountsProvider);
final platform = ref.watch(currentPlatformProvider);
final avatar = ref.watch(avatarProvider);
Expand Down
3 changes: 2 additions & 1 deletion lib/features/auth/data/avatar_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ library;
import "dart:typed_data";

import "package:appwrite/appwrite.dart";
import "package:hooks_riverpod/hooks_riverpod.dart";
import "package:riverpod_annotation/riverpod_annotation.dart";

import "../../../utils/api.dart";
Expand All @@ -29,7 +30,7 @@ base class _AppwriteAvatarRepository implements AvatarRepository {

/// Get the current user's avatar.
@Riverpod(keepAlive: true)
AvatarRepository avatar(AvatarRef ref) {
AvatarRepository avatar(Ref ref) {
final avatars = ref.watch(avatarsProvider);

return _AppwriteAvatarRepository(avatars);
Expand Down
3 changes: 2 additions & 1 deletion lib/features/dashboard/application/dashboard_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
library;

import "package:flutter/material.dart";
import "package:hooks_riverpod/hooks_riverpod.dart";
import "package:riverpod_annotation/riverpod_annotation.dart";

import "../../../gen/assets.gen.dart";
Expand Down Expand Up @@ -54,6 +55,6 @@ List<AppletEntity> get _applets {

/// Get the list of applets.
@riverpod
List<AppletEntity> applets(AppletsRef ref) => ref.watch(
List<AppletEntity> applets(Ref ref) => ref.watch(
dashboardServiceProvider.select((value) => value.applets),
);
3 changes: 2 additions & 1 deletion lib/features/pirate_coins/application/coins_service.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// This library contains the Pirate Coins feature's business logic.
library;

import "package:hooks_riverpod/hooks_riverpod.dart";
import "package:riverpod_annotation/riverpod_annotation.dart";

import "../../auth/application/auth_service.dart";
Expand Down Expand Up @@ -42,7 +43,7 @@ base class CoinsService extends _$CoinsService {

/// Get the coins of the current user.
@riverpod
Future<CoinsModel> currentUserCoins(CurrentUserCoinsRef ref) async {
Future<CoinsModel> currentUserCoins(Ref ref) async {
final userId = await ref.watch(idProvider.future);

return ref.read(coinsServiceProvider(userId).future);
Expand Down
5 changes: 3 additions & 2 deletions lib/features/pirate_coins/data/coins_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ library;

import "package:appwrite/appwrite.dart";
import "package:appwrite/models.dart";
import "package:hooks_riverpod/hooks_riverpod.dart";
import "package:riverpod_annotation/riverpod_annotation.dart";

import "../../../utils/api.dart";
Expand Down Expand Up @@ -100,7 +101,7 @@ base class _AppwriteCoinsRepository implements CoinsRepository {

/// Get the coins data.
@riverpod
CoinsRepository coinsData(CoinsDataRef ref, int id) {
CoinsRepository coinsData(Ref ref, int id) {
final databases = ref.watch(databasesProvider);
final channel = ref.watch(_channelProvider(id));

Expand All @@ -127,7 +128,7 @@ class _Channel extends _$Channel {
/// Get the coins stream.
/// Used to coerce the stream into a [AsyncValue].
@riverpod
Stream<CoinEntity> coinStream(CoinStreamRef ref, int userId) async* {
Stream<CoinEntity> coinStream(Ref ref, int userId) async* {
final coinsDataRepository = ref.read(coinsDataProvider(userId));

yield* coinsDataRepository.coinsData();
Expand Down
11 changes: 6 additions & 5 deletions lib/utils/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ library;
import "package:appwrite/appwrite.dart";
import "package:flutter/foundation.dart";
import "package:freezed_annotation/freezed_annotation.dart";
import "package:hooks_riverpod/hooks_riverpod.dart";
import "package:riverpod_annotation/riverpod_annotation.dart";

import "../env/env.dart";
Expand Down Expand Up @@ -58,7 +59,7 @@ const ApiRepository apiInfo = Api(

/// Get the Appwrite client.
@Riverpod(keepAlive: true)
Client client(ClientRef ref) {
Client client(Ref ref) {
return Client()
.setEndpoint(apiInfo.url)
.setProject(apiInfo.projectId)
Expand All @@ -67,31 +68,31 @@ Client client(ClientRef ref) {

/// Get the Appwrite session for the current account.
@Riverpod(keepAlive: true)
Account accounts(AccountsRef ref) {
Account accounts(Ref ref) {
final client = ref.watch(clientProvider);

return Account(client);
}

/// Get the Appwrite databases.
@Riverpod(keepAlive: true)
Databases databases(DatabasesRef ref) {
Databases databases(Ref ref) {
final client = ref.watch(clientProvider);

return Databases(client);
}

/// Get the Appwrite avatars.
@Riverpod(keepAlive: true)
Avatars avatars(AvatarsRef ref) {
Avatars avatars(Ref ref) {
final client = ref.watch(clientProvider);

return Avatars(client);
}

/// Get the Appwrite realtime subscriptions.
@Riverpod(keepAlive: true)
Realtime realtime(RealtimeRef ref) {
Realtime realtime(Ref ref) {
final client = ref.watch(clientProvider);

return Realtime(client);
Expand Down
3 changes: 2 additions & 1 deletion lib/utils/device_repository.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/// This library contains the utilities feature's device data fetchers.
library;

import "package:hooks_riverpod/hooks_riverpod.dart";
import "package:os_detect/os_detect.dart";
import "package:riverpod_annotation/riverpod_annotation.dart";

part "device_repository.g.dart";

/// Get the current device platform as an enum.
@Riverpod(keepAlive: true)
Device currentPlatform(CurrentPlatformRef ref) {
Device currentPlatform(Ref ref) {
return switch (operatingSystem) {
"android" => Device.android,
"ios" => Device.ios,
Expand Down
3 changes: 2 additions & 1 deletion lib/utils/router.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "package:hooks_riverpod/hooks_riverpod.dart";
import "package:riverpod_annotation/riverpod_annotation.dart";

import "../app/app_router.dart";
Expand All @@ -6,6 +7,6 @@ part "router.g.dart";

/// Get the app's router.
@Riverpod(keepAlive: true)
Raw<AppRouter> router(RouterRef ref) {
Raw<AppRouter> router(Ref ref) {
return AppRouter(ref: ref);
}
59 changes: 30 additions & 29 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834
sha256: "45cfa8471b89fb6643fe9bf51bd7931a76b8f5ec2d65de4fb176dba8d4f22c77"
url: "https://pub.dev"
source: hosted
version: "72.0.0"
version: "73.0.0"
_macros:
dependency: transitive
description: dart
Expand All @@ -18,10 +18,10 @@ packages:
dependency: transitive
description:
name: analyzer
sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139
sha256: "4959fec185fe70cce007c57e9ab6983101dbe593d2bf8bbfb4453aaec0cf470a"
url: "https://pub.dev"
source: hosted
version: "6.7.0"
version: "6.8.0"
analyzer_plugin:
dependency: transitive
description:
Expand Down Expand Up @@ -263,13 +263,13 @@ packages:
source: hosted
version: "4.10.0"
collection:
dependency: transitive
dependency: "direct overridden"
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.19.1"
color:
dependency: transitive
description:
Expand Down Expand Up @@ -330,18 +330,18 @@ packages:
dependency: "direct dev"
description:
name: custom_lint
sha256: "6e1ec47427ca968f22bce734d00028ae7084361999b41673291138945c5baca0"
sha256: "832fcdc676171205201c9cffafd6b5add19393962f6598af8472b48b413026e6"
url: "https://pub.dev"
source: hosted
version: "0.6.7"
version: "0.6.8"
custom_lint_builder:
dependency: transitive
description:
name: custom_lint_builder
sha256: ba2f90fff4eff71d202d097eb14b14f87087eaaef742e956208c0eb9d3a40a21
sha256: c3d82779026f91b8e00c9ac18934595cbc9b490094ea682052beeafdb2bd50ac
url: "https://pub.dev"
source: hosted
version: "0.6.7"
version: "0.6.8"
custom_lint_core:
dependency: transitive
description:
Expand Down Expand Up @@ -500,10 +500,10 @@ packages:
dependency: transitive
description:
name: flutter_riverpod
sha256: "0f1974eff5bbe774bf1d870e406fc6f29e3d6f1c46bd9c58e7172ff68a785d7d"
sha256: "9532ee6db4a943a1ed8383072a2e3eeda041db5657cdf6d2acecf3c21ecbe7e1"
url: "https://pub.dev"
source: hosted
version: "2.5.1"
version: "2.6.1"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -549,10 +549,11 @@ packages:
freezed_lint:
dependency: "direct dev"
description:
name: freezed_lint
sha256: "7b284ee7f10d8fed9e7e38bf3041a2735f3d69731b542164d1f17dfe7e0a7815"
url: "https://pub.dev"
source: hosted
path: "packages/freezed_lint"
ref: master
resolved-ref: bd76eb626aedef29136b255c0dc99e3501d315bd
url: "https://github.com/rrousselGit/freezed.git"
source: git
version: "0.0.5"
frontend_server_client:
dependency: transitive
Expand Down Expand Up @@ -590,10 +591,10 @@ packages:
dependency: "direct main"
description:
name: hooks_riverpod
sha256: "97266a91c994951a06ef0ff3a1c7fb261e52ec7f74e87f0614ea0b7411b859b2"
sha256: "70bba33cfc5670c84b796e6929c54b8bc5be7d0fe15bb28c2560500b9ad06966"
url: "https://pub.dev"
source: hosted
version: "2.5.2"
version: "2.6.1"
hotreloader:
dependency: transitive
description:
Expand Down Expand Up @@ -1022,42 +1023,42 @@ packages:
dependency: transitive
description:
name: riverpod
sha256: f21b32ffd26a36555e501b04f4a5dca43ed59e16343f1a30c13632b2351dfa4d
sha256: "59062512288d3056b2321804332a13ffdd1bf16df70dcc8e506e411280a72959"
url: "https://pub.dev"
source: hosted
version: "2.5.1"
version: "2.6.1"
riverpod_analyzer_utils:
dependency: transitive
description:
name: riverpod_analyzer_utils
sha256: ac28d7bc678471ec986b42d88e5a0893513382ff7542c7ac9634463b044ac72c
sha256: "0dcb0af32d561f8fa000c6a6d95633c9fb08ea8a8df46e3f9daca59f11218167"
url: "https://pub.dev"
source: hosted
version: "0.5.4"
version: "0.5.6"
riverpod_annotation:
dependency: "direct main"
description:
name: riverpod_annotation
sha256: e5e796c0eba4030c704e9dae1b834a6541814963292839dcf9638d53eba84f5c
sha256: e14b0bf45b71326654e2705d462f21b958f987087be850afd60578fcd502d1b8
url: "https://pub.dev"
source: hosted
version: "2.3.5"
version: "2.6.1"
riverpod_generator:
dependency: "direct dev"
description:
name: riverpod_generator
sha256: "63311e361ffc578d655dfc31b48dfa4ed3bc76fd06f9be845e9bf97c5c11a429"
sha256: "851aedac7ad52693d12af3bf6d92b1626d516ed6b764eb61bf19e968b5e0b931"
url: "https://pub.dev"
source: hosted
version: "2.4.3"
version: "2.6.1"
riverpod_lint:
dependency: "direct dev"
description:
name: riverpod_lint
sha256: a35a92f2c2a4b7a5d95671c96c5432b42c20f26bb3e985e83d0b186471b61a85
sha256: "0684c21a9a4582c28c897d55c7b611fa59a351579061b43f8c92c005804e63a8"
url: "https://pub.dev"
source: hosted
version: "2.3.13"
version: "2.6.1"
rxdart:
dependency: transitive
description:
Expand Down
Loading

0 comments on commit f5f86a0

Please sign in to comment.