2024-09-06 06:30:31 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class Indicator extends StatelessWidget {
|
|
|
|
const Indicator({
|
|
|
|
super.key,
|
|
|
|
required this.color,
|
|
|
|
required this.text,
|
|
|
|
required this.isSquare,
|
|
|
|
this.size = 16,
|
|
|
|
this.textColor,
|
|
|
|
});
|
|
|
|
final Color color;
|
|
|
|
final String text;
|
|
|
|
final bool isSquare;
|
|
|
|
final double size;
|
|
|
|
final Color? textColor;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Row(
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
width: size,
|
|
|
|
height: size,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
shape: isSquare ? BoxShape.rectangle : BoxShape.circle,
|
|
|
|
color: color,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
width: 4,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
text,
|
2024-10-07 12:45:45 +00:00
|
|
|
maxLines: 3,
|
2024-09-06 06:30:31 +00:00
|
|
|
style: TextStyle(
|
2024-10-07 12:45:45 +00:00
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: textColor,
|
|
|
|
overflow: TextOverflow.clip),
|
2024-09-06 06:30:31 +00:00
|
|
|
)
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|