better colors

This commit is contained in:
jusax23 2023-06-01 16:45:42 +02:00
parent ea88aa0318
commit 2f5aaad3fc
Signed by: jusax23
GPG key ID: 499E2AA870C1CD41

View file

@ -70,7 +70,7 @@ class _QuizPageState extends State<QuizPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Learn App'),
title: Text('Learning: ${v.name}'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
@ -89,7 +89,7 @@ class _QuizPageState extends State<QuizPage> {
(option) {
return Container(
margin: const EdgeInsets.symmetric(vertical: 8.0),
child: ElevatedButton(
child: FilledButton(
onPressed: () => ask_state == -1
? _checkAnswer(
v.questions[_currentQuestionIndex].answers
@ -97,16 +97,15 @@ class _QuizPageState extends State<QuizPage> {
)
: _nextQuestion(),
child: Text(option),
style: ElevatedButton.styleFrom(
style: FilledButton.styleFrom(
backgroundColor: ask_state == -1
? Colors.blue
? null
: (v.questions[_currentQuestionIndex].correct ==
v.questions[_currentQuestionIndex].answers
.indexOf(option)
? Colors.green
: Colors.red),
foregroundColor: Colors.white),
));
)));
},
),
if (ask_state != -1)