44 lines
1.5 KiB
Dart
44 lines
1.5 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/communityaddgroupsModel.dart';
|
|
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communitygroupsModel.dart';
|
|
|
|
CommunityAddgroupsModel? communityaddgroupobj;
|
|
CommunitygroupsModel? communitygroupspobj;
|
|
|
|
|
|
|
|
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;
|
|
}
|
|
|
|
} |