import 'package:fis_ui/index.dart';
import 'package:flutter/material.dart';
import 'package:flyinsono/lab/color/lab_colors.dart';

enum PatternValueType {
  size,
  unit,
  cursor,
}

class PatternBodyItem extends FStatelessWidget {
  final String patternBodyItemTitle;
  final FWidget patternBodyItem;
  final bool? isEnd;
  const PatternBodyItem({
    Key? key,
    required this.patternBodyItemTitle,
    required this.patternBodyItem,
    this.isEnd = false,
  }) : super(key: key);
  @override
  FWidget build(BuildContext context) {
    return FColumn(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        FText(
          patternBodyItemTitle,
          style: const TextStyle(
            fontWeight: FontWeight.bold,
            color: LabColors.text600,
          ),
        ),
        const FSizedBox(
          height: 8,
        ),
        patternBodyItem,
        if (!isEnd!)
          FContainer(
            decoration: const BoxDecoration(
              border: Border(
                bottom: BorderSide(
                  color: Color.fromRGBO(235, 235, 235, 1),
                  width: 1,
                ),
              ),
            ),
          ),
        const FSizedBox(
          height: 16,
        ),
      ],
    );
  }
}

class PatternItem extends FStatelessWidget {
  final String title;
  final FWidget item;
  const PatternItem({required this.title, required this.item, Key? key})
      : super(key: key);
  @override
  FWidget build(BuildContext context) {
    return FContainer(
      margin: const EdgeInsets.only(bottom: 8),
      child: FRow(
        children: [
          FContainer(
            width: 200,
            child: FText(
              title,
              style: TextStyle(
                color: LabColors.text600,
              ),
            ),
          ),
          FExpanded(
            child: FContainer(
              alignment: Alignment.centerLeft,
              child: item,
            ),
          ),
          const FSizedBox(
            width: 20,
          ),
        ],
      ),
    );
  }
}
