Jisho-Study-Tool/lib/components/search/search_results_body/parts/circle_badge.dart

28 lines
584 B
Dart
Raw Normal View History

2021-04-11 01:48:43 +02:00
import 'package:flutter/material.dart';
2024-11-13 22:43:44 +01:00
class CircleBadge extends StatelessWidget {
2021-12-01 23:09:53 +01:00
final Widget? child;
2021-04-11 01:48:43 +02:00
final Color color;
2024-11-13 22:43:44 +01:00
const CircleBadge({
Key? key,
this.child,
required this.color,
}) : super(key: key);
2021-04-11 01:48:43 +02:00
@override
Widget build(BuildContext context) {
return Container(
2021-12-01 23:09:53 +01:00
padding: const EdgeInsets.all(5),
2021-04-11 01:48:43 +02:00
width: 30,
height: 30,
2021-12-01 23:09:53 +01:00
margin: const EdgeInsets.symmetric(horizontal: 2),
2021-04-11 01:48:43 +02:00
decoration: BoxDecoration(
shape: BoxShape.circle,
2021-12-01 23:09:53 +01:00
color: color,
),
child: FittedBox(child: child),
);
}
2021-12-01 23:09:53 +01:00
}