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

28 lines
609 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;
2021-12-01 23:09:53 +01:00
const Badge({this.child, required this.color, Key? key,}) : 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: Center(
child: child,
),
2021-04-11 01:48:43 +02:00
),
); }
2021-12-01 23:09:53 +01:00
}