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