/*
 * @Author       : WuWei
 * @LastEditors: wjc
 * @Date         : 2022-10-13 15:08:13
 * @LastEditTime: 2023-04-03 11:48:47
 * @Description  : Do not edit
 */
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:statistics_package/src/pages/index/components/table.dart';
import 'package:statistics_package/src/view_models/index_store.dart';
import 'package:wisdom_cli/wisdom_cli.dart';

///
///
///
///
///
//***以下为模板代码谨慎修改***
class DocPage extends StatelessWidget {
  const DocPage({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    final StatisticsIndexStore _store = Get.find<StatisticsIndexStore>();
    final colorScheme = WTheme.of(context).colorScheme;
    return WisScrollView(
      slivers: [
        SliverToBoxAdapter(
          child: WisCard(
            margin: EdgeInsets.symmetric(vertical: 10.pt, horizontal: 15.pt),
            color: Colors.white,
            padding: EdgeInsets.all(5.pt),
            child: Wisdom.column(
              color: Colors.white,
              children: [
                WisExpansionTile(
                  onExpansionChanged: (flag) => {
                    if (flag)
                      {
                        _store.getFacilityList(),
                      }
                  },
                  initiallyExpanded: false,
                  title: Wisdom.row(
                    height: 53.5.pt,
                    children: [
                      Wisdom(
                        borderRadius: BorderRadius.circular(4.pt),
                        width: 3.pt,
                        height: 15.pt,
                        color: colorScheme.primary,
                      ),
                      SizedBox(width: 5.pt),
                      WisText(
                        '设备设施',
                        size: 14.pt,
                        weight: FontWeight.w600,
                        color: colorScheme.mainTitle,
                      ),
                    ],
                  ),
                  children: [
                    Obx(
                      () => _store.facilityList.length > 0 ? TableView(
                        headers: ['名称', '数目'],
                        content: _store.facilityList,
                      ) : Container(),
                    ),
                  ],
                ),
                WisExpansionTile(
                  onExpansionChanged: (flag) => {
                    if (flag)
                      {
                        _store.getPowerList(),
                      }
                  },
                  initiallyExpanded: false,
                  title: Wisdom.row(
                    height: 53.5.pt,
                    children: [
                      Wisdom(
                        borderRadius: BorderRadius.circular(4.pt),
                        width: 3.pt,
                        height: 15.pt,
                        color: colorScheme.primary,
                      ),
                      SizedBox(width: 5.pt),
                      WisText(
                        '供电设施',
                        size: 14.pt,
                        weight: FontWeight.w600,
                        color: colorScheme.mainTitle,
                      ),
                    ],
                  ),
                  children: [
                    Obx(
                      () => _store.powerList.length > 0 ? TableView(
                        headers: ['名称', '数目'],
                        content: _store.powerList,
                      ) : Container(),
                    ),
                  ],
                ),
                WisExpansionTile(
                  onExpansionChanged: (flag) => {
                    if (flag)
                      {
                        _store.getGreenList(),
                      }
                  },
                  initiallyExpanded: false,
                  title: Wisdom.row(
                    height: 53.5.pt,
                    children: [
                      Wisdom(
                        borderRadius: BorderRadius.circular(4.pt),
                        width: 3.pt,
                        height: 15.pt,
                        color: colorScheme.primary,
                      ),
                      SizedBox(width: 5.pt),
                      WisText(
                        '绿化情况',
                        size: 14.pt,
                        weight: FontWeight.w600,
                        color: colorScheme.mainTitle,
                      ),
                    ],
                  ),
                  children: [
                    Obx(
                      () => _store.greenList.length > 0 ? TableView(
                        headers: ['名称', '数目'],
                        content: _store.greenList,
                      ) : Container(),
                    ),
                  ],
                ),
                WisExpansionTile(
                  initiallyExpanded: false,
                  onExpansionChanged: (flag) => {
                    if (flag)
                      {
                        _store.getHealthList(),
                      }
                  },
                  title: Wisdom.row(
                    height: 53.5.pt,
                    children: [
                      Wisdom(
                        borderRadius: BorderRadius.circular(4.pt),
                        width: 3.pt,
                        height: 15.pt,
                        color: colorScheme.primary,
                      ),
                      SizedBox(width: 5.pt),
                      WisText(
                        '卫生设施',
                        size: 14.pt,
                        weight: FontWeight.w600,
                        color: colorScheme.mainTitle,
                      ),
                    ],
                  ),
                  children: [
                    Obx(
                      () => _store.healthList.length > 0 ? TableView(
                        headers: ['名称', '数目'],
                        content: _store.healthList,
                      ) : Container(),
                    ),
                  ],
                ),
                WisExpansionTile(
                  initiallyExpanded: false,
                  onExpansionChanged: (flag) => {
                    if (flag)
                      {
                        _store.getSecurityList(),
                      }
                  },
                  title: Wisdom.row(
                    height: 53.5.pt,
                    children: [
                      Wisdom(
                        borderRadius: BorderRadius.circular(4.pt),
                        width: 3.pt,
                        height: 15.pt,
                        color: colorScheme.primary,
                      ),
                      SizedBox(width: 5.pt),
                      WisText(
                        '安防设施',
                        size: 14.pt,
                        weight: FontWeight.w600,
                        color: colorScheme.mainTitle,
                      ),
                    ],
                  ),
                  children: [
                    Obx(() => 
                      _store.securityList.length > 0 ? TableView(
                        headers: ['名称', '数目'],
                        content: _store.securityList,
                      ) : Container(),
                    )
                  ],
                ),
                WisExpansionTile(
                  initiallyExpanded: false,
                  onExpansionChanged: (flag) => {
                    if (flag)
                      {
                        _store.getFireList(),
                      }
                  },
                  title: Wisdom.row(
                    height: 53.5.pt,
                    children: [
                      Wisdom(
                        borderRadius: BorderRadius.circular(4.pt),
                        width: 3.pt,
                        height: 15.pt,
                        color: colorScheme.primary,
                      ),
                      SizedBox(width: 5.pt),
                      WisText(
                        '消防设施',
                        size: 14.pt,
                        weight: FontWeight.w600,
                        color: colorScheme.mainTitle,
                      ),
                    ],
                  ),
                  children: [
                    Obx(
                      () => _store.fireList.length > 0 ? TableView(
                        headers: ['名称', '数目'],
                        content: _store.fireList,
                      ) : Container(),
                    ),
                  ],
                ),
                WisExpansionTile(
                  initiallyExpanded: false,
                  onExpansionChanged: (flag) => {
                    if (flag)
                      {
                        _store.getAssistList(),
                      }
                  },
                  title: Wisdom.row(
                    height: 53.5.pt,
                    children: [
                      Wisdom(
                        borderRadius: BorderRadius.circular(4.pt),
                        width: 3.pt,
                        height: 15.pt,
                        color: colorScheme.primary,
                      ),
                      SizedBox(width: 5.pt),
                      WisText(
                        '资产档案',
                        size: 14.pt,
                        weight: FontWeight.w600,
                        color: colorScheme.mainTitle,
                      ),
                    ],
                  ),
                  children: [
                    Obx(
                      () => _store.assistList.length > 0 ? TableView(
                        headers: ['名称', '数目'],
                        content: _store.assistList,
                      ) :  Container(),
                    ),
                  ],
                ),
              ],
            ),
          ),
        ),
      ],
    );
  }
}
