/*
 * @Author       : WuWei
 * @LastEditors: wjc
 * @Date         : 2021-05-12 15:42:17
 * @LastEditTime: 2022-12-13 17:30:49
 * @FilePath     : /wisdom-huiguanjia-app/task_package/lib/src/pages/edit/components/list.dart
 * @Description  : 任务添加、编辑-选择任务类型
 */
part of '../index.dart';

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

  @override
  Widget build(BuildContext context) {
    final store = Provider.of<EditStore>(context, listen: false);
    final style = WTheme.of(context);
    final colorScheme = style.colorScheme;
    return SliverToBoxAdapter(
      child: Wisdom(
          padding: EdgeInsets.symmetric(horizontal: 15.pt, vertical: 15.pt),
          margin: EdgeInsets.only(bottom: 10.pt),
          borderRadius: BorderRadius.circular(10.pt),
          color: Colors.white,
          boxShadow: [
            BoxShadow(
              offset: Offset(0, 2.pt),
              color: Color(0x08000000),
              blurRadius: 10.pt,
              spreadRadius: 2.5.pt,
            ),
          ],
          child: Column(
            children: <Widget>[
              Observer(builder: (context) {
                return WFSinglePicker(
                  title: Wisdom.row(
                     mainAxisSize: MainAxisSize.min,
                        mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Image(
                        image: AssetList.$renwuleixing_png_image,
                        height: 22.pt,
                      ),
                      SizedBox(width: 10.pt),
                      WisText(
                        '任务类型',
                        color: colorScheme.mainTitle,
                        size: 15.pt,
                      ),
                    ],
                  ),
                  label: 'name',
                  value: 'id',
                  isRequired: false,
                  hintText: '请选择任务类型（必选）',
                  initialValue: store.inventoryId,
                  dataList: store.taskItemList,
                  onChanged: (v) => store.onSelectListItem(v),
                );
              }),
            ],
          )),
    );
  }
}
