Skip to content

Commit

Permalink
fix: make selection area consistent between kanji and kanji radical v…
Browse files Browse the repository at this point in the history
…iews
  • Loading branch information
Moseco committed Feb 1, 2024
1 parent fc6b25a commit 3611fe0
Showing 1 changed file with 90 additions and 88 deletions.
178 changes: 90 additions & 88 deletions lib/ui/views/kanji/kanji_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ class KanjiView extends StackedView<KanjiViewModel> {
child: ListView(
padding: const EdgeInsets.all(8),
children: [
IntrinsicHeight(
child: Row(
children: [
Expanded(
child: Center(
child: SelectionContainer.disabled(
SelectionContainer.disabled(
child: IntrinsicHeight(
child: Row(
children: [
Expanded(
child: Center(
child: GestureDetector(
onLongPress: viewModel.copyKanji,
child: Text(
Expand All @@ -54,100 +54,102 @@ class KanjiView extends StackedView<KanjiViewModel> {
),
),
),
),
Expanded(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: switch (kanji.grade) {
255 => '—',
8 => '7-9',
_ => kanji.grade.toString(),
},
),
const TextSpan(
text: '\nGrade',
style: TextStyle(
fontSize: 12,
color: Colors.grey,
Expanded(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: switch (kanji.grade) {
255 => '—',
8 => '7-9',
_ => kanji.grade.toString(),
},
),
),
],
const TextSpan(
text: '\nGrade',
style: TextStyle(
fontSize: 12,
color: Colors.grey,
),
),
],
),
textAlign: TextAlign.center,
),
textAlign: TextAlign.center,
),
Text.rich(
TextSpan(
children: [
TextSpan(text: kanji.strokeCount.toString()),
const TextSpan(
text: '\nStrokes',
style: TextStyle(
fontSize: 12,
color: Colors.grey,
Text.rich(
TextSpan(
children: [
TextSpan(
text: kanji.strokeCount.toString(),
),
),
],
const TextSpan(
text: '\nStrokes',
style: TextStyle(
fontSize: 12,
color: Colors.grey,
),
),
],
),
textAlign: TextAlign.center,
),
textAlign: TextAlign.center,
),
],
],
),
),
),
),
Expanded(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: kanji.frequency != null
? kanji.frequency.toString()
: '—',
),
const TextSpan(
text: '\nRank',
style: TextStyle(
fontSize: 12,
color: Colors.grey,
Expanded(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: kanji.frequency != null
? kanji.frequency.toString()
: '—',
),
),
],
const TextSpan(
text: '\nRank',
style: TextStyle(
fontSize: 12,
color: Colors.grey,
),
),
],
),
textAlign: TextAlign.center,
),
textAlign: TextAlign.center,
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: kanji.jlpt != 255
? 'N${kanji.jlpt}'
: '—',
),
const TextSpan(
text: '\nJLPT',
style: TextStyle(
fontSize: 12,
color: Colors.grey,
Text.rich(
TextSpan(
children: [
TextSpan(
text: kanji.jlpt != 255
? 'N${kanji.jlpt}'
: '—',
),
),
],
const TextSpan(
text: '\nJLPT',
style: TextStyle(
fontSize: 12,
color: Colors.grey,
),
),
],
),
textAlign: TextAlign.center,
),
textAlign: TextAlign.center,
),
],
],
),
),
),
),
],
],
),
),
),
if (kanji.strokes != null && kanji.strokes!.isNotEmpty)
Expand Down

0 comments on commit 3611fe0

Please sign in to comment.