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

28 lines
572 B
Dart
Raw Normal View History

2021-04-11 01:48:43 +02:00
import 'package:flutter/material.dart';
class Badge extends StatelessWidget {
2021-12-01 23:09:53 +01:00
final Widget? child;
2021-04-11 01:48:43 +02:00
final Color color;
const Badge({
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
}