/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2021-11-09 09:53:10
 * @LastEditTime : 2021-11-09 10:53:16
 * @Description  : Do not edit
 */
part of '../index.dart';

class _BuildPreList extends StatelessWidget {
  const _BuildPreList({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final store = Provider.of<PrivateIndexStore>(context, listen: true);
    final list = store.paylist1;

    /// 预存款缴费
    return WisScrollView(
      key: store.indexScorllViewKey1,
      onRefresh: () => store.getPreList(isLoad: false),
      onInit: () => store.getPreList(isLoad: false),
      onLoad: () => store.getPreList(isLoad: true),
      slivers: <Widget>[
        WisSliverList.childBuilder(
            childCount: list.length,
            builder: (_, i) {
              var item = list[i];
              return ListItem(
                toDetail: () => store.routeToDetail(item),
                item: item,
                isLast: i == (store.paylist1.length - 1) ? true : false,
              );
            }),
      ],
    );
  }
}
