lemmur-app-android/lib/widgets/badge.dart

29 lines
634 B
Dart
Raw Normal View History

2020-09-01 21:59:00 +02:00
import 'package:flutter/material.dart';
class Badge extends StatelessWidget {
final Widget child;
final BorderRadiusGeometry borderRadius;
2020-09-01 21:59:00 +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) {
var theme = Theme.of(context);
return Container(
height: 25,
decoration: BoxDecoration(
color: theme.accentColor,
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,
),
);
}
}