import 'package:flutter/material.dart';

/// 状态标签
class StatusLabel extends StatelessWidget {
  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(15.0),
    bottomLeft: Radius.circular(15.0),
  );

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 30,
      padding: const EdgeInsets.only(
        left: 14,
        right: 10,
      ),
      decoration: BoxDecoration(
        borderRadius: borderRadius,
        color: color ?? Colors.amberAccent,
      ),
      child: Center(
        widthFactor: 1,
        child: Text(
          title!,
          style: const TextStyle(
            height: 1,
            fontSize: 16,
            color: Colors.white,
            // fontFamily: FTheme.ins.localeSetting.fontFamily,
          ),
        ),
      ),
    );
  }
}
