Created communities blocs, services, models, and params.

This commit is contained in:
Faris Armoush
2025-06-16 15:20:44 +03:00
parent 4d9145a953
commit b0aea94b91
8 changed files with 168 additions and 0 deletions

View File

@ -0,0 +1,20 @@
import 'package:syncrow_web/pages/space_management_v2/modules/communities/domain/models/community_model.dart';
import 'package:syncrow_web/pages/space_management_v2/modules/communities/domain/params/load_communities_param.dart';
import 'package:syncrow_web/pages/space_management_v2/modules/communities/domain/services/communities_service.dart';
import 'package:syncrow_web/services/api/http_service.dart';
class RemoteCommunitiesService implements CommunitiesService {
const RemoteCommunitiesService(this._httpService);
final HTTPService _httpService;
@override
Future<List<CommunityModel>> getCommunity(LoadCommunitiesParam param) async {
return _httpService.get(
path: '/api/communities/',
expectedResponseModel: (json) => (json as List<dynamic>)
.map((e) => CommunityModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
}
}