/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2023-05-09 16:13:30
 * @LastEditTime : 2023-05-10 17:47:19
 * @Description  : Do not edit
 */
part of '../index.dart';

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

  @override
  Widget build(BuildContext context) {
    final store = Provider.of<PrivateSecurityDetailStore>(context);
    final style = WTheme.of(context);
    final colorScheme = style.colorScheme;
    final theme = Theme.of(context);
    final textTheme = theme.textTheme;
    final data = store.data;
    if (data == null) {
      return SliverToBoxAdapter();
    }
    final vos = data.securityPatrolsRecordSnapshotVos!;
    return WisCard(
      isSliver: true,
      margin: EdgeInsets.fromLTRB(15.pt, 15.pt, 15.pt, 0),
      padding: EdgeInsets.symmetric(horizontal: 15.pt),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: <Widget>[
          Text(
            '巡逻清单',
            style: textTheme.titleMedium!.copyWith(
              fontWeight: FontWeight.bold,
            ),
          ).asPaddingSymmetric(vertical: 15.pt),
          ...ListTile.divideTiles(
            context: context,
            tiles: [
              for (var item in vos)
                ListTile(
                  leading: Icon(
                    item.complete == true
                        ? Icons.check_box
                        : Icons.check_box_outline_blank,
                    color: item.complete == true ? colorScheme.primary : null,
                  ),
                  dense: true,
                  contentPadding: EdgeInsets.zero,
                  title: Text(item.item ?? ''),
                ),
            ],
          ).toList(),
        ],
      ),
    );
  }
}
