import 'package:fis_ui/index.dart';
import 'package:fis_theme/theme.dart';
import 'package:flutter/material.dart';

/// 状态标签
class StatusLabel extends FStatelessWidget {
  const StatusLabel({Key? key, this.title, this.color}) : super(key: key);

  /// 状态名称
  final String? title;

  /// 状态颜色
  final Color? color;

  /// 状态外边框
  final BorderRadius? borderRadius = const BorderRadius.only(
    topLeft: Radius.circular(12.0),
    bottomLeft: Radius.circular(12.0),
  );

  @override
  FWidget build(BuildContext context) {
    return FContainer(
      height: 24,
      padding: EdgeInsets.only(
        left: 14,
        right: 10,
      ),
      decoration: BoxDecoration(
        borderRadius: borderRadius,
        color: color ?? Colors.amberAccent,
      ),
      child: FCenter(
        widthFactor: 1,
        child: FText(
          title!,
          style: TextStyle(
            height: 1,
            fontSize: 16,
            color: Colors.white,
            fontFamily: FTheme.ins.localeSetting.fontFamily,
          ),
        ),
      ),
    );
  }
}
