71 lines
1.9 KiB
Dart
71 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hoshan/ui/theme/text.dart';
|
|
|
|
class Indicator extends StatelessWidget {
|
|
const Indicator({
|
|
super.key,
|
|
required this.color,
|
|
required this.text,
|
|
required this.count,
|
|
required this.isSquare,
|
|
this.size = 16,
|
|
this.textColor,
|
|
});
|
|
final Color color;
|
|
final String text;
|
|
final String count;
|
|
final bool isSquare;
|
|
final double size;
|
|
final Color? textColor;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
child: Row(
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: size,
|
|
height: size,
|
|
decoration: BoxDecoration(
|
|
shape: isSquare ? BoxShape.rectangle : BoxShape.circle,
|
|
color: color,
|
|
),
|
|
),
|
|
const SizedBox(
|
|
width: 4,
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 4.0),
|
|
child: Text(
|
|
text,
|
|
style: AppTextStyles.body4.copyWith(
|
|
fontWeight: FontWeight.bold,
|
|
color: Theme.of(context).colorScheme.onSurface),
|
|
textDirection: TextDirection.rtl,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
const Expanded(
|
|
child: Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 16.0),
|
|
child: Opacity(opacity: 0.5, child: Divider()),
|
|
)),
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 4.0),
|
|
child: Text(
|
|
count,
|
|
style: AppTextStyles.body4
|
|
.copyWith(color: Theme.of(context).colorScheme.onSurface),
|
|
textDirection: TextDirection.rtl,
|
|
),
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|