diff --git a/lib/learn.dart b/lib/learn.dart index ae1fa22..f7e9ad3 100644 --- a/lib/learn.dart +++ b/lib/learn.dart @@ -70,7 +70,7 @@ class _QuizPageState extends State { 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,24 +89,23 @@ class _QuizPageState extends State { (option) { return Container( margin: const EdgeInsets.symmetric(vertical: 8.0), - child: ElevatedButton( - onPressed: () => ask_state == -1 - ? _checkAnswer( - v.questions[_currentQuestionIndex].answers - .indexOf(option), - ) - : _nextQuestion(), - child: Text(option), - style: ElevatedButton.styleFrom( + child: FilledButton( + onPressed: () => ask_state == -1 + ? _checkAnswer( + v.questions[_currentQuestionIndex].answers + .indexOf(option), + ) + : _nextQuestion(), + child: Text(option), + 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)