mirror of
https://github.com/krawieck/lemmur/
synced 2024-12-13 00:56:13 +01:00
30 lines
687 B
Dart
30 lines
687 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// A badge with accent color as background
|
|
class Badge extends StatelessWidget {
|
|
final Widget child;
|
|
final BorderRadiusGeometry borderRadius;
|
|
|
|
const Badge({
|
|
@required this.child,
|
|
this.borderRadius = const BorderRadius.all(Radius.circular(10)),
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
|
|
return Container(
|
|
height: 25,
|
|
decoration: BoxDecoration(
|
|
color: theme.accentColor,
|
|
borderRadius: borderRadius,
|
|
),
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
|
child: child,
|
|
),
|
|
);
|
|
}
|
|
}
|