master
戴余标 3 years ago
parent ee87661707
commit cea5643e0d

@ -95,15 +95,18 @@ class _SelectCommunityState extends State<SelectCommunity> {
onTap: () async { onTap: () async {
var cancel = BotToast.showLoading(); var cancel = BotToast.showLoading();
List<CommunityModel> _communities = []; List<CommunityModel> _communities = [];
var base = await NetUtil().get(SAASAPI.login.allCommunity, params: { try {
'cityId': UserTool var base = await NetUtil().get(SAASAPI.login.allCommunity, params: {
.appProvider.pickedCityAndCommunity!.cityModel.district.id, 'cityId': UserTool
}); .appProvider.pickedCityAndCommunity!.cityModel.district.id,
if (base.success) { });
_communities = (base.data as List) if (base.success) {
.map((e) => CommunityModel.fromJson(e)) _communities = (base.data as List)
.toList(); .map((e) => CommunityModel.fromJson(e))
} .toList();
}
} catch (e) {}
cancel(); cancel();
var _community = await BeeCommunityPicker.pick(context, _communities); var _community = await BeeCommunityPicker.pick(context, _communities);
print(_community?.name); print(_community?.name);

@ -108,6 +108,7 @@ class _NewHomePageState extends State<NewHomePage> {
), ),
SafeArea( SafeArea(
child: EasyRefresh( child: EasyRefresh(
firstRefresh: true,
onRefresh: () async { onRefresh: () async {
await _getAnnounces(); await _getAnnounces();
await _getStatusNum(); await _getStatusNum();

@ -15,8 +15,11 @@ class CommunityModel extends Equatable {
final String address; final String address;
@HiveField(3) @HiveField(3)
final String addressDetails; final String addressDetails;
factory CommunityModel.fromJson(Map<String, dynamic> json) => factory CommunityModel.fromJson(Map<String, dynamic> json) {
_$CommunityModelFromJson(json); return _$CommunityModelFromJson(json);
}
const CommunityModel({ const CommunityModel({
required this.id, required this.id,

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save