-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import '../entities/nostr_list.dart'; | ||
import '../repositories/nostr_list_repository.dart'; | ||
|
||
class GetNostrLists { | ||
final NostrListRepository _nostrListRepository; | ||
|
||
GetNostrLists({ | ||
required NostrListRepository nostrListRepository, | ||
}) : _nostrListRepository = nostrListRepository; | ||
|
||
Future<NostrSet?> getPublicNostrFollowSet({ | ||
required String pubKey, | ||
required String name, | ||
}) { | ||
return _nostrListRepository.getPublicNostrFollowSet( | ||
pubKey: pubKey, | ||
name: name, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
|
||
import '../../data_layer/data_sources/dart_ndk_source.dart'; | ||
import '../../data_layer/repositories/nostr_list_repository_impl.dart'; | ||
import '../../domain_layer/repositories/nostr_list_repository.dart'; | ||
import '../../domain_layer/usecases/get_nostr_lists.dart'; | ||
|
||
import 'ndk_provider.dart'; | ||
|
||
final nostrListProvider = Provider<GetNostrLists>((ref) { | ||
final ndk = ref.watch(ndkProvider); | ||
|
||
final DartNdkSource dartNdkSource = DartNdkSource(ndk); | ||
|
||
final NostrListRepository listsRepo = NostrListRepositoryImpl( | ||
dartNdkSource: dartNdkSource, | ||
); | ||
|
||
final GetNostrLists getLists = GetNostrLists(nostrListRepository: listsRepo); | ||
|
||
return getLists; | ||
}); |