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.
50 lines
1.6 KiB
50 lines
1.6 KiB
3 years ago
|
import 'package:aku_new_community/constants/api.dart';
|
||
|
import 'package:aku_new_community/models/task/hall_list_model.dart';
|
||
|
import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||
|
import 'package:velocity_x/src/extensions/num_ext.dart';
|
||
|
|
||
|
import 'hall_card.dart';
|
||
|
|
||
|
class HallView extends StatefulWidget {
|
||
|
const HallView({Key? key}) : super(key: key);
|
||
|
|
||
|
@override
|
||
|
_HallViewState createState() => _HallViewState();
|
||
|
}
|
||
|
|
||
|
class _HallViewState extends State<HallView> {
|
||
|
EasyRefreshController _refreshController = EasyRefreshController();
|
||
|
|
||
|
@override
|
||
|
void dispose() {
|
||
|
_refreshController.dispose();
|
||
|
super.dispose();
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return BeeListView(
|
||
|
path: API.manager.task.hallList,
|
||
|
controller: _refreshController,
|
||
|
extraParams: {},
|
||
|
convert: (json) =>
|
||
|
json.tableList!.map((e) => HallListModel.fromJson(e)).toList(),
|
||
|
builder: (models) {
|
||
|
return ListView.separated(
|
||
|
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
|
||
|
itemBuilder: (context, index) {
|
||
|
return HallCard(
|
||
|
model: models[index],
|
||
|
refresh: () => _refreshController.callRefresh());
|
||
|
},
|
||
|
separatorBuilder: (_, __) {
|
||
|
return 24.w.heightBox;
|
||
|
},
|
||
|
itemCount: models.length);
|
||
|
});
|
||
|
}
|
||
|
}
|