62 lines
2.2 KiB
Dart
62 lines
2.2 KiB
Dart
import 'dart:async';
|
|
import 'dart:developer';
|
|
|
|
import 'package:regroup/Common/api_urls.dart';
|
|
import 'package:regroup/Common/base_manager.dart';
|
|
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
|
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityMebersModel.dart';
|
|
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityaddgroupsModel.dart';
|
|
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communitygroupsModel.dart';
|
|
|
|
CommunityAddgroupsModel? communityaddgroupobj;
|
|
CommunitygroupsModel? communitygroupspobj;
|
|
CommunityMembersModel? communitymembersobj;
|
|
|
|
|
|
|
|
|
|
class Getcommunity {
|
|
|
|
Future<ResponseData<dynamic>> getCommunityAddGroupsearch(updata,
|
|
{required StreamController<CommunityAddgroupsModel> streamController}) async {
|
|
final response =
|
|
await NetworkApiServices().getApi(
|
|
"${ApiUrls.getcommunityaddgroups}?search=$updata",
|
|
|
|
);
|
|
|
|
if (response.status == ResponseStatus.SUCCESS) {
|
|
communityaddgroupobj = CommunityAddgroupsModel.fromJson(response.data);
|
|
if (!streamController.isClosed) streamController.sink.add(communityaddgroupobj!);
|
|
}
|
|
return response;
|
|
}
|
|
|
|
Future<ResponseData<dynamic>> getCommunitygroups(updata) async {
|
|
final response = await NetworkApiServices().getApi(
|
|
"${ApiUrls.getcommunitygroups}?manage_community_xid=$updata",
|
|
// optionalpar: false
|
|
);
|
|
if (response.status == ResponseStatus.SUCCESS) {
|
|
communitygroupspobj = CommunitygroupsModel.fromJson(response.data);
|
|
log(communitygroupspobj!.data.toString());
|
|
}
|
|
return response;
|
|
}
|
|
|
|
Future<ResponseData<dynamic>> getCommunityMemberssearch(updata,updata2,
|
|
{required StreamController<CommunityMembersModel> streamController}) async {
|
|
final response =
|
|
await NetworkApiServices().getApi(
|
|
"${ApiUrls.getcommunitymembers}?manage_community_xid=$updata&search=$updata2",
|
|
|
|
);
|
|
|
|
if (response.status == ResponseStatus.SUCCESS) {
|
|
communitymembersobj = CommunityMembersModel.fromJson(response.data);
|
|
if (!streamController.isClosed) streamController.sink.add(communitymembersobj!);
|
|
}
|
|
return response;
|
|
}
|
|
|
|
} |