mirror of
https://github.com/h7x4/Jisho-Study-Tool.git
synced 2025-01-08 04:37:29 +01:00
28 lines
609 B
Dart
28 lines
609 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class Badge extends StatelessWidget {
|
|
final Widget? child;
|
|
final Color color;
|
|
|
|
const Badge({this.child, required this.color, Key? key,}) : super(key: key);
|
|
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
padding: const EdgeInsets.all(5),
|
|
width: 30,
|
|
height: 30,
|
|
margin: const EdgeInsets.symmetric(horizontal: 2),
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: color,
|
|
),
|
|
child: FittedBox(
|
|
child: Center(
|
|
child: child,
|
|
),
|
|
),
|
|
); }
|
|
}
|