2020-09-01 21:59:00 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class Badge extends StatelessWidget {
|
|
|
|
final Widget child;
|
2020-09-05 18:16:16 +02:00
|
|
|
final BorderRadiusGeometry borderRadius;
|
2020-09-01 21:59:00 +02:00
|
|
|
|
2020-09-05 18:16:16 +02:00
|
|
|
Badge({
|
|
|
|
@required this.child,
|
|
|
|
this.borderRadius = const BorderRadius.all(Radius.circular(5)),
|
|
|
|
});
|
2020-09-01 21:59:00 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2020-09-16 23:22:04 +02:00
|
|
|
final theme = Theme.of(context);
|
2020-09-01 21:59:00 +02:00
|
|
|
|
|
|
|
return Container(
|
|
|
|
height: 25,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: theme.accentColor,
|
2020-09-05 18:16:16 +02:00
|
|
|
borderRadius: borderRadius,
|
2020-09-01 21:59:00 +02:00
|
|
|
),
|
|
|
|
child: Padding(
|
2020-09-03 22:14:07 +02:00
|
|
|
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
2020-09-01 21:59:00 +02:00
|
|
|
child: child,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|