12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import 'package:flutter/material.dart';
- class TagWidget extends StatelessWidget {
- final String label;
- final Color borderColor;
- final Color textColor;
- final Color backgroundColor;
- final EdgeInsets padding;
- final EdgeInsets margin;
- final double? width;
- final double? height;
- const TagWidget({
- Key? key,
- required this.label,
- this.borderColor = Colors.blue,
- this.textColor = Colors.white,
- this.backgroundColor = Colors.blue,
- this.padding = const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
- this.margin = const EdgeInsets.only(right: 8.0),
- this.width,
- this.height,
- }) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return Container(
- decoration: BoxDecoration(
- color: backgroundColor,
- border: Border.all(color: borderColor),
- borderRadius: BorderRadius.only(
- topLeft: Radius.circular(4),
- bottomLeft: Radius.circular(4),
- topRight: Radius.circular(88),
- bottomRight: Radius.circular(88),
- ),
- ),
- width: width,
- height: height,
- margin: margin,
- child: Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- Padding(
- padding: padding,
- child: Text(
- label,
- style: TextStyle(color: textColor),
- ),
- ),
- ],
- ),
- );
- }
- }
|