Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

design better UI/UX #52

Merged
merged 2 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ class _ViewAllQuestionsScreenState extends State<ViewAllQuestionsScreen> {
color: Color.fromRGBO(207, 0, 15, 1),
),
),
leading: IconButton(
icon: const Icon(Icons.arrow_back,
color: Color.fromRGBO(207, 0, 15, 1)),
onPressed: () {
Navigator.of(buildContext).pop();
},
),
),
body: Padding(
padding: const EdgeInsets.all(13.0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,20 @@ class _ViewQuestionsScreenState extends State<ViewQuestionsScreen> {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: true,
title: const Text('My Questions',
style: TextStyle(fontWeight: FontWeight.bold)),
title: const Text(
'My Questions',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Color.fromRGBO(207, 0, 15, 1),
),
),
leading: IconButton(
icon: const Icon(Icons.arrow_back,
color: Color.fromRGBO(207, 0, 15, 1)),
onPressed: () {
Navigator.of(buildContext).pop();
},
),
),
body: Padding(
padding: const EdgeInsets.all(13.0),
Expand All @@ -37,7 +49,10 @@ class _ViewQuestionsScreenState extends State<ViewQuestionsScreen> {
return const Center(
child: Text(
'No questions yet',
style: TextStyle(fontWeight: FontWeight.bold),
style: TextStyle(
fontWeight: FontWeight.bold,
color: Color.fromRGBO(207, 0, 15, 1),
),
),
);
}
Expand Down
167 changes: 73 additions & 94 deletions lib/features/quiz_mode/presentation/pages/finished_quiz_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,47 +24,87 @@ class FinishedQuizPage extends StatelessWidget {
return Scaffold(
backgroundColor: const Color.fromRGBO(207, 0, 15, 1),
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: const Color.fromRGBO(207, 0, 15, 1),
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text('Quiz Results',
automaticallyImplyLeading: false,
backgroundColor: const Color.fromRGBO(207, 0, 15, 1),
title: Center(
child: Text('Quiz Results',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
)),
SizedBox(
height: 35,
child: ElevatedButton(
onPressed: () {
GoRouter.of(context).go('/quiz-mode');
},
style: ButtonStyle(
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(
),
bottom: PreferredSize(
preferredSize: Size.fromHeight(30.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
margin: EdgeInsets.only(bottom: 10),
height: 35,
child: ElevatedButton(
onPressed: () {
GoRouter.of(context).go('/quiz-mode');
},
style: ButtonStyle(
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(
color: Colors.white,
),
),
),
backgroundColor: MaterialStateProperty.all(
const Color.fromRGBO(207, 0, 15, 1),
),
),
child: Text(
"Take Another Quiz",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
backgroundColor: MaterialStateProperty.all(
const Color.fromRGBO(207, 0, 15, 1),
),
),
child: Text(
"Take Another Quiz",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
Container(
margin: EdgeInsets.only(bottom: 10),
height: 35,
child: ElevatedButton(
onPressed: () {
GoRouter.of(context).go(
'/quiz-mode/solutions-quiz',
extra: {
'subjectQuestionsMap': subjectQuestionsMap,
'subject': subject
},
);
},
style: ButtonStyle(
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(
color: Colors.white,
),
),
),
backgroundColor: MaterialStateProperty.all(
const Color.fromRGBO(207, 0, 15, 1),
),
),
child: Text(
"View Solutions",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
),
),
],
),
],
),
),
)),
body: SingleChildScrollView(
child: Column(
children: [
Expand All @@ -81,7 +121,7 @@ class FinishedQuizPage extends StatelessWidget {
),
),
Container(
width: double.infinity,
width: 200,
margin: EdgeInsets.only(left: 10, right: 10),
child: Card(
child: Column(
Expand Down Expand Up @@ -114,71 +154,10 @@ class FinishedQuizPage extends StatelessWidget {
),
),
),
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 14, right: 14),
padding: EdgeInsets.only(top: 7, bottom: 10),
child: TextButton(
onPressed: () {
GoRouter.of(context).go(
'/quiz-mode/solutions-quiz',
extra: {
'subjectQuestionsMap': subjectQuestionsMap,
'subject': subject
},
);
},
style: ButtonStyle(
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
side: MaterialStateProperty.all(
BorderSide(
color: Colors.white,
),
),
),
child: Text(
"View Solutions",
style: TextStyle(
color: Colors.white,
fontSize: 18,
),
),
),
),
Text(
"* Results of unanswered questions will not be shown",
style: TextStyle(
fontSize: 11,
color: Colors.white,
),
),
QuestionDisplay(
subjectQuestionsMap: subjectQuestionsMap, subject: subject),
// Container(
// width: 200,
// child: ElevatedButton(
// onPressed: () {
// GoRouter.of(context).go('/quiz-mode');
// },
// style: ButtonStyle(
// shape: MaterialStateProperty.all<RoundedRectangleBorder>(
// RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// ),
// ),
// backgroundColor:
// MaterialStateProperty.all<Color>(Colors.white),
// ),
// child: Text("Take Another Quiz",
// style: TextStyle(
// fontWeight: FontWeight.bold,
// color: const Color.fromRGBO(207, 0, 15, 1))),
// ),
// ),
subjectQuestionsMap: subjectQuestionsMap,
subject: subject,
),
SizedBox(
height: 20,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ class ReadyQuizPage extends StatelessWidget {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
title: const Text('Quiz Mode',
style: TextStyle(fontWeight: FontWeight.bold)),
title: const Center(
child: Text('Quiz Mode',
style: TextStyle(fontWeight: FontWeight.bold)),
),
),
body: Center(
child: ChooseSubjectDisplay(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ class _UploadQuestionPageState extends State<UploadQuestionPage> {
return Scaffold(
appBar: AppBar(
backgroundColor: Color.fromRGBO(207, 0, 15, 1),
title: const Text('Upload Questions',
style: TextStyle(
fontWeight: FontWeight.bold, color: Colors.white)),
title: const Center(
child: Text('Upload Questions',
style: TextStyle(
fontWeight: FontWeight.bold, color: Colors.white)),
),
bottom: PreferredSize(
preferredSize: Size.fromHeight(60.0),
child: Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ class _UploadSuccessPageState extends State<UploadSuccessPage> {
appBar: AppBar(
backgroundColor: Color.fromRGBO(207, 0, 15, 1),
automaticallyImplyLeading: false,
title: const Text('Upload Questions',
style:
TextStyle(fontWeight: FontWeight.bold, color: Colors.white)),
title: const Center(
child: Text('Upload Questions',
style: TextStyle(
fontWeight: FontWeight.bold, color: Colors.white)),
),
),
body: BlocBuilder<UploadQuizCubit, UploadQuizState>(
builder: (blocBuilderContext, state) {
Expand Down
Loading