Jisho-Study-Tool/lib/components/search/search_results_body/parts/common_badge.dart

25 lines
503 B
Dart
Raw Normal View History

2021-04-11 01:48:43 +02:00
import 'package:flutter/material.dart';
import './badge.dart';
2021-04-11 01:48:43 +02:00
class CommonBadge extends StatelessWidget {
final bool isCommon;
2021-04-11 01:48:43 +02:00
2021-12-01 23:09:53 +01:00
const CommonBadge({
required this.isCommon,
Key? key,
}) : super(key: key);
2021-04-11 01:48:43 +02:00
@override
Widget build(BuildContext context) {
return Badge(
2021-12-01 23:09:53 +01:00
color: isCommon ? Colors.green : Colors.transparent,
child: Text(
'C',
style: TextStyle(
color: isCommon ? Colors.white : Colors.transparent,
),
2021-04-11 01:48:43 +02:00
),
);
}
2021-12-01 23:09:53 +01:00
}