import 'package:fis_ui/index.dart';
import 'package:flutter/material.dart';
import 'package:flyinsono/views/desktop/laboratory/controller.dart';
import 'package:get/get.dart';

class ReportAnalysis extends FStatefulWidget {
  const ReportAnalysis({super.key});

  @override
  FState<ReportAnalysis> createState() => _ReportAnalysisState();
}

class _ReportAnalysisState extends FState<ReportAnalysis> {
  final controller = Get.find<LaboratoryController>();

  @override
  void initState() {
    super.initState();
  }

  @override
  FWidget build(BuildContext context) {
    return FContainer(
      padding: EdgeInsets.all(
        5,
      ),
      child: _buildReportAnalysisList(),
    );
  }

  FWidget _buildReportAnalysisItem() {
    return FContainer(
      margin: EdgeInsets.all(10),
      height: 150,
      decoration: BoxDecoration(
        border: Border.all(
          color: Colors.black,
        ),
      ),
      child: FRow(
        children: [
          FContainer(
            width: 100,
            margin: EdgeInsets.all(15),
            alignment: Alignment.center,
            decoration: BoxDecoration(
              border: Border.all(
                color: Colors.black,
              ),
            ),
            child: FText('报告预览图'),
          ),
          FExpanded(
            child: FContainer(
              margin: EdgeInsets.symmetric(vertical: 15),
              child: FColumn(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  FText('病例综合分析报告'),
                  FText.rich(
                    TextSpan(
                      children: [
                        TextSpan(text: 'AI诊断：'),
                        TextSpan(text: '肝脏'),
                      ],
                    ),
                  ),
                  FText.rich(
                    TextSpan(
                      children: [
                        TextSpan(text: '报告时间：'),
                        TextSpan(text: '2023-02-24 17：00'),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          )
        ],
      ),
    );
  }

  FWidget _buildReportAnalysisList() {
    return FListView(
      children: ['1', '2'].map((e) => _buildReportAnalysisItem()).toList(),
    );
  }
}
