better colors
This commit is contained in:
parent
ea88aa0318
commit
2f5aaad3fc
1 changed files with 12 additions and 13 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue