import 'package:flutter/material.dart';
import '../../../../../customWidget/ItemWidgetFactory.dart';
import '../../../../../customWidget/single_image_viewer.dart';
import '../../../../../tools/tools.dart';

class DannerRepairFinish extends StatefulWidget {
  const DannerRepairFinish({super.key});

  @override
  State<DannerRepairFinish> createState() => _DannerRepairFinishState();
}

class _DannerRepairFinishState extends State<DannerRepairFinish> {
  final List<String> imgUrls = [
    "https://pic.rmb.bdstatic.com/bjh/news/100b8b78cbd136ede03249d9f3b3f5c42221.jpeg",
    "https://pic.rmb.bdstatic.com/bjh/news/100b8b78cbd136ede03249d9f3b3f5c42221.jpeg",
  ];

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.symmetric(vertical: 0),
      child: DecoratedBox(
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(5),
        ),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            // 标题
            ListItemFactory.createBuildSimpleSection("整改信息"),
            const Divider(height: 1),

            // 修复信息 summary 区域
            Padding(
              padding: const EdgeInsets.symmetric(horizontal: 12,),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  ListItemFactory.createColumnTextItem(
                    topText: "整改描述",
                    bottomText: "这是一段整改描述",
                  ),
                  // const SizedBox(height: 10),
                  ListItemFactory.createRowSpaceBetweenItem(
                    leftText: "整改部门",
                    rightText: "部门",
                  ),
                  const Divider(height: 10),
                  ListItemFactory.createRowSpaceBetweenItem(
                    leftText: "整改人",
                    rightText: "韩双",
                  ),
                  const Divider(height: 10),
                  ListItemFactory.createRowSpaceBetweenItem(
                    leftText: "整改时间",
                    rightText: "2020-01-01",
                  ),
                  ListItemFactory.createTextImageItem(
                    text: "整改后图片",
                    imageUrls: imgUrls,
                    onImageTapped: (index) {
                      present(
                        SingleImageViewer(imageUrl: imgUrls[index]),
                        context,
                      );
                    },
                  ),
                  ListItemFactory.createRowSpaceBetweenItem(
                    leftText: "整改方案",
                    rightText: "无",
                  ),
                  Divider(height: 10,),
                  ListItemFactory.createRowSpaceBetweenItem(
                    leftText: "整改计划",
                    rightText: "无",
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}

