/*
 * @Author       : WuWei
 * @LastEditors: ChenYaJin
 * @Date         : 2021-11-09 09:52:52
 * @LastEditTime: 2023-11-02 17:38:59
 * @Description  : Do not edit
 */
part of '../index.dart';

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

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

    /// 账单缴费
    return Column(
      children: [
        WSearch(
          hintText: '请输入资产名称搜索',
          onSubmitted: (value) => store.toBillSearchList(value),
          onCancel: () => store.toBillSearchList(''),
          moonlight: false,
          padding:
              EdgeInsets.only(top: 10.pt, bottom: list.length > 0 ? 0 : 10.pt),
          isDark: false,
          initValue: store.billSearchWord,
        ),
        WisScrollView(
          key: store.indexScrollViewKey0,
          onRefresh: () => store.getList(isLoad: false),
          onInit: () => store.getList(isLoad: false),
          onLoad: () => store.getList(isLoad: true),
          slivers: <Widget>[
            WisSliverList.childBuilder(
              childCount: list.length,
              interval: 0,
              builder: (_, i) {
                var item = list[i];
                return ListItem(
                  toDetail: () => store.routeToDetail(item),
                  item: item,
                  isLast: i == (list.length - 1) ? true : false,
                );
              },
            ),
          ],
        ).asExpanded(),
      ],
    );
  }
}
