1
0
mirror of https://github.com/h7x4/Jisho-Study-Tool.git synced 2024-12-22 22:07:29 +01:00
Jisho-Study-Tool/lib/components/search/search_results_body/parts/jlpt_badge.dart
h7x4 28f900c02e
Add more content to search results (#31)
* Add lots of new functionality to search results

* Fix jlpt level

* Make antonyms clickable

* Add kanji list

* Replace Blocof with BlocBuilder

* Make kanji widgets squared

* Add missing colons to headers

* add romaji under sentences

* Fix extensive search not showing

* Miscellaneous refactoring
2022-01-23 18:27:00 +01:00

26 lines
586 B
Dart

import 'package:flutter/material.dart';
import './badge.dart';
class JLPTBadge extends StatelessWidget {
final String? jlptLevel;
const JLPTBadge({
required this.jlptLevel,
Key? key,
}) : super(key: key);
String get formattedJlptLevel =>
jlptLevel != null ? jlptLevel!.substring(5).toUpperCase() : '';
@override
Widget build(BuildContext context) {
return Badge(
color: jlptLevel != null ? Colors.blue : Colors.transparent,
child: Text(
formattedJlptLevel,
style: const TextStyle(color: Colors.white),
),
);
}
}