import 'package:fis_ui/index.dart';
import 'package:flutter/cupertino.dart';

///用户标签
class UserLabelItem extends FStatelessWidget {
  const UserLabelItem({
    Key? key,
    required this.label,
    required this.child,
    this.isCenterLabel,
  }) : super(key: key);

  final String label;
  final FWidget child;
  final bool? isCenterLabel;

  @override
  FWidget build(BuildContext context) {
    return FContainer(
      padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
      child: FRow(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          FFlexible(
            child: FContainer(
              width: 110,
              height: (isCenterLabel != null && isCenterLabel!) ? 44 : null,
              alignment: Alignment.centerLeft,
              child: FText(
                label,
                style: TextStyle(
                  fontSize: 16,
                  color: Color(0xFF2A2A2A),
                ),
              ),
            ),
            flex: 0,
          ),
          FFlexible(
            flex: 1,
            child: FContainer(
              width: 400,
              alignment: Alignment.centerLeft,
              child: child,
            ),
          ),
        ],
      ),
    );
  }
}
