/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2021-03-04 16:06:21
 * @LastEditTime : 2023-05-10 15:46:38
 * @FilePath     : /wisdom-huiguanjia-app/oa_package/lib/src/pages/index/components/grid.dart
 * @Description  : Do not edit
 */
part of '../view.dart';

///审批菜单
class _GridComponent extends StatelessWidget {
  const _GridComponent({Key? key, this.list}) : super(key: key);
  final List? list;
  @override
  Widget build(BuildContext context) {
    final store = Provider.of<IndexStore>(context);
    return Observer(builder: (context) {
      return WisSliverList.childBuilder(
        childCount: list!.length,
        builder: (_, i) {
          final item = store.oaMenuList[i];
          return WisCard(
            margin: EdgeInsets.fromLTRB(15.pt, 0, 15.pt, 15.pt),
            child: Wisdom.column(
              // margin: EdgeInsets.only(top: 15.pt),
              color: Colors.white,
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: [
                Text(
                  item.groupName!,
                  style: TextStyle(
                    height: 1,
                    fontSize: 15.pt,
                    fontWeight: FontWeight.w600,
                  ),
                ).asPaddingAll(15.pt),
                Wrap(
                  runAlignment: WrapAlignment.spaceAround,
                  children: [
                    for (var index = 0; index < item.oaMenus!.length; index++)
                      Wisdom.column(
                        onTap: () => store.toProcess(item, index),
                        width: 93.75.pt,
                        margin: EdgeInsets.only(bottom: 20.pt),
                        children: [
                          WImage.network(
                            AppParseUtil.image('${item.oaMenus![index].ico}'),
                            width: 44.pt,
                            height: 44.pt,
                          ),
                          SizedBox(height: 8.pt),
                          WisText(
                            '${item.oaMenus![index].processName}',
                            size: 12.pt,
                          ),
                        ],
                      ),
                  ],
                ),
              ],
            ),
          );
        },
      );
    });
  }
}
