import 'package:fis_i18n/i18n.dart';
import 'package:fis_ui/index.dart';
import 'package:flutter/material.dart';
import 'package:flyinsono/architecture/define.dart';
import 'package:get/get.dart';

///选中设置对话框
class FAgreeDialog extends FStatelessWidget {
  const FAgreeDialog({
    Key? key,
    required this.name,
  }) : super(key: key);
  final String name;

  @override
  FWidget build(BuildContext context) {
    return FSimpleDialog(
      title: FText(
        i18nBook.realTimeConsultation.confirmApplication.t,
        style: TextStyle(
          color: Colors.white,
          fontSize: 18,
        ),
      ),
      okString: i18nBook.common.confirm.t,
      cancelString: i18nBook.common.cancel.t,
      isDefault: true,
      onOk: () {
        Get.back();
      },
      onCancel: () {
        Get.back();
      },
      children: [
        _AgreeConsultation(),
      ],
    );
  }
}

class _AgreeConsultation extends FStatelessWidget {
  final ScrollController _scrollController = ScrollController();
  @override
  FWidget build(BuildContext context) {
    return FContainer(
      width: 700,
      height: 500,
      padding: const EdgeInsets.symmetric(horizontal: 15),
      child: FAlwaysScrollListView(
        scrollController: _scrollController,
        child: QuickFWidget(ScrollConfiguration(
          behavior: ScrollConfiguration.of(context).copyWith(scrollbars: false),
          child: FListView(
            controller: _scrollController,
            shrinkWrap: true,
            children: [
              _buildRowValue(
                i18nBook.remedical.time.t,
                const FText('11111'),
              ),
            ],
          ),
        )),
      ),
    );
  }

  FWidget _buildRowValue(String title, FWidget value) {
    return FContainer(
      margin: const EdgeInsets.all(15),
      child: FRow(
        children: [
          FContainer(
            width: 100,
            child: FText(
              title,
              style: const TextStyle(
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
          FExpanded(
            child: value,
          ),
        ],
      ),
    );
  }
}
