You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aku_new_community/lib/ui/community/facility/pick_facility_page.dart

49 lines
1.6 KiB

3 years ago
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/models/facility/facility_type_model.dart';
import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_new_community/ui/community/facility/facility_type_card.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
3 years ago
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
class PickFacilityPage extends StatefulWidget {
4 years ago
PickFacilityPage({Key? key}) : super(key: key);
@override
_PickFacilityPageState createState() => _PickFacilityPageState();
}
class _PickFacilityPageState extends State<PickFacilityPage> {
final EasyRefreshController _refreshController = EasyRefreshController();
3 years ago
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '选择设施',
body: BeeListView<FacilityTypeModel>(
path: API.manager.facility.type,
controller: _refreshController,
convert: (model) =>
3 years ago
model.rows.map((e) => FacilityTypeModel.fromJson(e)).toList(),
builder: (items) {
return ListView.separated(
padding: EdgeInsets.all(32.w),
itemBuilder: (context, index) {
return FacilityTypeCard(model: items[index]);
},
separatorBuilder: (context, index) => 32.hb,
itemCount: items.length,
);
},
),
);
}
}