mirror of
https://github.com/h7x4/Jisho-Study-Tool.git
synced 2024-12-22 22:07:29 +01:00
h7x4
28f900c02e
* 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
26 lines
586 B
Dart
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),
|
|
),
|
|
);
|
|
}
|
|
}
|