Add option to change Badge border radius

This commit is contained in:
krawieck 2020-09-05 18:16:16 +02:00
parent 88d796def7
commit de625de379
1 changed files with 6 additions and 2 deletions

View File

@ -2,8 +2,12 @@ import 'package:flutter/material.dart';
class Badge extends StatelessWidget { class Badge extends StatelessWidget {
final Widget child; final Widget child;
final BorderRadiusGeometry borderRadius;
Badge({@required this.child}); Badge({
@required this.child,
this.borderRadius = const BorderRadius.all(Radius.circular(5)),
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -13,7 +17,7 @@ class Badge extends StatelessWidget {
height: 25, height: 25,
decoration: BoxDecoration( decoration: BoxDecoration(
color: theme.accentColor, color: theme.accentColor,
borderRadius: BorderRadius.all(Radius.circular(5)), borderRadius: borderRadius,
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8), padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),