/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2023-05-25 15:00:20
 * @LastEditTime : 2023-06-13 17:02:36
 * @Description  : Do not edit
 */

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:wisdom_cli/wisdom_cli.dart';

class FormItemComponent extends StatelessWidget {
  const FormItemComponent({
    Key? key,
    this.leadingText = '',
    this.must = false,
    required this.child,
  }) : super(key: key);
  final String leadingText;
  final bool must;
  final Widget? child;
  @override
  Widget build(BuildContext context) {
    return Wisdom.row(
      padding: EdgeInsets.only(bottom: 10.pt),
      children: [
        Wisdom.rich(
          width: 85.pt,
          children: [
            if (must)
              TextSpan(
                text: '*',
                style: TextStyle(color: Color(0XFFFF495E)),
              ),
            TextSpan(
              text: leadingText,
              style: TextStyle(fontSize: 15.pt),
            ),
          ],
        ),
        if (child != null) child!.asExpanded()
      ],
    );
  }
}
