Skip to content

Commit

Permalink
TW-1690: Add public room repository
Browse files Browse the repository at this point in the history
  • Loading branch information
hieutbui authored and hoangdat committed May 14, 2024
1 parent cd7fdc9 commit 1643de7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/data/repository/public_room_repository_impl.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:fluffychat/data/datasource/pubic_room_datasource.dart';
import 'package:fluffychat/data/model/search/public_room_response.dart';
import 'package:fluffychat/di/global/get_it_initializer.dart';
import 'package:fluffychat/domain/repository/public_room_reposity.dart';
import 'package:matrix/matrix.dart';

class PublicRoomRepositoryImpl extends PublicRoomRepository {
final PublicRoomDatasource _publicRoomDatasource =
getIt.get<PublicRoomDatasource>();

@override
Future<PublicRoomResponse> search({
PublicRoomQueryFilter? filter,
String? server,
int? limit,
}) {
return _publicRoomDatasource.search(
filter: filter,
server: server,
limit: limit,
);
}
}
10 changes: 10 additions & 0 deletions lib/domain/repository/public_room_reposity.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'package:fluffychat/data/model/search/public_room_response.dart';
import 'package:matrix/matrix.dart';

abstract class PublicRoomRepository {
Future<PublicRoomResponse> search({
PublicRoomQueryFilter? filter,
String? server,
int? limit,
});
}

0 comments on commit 1643de7

Please sign in to comment.