Skip to content

Commit

Permalink
chore:
Browse files Browse the repository at this point in the history
  • Loading branch information
redDwarf03 committed Dec 5, 2024
1 parent d5a2fb5 commit 8ce8a0c
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 285 deletions.
15 changes: 10 additions & 5 deletions lib/application/dapps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:aewallet/application/api_service.dart';
import 'package:aewallet/application/settings/settings.dart';
import 'package:aewallet/domain/models/dapp.dart';
import 'package:aewallet/infrastructure/repositories/dapps_repository.dart';
import 'package:aewallet/model/available_networks.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

Expand All @@ -17,21 +16,27 @@ DAppsRepositoryImpl dAppsRepository(
@riverpod
Future<DApp?> getDApp(
Ref ref,
AvailableNetworks network,
String code,
) async {
final apiService = ref.watch(apiServiceProvider);
return ref.watch(dAppsRepositoryProvider).getDApp(network, code, apiService);
final networkSettings = ref.watch(
SettingsProviders.settings.select((settings) => settings.network),
);
return ref
.watch(dAppsRepositoryProvider)
.getDApp(networkSettings.network, code, apiService);
}

@riverpod
Future<List<DApp>> getDAppsFromNetwork(
Ref ref,
AvailableNetworks network,
) async {
final apiService = ref.watch(apiServiceProvider);
final networkSettings = ref.watch(
SettingsProviders.settings.select((settings) => settings.network),
);
final dAppsFromNetwork = await ref
.read(dAppsRepositoryProvider)
.getDAppsFromNetwork(network, apiService);
.getDAppsFromNetwork(networkSettings.network, apiService);
return dAppsFromNetwork;
}
207 changes: 14 additions & 193 deletions lib/application/dapps.g.dart

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

8 changes: 5 additions & 3 deletions lib/application/feature_flags.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:aewallet/application/api_service.dart';
import 'package:aewallet/application/settings/settings.dart';
import 'package:aewallet/infrastructure/repositories/feature_flags_repository.dart';
import 'package:aewallet/model/available_networks.dart';
import 'package:aewallet/util/universal_platform.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
Expand All @@ -16,13 +16,15 @@ FeatureFlagsRepositoryImpl _featureFlagsRepository(
@riverpod
Future<bool?> getFeatureFlag(
Ref ref,
AvailableNetworks network,
String applicationCode,
String featureCode,
) async {
final apiService = ref.watch(apiServiceProvider);
final networkSettings = ref.watch(
SettingsProviders.settings.select((settings) => settings.network),
);
return ref.watch(_featureFlagsRepositoryProvider).getFeatureFlag(
network,
networkSettings.network,
apiService,
applicationCode,
featureCode,
Expand Down
Loading

0 comments on commit 8ce8a0c

Please sign in to comment.