Add themes and drawing field for kanji
This commit is contained in:
@@ -104,7 +104,10 @@ class _FlashCardPaper extends StatelessWidget {
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text((cardIndex != null) ? (cardIndex! + 1).toString() : "?")
|
||||
Text(
|
||||
(cardIndex != null) ? (cardIndex! + 1).toString() : "?",
|
||||
style: const TextStyle(color: Colors.black),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -140,13 +143,19 @@ class _NorwegianContent extends StatelessWidget {
|
||||
child: FittedBox(
|
||||
fit: BoxFit.fitHeight,
|
||||
child: DefaultTextStyle.merge(
|
||||
style: const TextStyle(fontFamily: 'Heart Warming'),
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Heart Warming',
|
||||
color: Colors.black,
|
||||
),
|
||||
child: Column(
|
||||
children: card.norwegian.map((n) {
|
||||
final text = (n.hints == null)
|
||||
? n.word
|
||||
: "${n.word} (${n.hints?.join(', ')})";
|
||||
return Text(text);
|
||||
return Text(
|
||||
text,
|
||||
style: const TextStyle(color: Colors.black),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
@@ -170,7 +179,10 @@ class _JapaneseContent extends StatelessWidget {
|
||||
child: FittedBox(
|
||||
fit: BoxFit.fitHeight,
|
||||
child: DefaultTextStyle.merge(
|
||||
style: const TextStyle(fontFamily: 'K Gothic'),
|
||||
style: const TextStyle(
|
||||
fontFamily: 'K Gothic',
|
||||
color: Colors.black,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: card.japanese
|
||||
|
||||
57
lib/components/navigation_buttons.dart
Normal file
57
lib/components/navigation_buttons.dart
Normal file
@@ -0,0 +1,57 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class NavigationButtons extends StatelessWidget {
|
||||
final String middleText;
|
||||
final void Function() onNextCard;
|
||||
final void Function() onPreviousCard;
|
||||
final void Function()? onMiddlePressed;
|
||||
|
||||
const NavigationButtons({
|
||||
Key? key,
|
||||
required this.middleText,
|
||||
required this.onNextCard,
|
||||
required this.onPreviousCard,
|
||||
this.onMiddlePressed,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) =>
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: ButtonBar(
|
||||
alignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
padding: const EdgeInsets.all(20),
|
||||
color: Colors.white,
|
||||
onPressed: onPreviousCard,
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
InkWell(
|
||||
onTap: onMiddlePressed,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Text(
|
||||
middleText,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.headline6!
|
||||
.merge(const TextStyle(color: Colors.white)),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
IconButton(
|
||||
padding: const EdgeInsets.all(20),
|
||||
color: Colors.white,
|
||||
onPressed: onNextCard,
|
||||
icon: const Icon(Icons.arrow_forward),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user