From fe3b6e25ddbd04419ad4aaf5cc6c64f6ad1d4e3c Mon Sep 17 00:00:00 2001 From: dandiindra29 Date: Sat, 7 Oct 2023 12:00:31 +0700 Subject: [PATCH 1/3] create quiz registration page --- .gitignore | 3 +- app/lib/app.dart | 2 + app/lib/core/bases/widgets/atoms/button.dart | 12 +- .../main/presentation/pages/main_page.dart | 2 +- .../bloc/quiz_registration_cubit.dart | 15 ++ .../bloc/quiz_registration_event.dart | 8 + .../bloc/quiz_registration_state.dart | 38 +++ .../presentation/pages/_pages.dart | 10 + .../pages/quiz_registration_page.dart | 235 ++++++++++++++++++ app/lib/services/router_service.dart | 4 + 10 files changed, 323 insertions(+), 6 deletions(-) create mode 100644 app/lib/features/quiz_registration/bloc/quiz_registration_cubit.dart create mode 100644 app/lib/features/quiz_registration/bloc/quiz_registration_event.dart create mode 100644 app/lib/features/quiz_registration/bloc/quiz_registration_state.dart create mode 100644 app/lib/features/quiz_registration/presentation/pages/_pages.dart create mode 100644 app/lib/features/quiz_registration/presentation/pages/quiz_registration_page.dart diff --git a/.gitignore b/.gitignore index 0a764a4..7ed4bc8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -env +.env +google-service.json \ No newline at end of file diff --git a/app/lib/app.dart b/app/lib/app.dart index 0b85c38..3c5208d 100644 --- a/app/lib/app.dart +++ b/app/lib/app.dart @@ -4,6 +4,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:google_fonts/google_fonts.dart'; import 'features/onboarding/presentation/bloc/user_initialization_bloc.dart'; +import 'features/quiz_registration/bloc/quiz_registration_cubit.dart'; import 'services/di.dart'; import 'services/router_service.dart'; @@ -24,6 +25,7 @@ class App extends StatelessWidget { OnboardingAuthEvent(), ), ), + BlocProvider(create: (context) => QuizRegistrationCubit()) ], child: MaterialApp.router( theme: ThemeData( diff --git a/app/lib/core/bases/widgets/atoms/button.dart b/app/lib/core/bases/widgets/atoms/button.dart index 2dcd802..383e1a1 100644 --- a/app/lib/core/bases/widgets/atoms/button.dart +++ b/app/lib/core/bases/widgets/atoms/button.dart @@ -13,6 +13,8 @@ class Button extends StatelessWidget { final double innerHorizontalPadding; final double innerVerticalPadding; final double fontSize; + final Color customButtonColor; + final Color customTextColor; const Button({ required this.text, @@ -23,6 +25,8 @@ class Button extends StatelessWidget { this.innerHorizontalPadding = 20, this.innerVerticalPadding = 16, this.fontSize = 16, + this.customButtonColor = Colors.transparent, + this.customTextColor = BaseColors.black, super.key, }); @@ -41,12 +45,12 @@ class Button extends StatelessWidget { buttonColor = BaseColors.white; break; case ButtonType.tertiary: - textColor = BaseColors.primarySwatch; - buttonColor = BaseColors.black; + textColor = BaseColors.white; + buttonColor = Colors.blueAccent; break; case null: - textColor = BaseColors.black; - buttonColor = Colors.transparent; + textColor = customTextColor; + buttonColor = customButtonColor; break; } diff --git a/app/lib/features/main/presentation/pages/main_page.dart b/app/lib/features/main/presentation/pages/main_page.dart index e99e45d..8febd95 100644 --- a/app/lib/features/main/presentation/pages/main_page.dart +++ b/app/lib/features/main/presentation/pages/main_page.dart @@ -71,7 +71,7 @@ class _MainPageState extends State { Button( buttonType: ButtonType.primary, onTap: () async { - await context.push('/construction'); + await context.push('/quiz_registration'); }, text: 'Ikut Quiz', ), diff --git a/app/lib/features/quiz_registration/bloc/quiz_registration_cubit.dart b/app/lib/features/quiz_registration/bloc/quiz_registration_cubit.dart new file mode 100644 index 0000000..83bc631 --- /dev/null +++ b/app/lib/features/quiz_registration/bloc/quiz_registration_cubit.dart @@ -0,0 +1,15 @@ +import 'package:equatable/equatable.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +part 'quiz_registration_state.dart'; +part 'quiz_registration_event.dart'; + +class QuizRegistrationCubit extends Cubit { + QuizRegistrationCubit() : super(QuizRegistrationInitialState()); + + void selectWeek(String selectedWeek) { + emit(QuizRegistrationLoading()); + + emit(QuizRegistrationWeekSelected(selectedWeek)); + } +} diff --git a/app/lib/features/quiz_registration/bloc/quiz_registration_event.dart b/app/lib/features/quiz_registration/bloc/quiz_registration_event.dart new file mode 100644 index 0000000..a048663 --- /dev/null +++ b/app/lib/features/quiz_registration/bloc/quiz_registration_event.dart @@ -0,0 +1,8 @@ +part of 'quiz_registration_cubit.dart'; + +abstract class QuizRegistrationEvent extends Equatable { + const QuizRegistrationEvent(); + + @override + List get props => []; +} diff --git a/app/lib/features/quiz_registration/bloc/quiz_registration_state.dart b/app/lib/features/quiz_registration/bloc/quiz_registration_state.dart new file mode 100644 index 0000000..994a204 --- /dev/null +++ b/app/lib/features/quiz_registration/bloc/quiz_registration_state.dart @@ -0,0 +1,38 @@ +part of 'quiz_registration_cubit.dart'; + +abstract class QuizRegistrationState extends Equatable { + const QuizRegistrationState(); + + @override + List get props => []; +} + +class QuizRegistrationInitialState extends QuizRegistrationState {} + +class QuizRegistrationLoading extends QuizRegistrationState {} + +class QuizRegistrationWeekSelected extends QuizRegistrationState { + final String selectedWeek; + + const QuizRegistrationWeekSelected(this.selectedWeek); + + @override + List get props => [selectedWeek]; +} + +// class QuizRegistrationSuccess extends QuizRegistrationState { +// final List QuizRegistrations; + +// const QuizRegistrationSuccess(this.QuizRegistrations); + +// @override +// List get props => [QuizRegistrations]; +// } + +// class QuizRegistrationFailed extends QuizRegistrationState { +// final String error; + +// const QuizRegistrationFailed(this.error); +// @override +// List get props => [error]; +// } diff --git a/app/lib/features/quiz_registration/presentation/pages/_pages.dart b/app/lib/features/quiz_registration/presentation/pages/_pages.dart new file mode 100644 index 0000000..91946da --- /dev/null +++ b/app/lib/features/quiz_registration/presentation/pages/_pages.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +import '../../../../core/bases/enum/button_type.dart'; +import '../../../../core/bases/widgets/atoms/button.dart'; +import '../../../../core/bases/widgets/layout/bebras_scaffold.dart'; +import '../../../../core/constants/assets.dart'; +import '../../bloc/quiz_registration_cubit.dart'; + +part 'quiz_registration_page.dart'; diff --git a/app/lib/features/quiz_registration/presentation/pages/quiz_registration_page.dart b/app/lib/features/quiz_registration/presentation/pages/quiz_registration_page.dart new file mode 100644 index 0000000..6667c6e --- /dev/null +++ b/app/lib/features/quiz_registration/presentation/pages/quiz_registration_page.dart @@ -0,0 +1,235 @@ +// ignore_for_file: lines_longer_than_80_chars, require_trailing_commas + +part of '_pages.dart'; + +class QuizRegistrationPage extends StatefulWidget { + const QuizRegistrationPage({super.key}); + + @override + State createState() => _QuizRegistrationPageState(); +} + +class _QuizRegistrationPageState extends State { + final nama = 'dummy'; + + @override + Widget build(BuildContext context) { + Future showModal() async { + return showModalBottomSheet( + context: context, + builder: (BuildContext context) { + return BlocConsumer( + listener: (context, state) { + // TODO: implement listener + }, + builder: (context, state) { + if (state is QuizRegistrationWeekSelected && + state.selectedWeek != '') { + return Container( + constraints: const BoxConstraints(minHeight: 30), + width: double.infinity, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + const SizedBox( + height: 20, + ), + Container( + margin: const EdgeInsets.only(left: 20), + child: InkWell( + onTap: () => context + .read() + .selectWeek(''), + child: const Row( + children: [ + Icon(Icons.chevron_left), + Text('Pilih Minggu') + ], + ), + ), + ), + const SizedBox( + height: 20, + ), + Container( + margin: const EdgeInsets.only(left: 20), + child: Text( + 'Daftar Latihan Bebras ${state.selectedWeek == 'next_week' ? 'Minggu Depan' : 'Minggu Ini'}', + textAlign: TextAlign.left, + style: const TextStyle( + fontSize: 18, fontWeight: FontWeight.bold), + ), + ), + const SizedBox( + height: 25, + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 40), + width: double.infinity, + child: Button( + onTap: () => context + .read() + .selectWeek('next_week'), + customButtonColor: Colors.blue.shade400, + customTextColor: Colors.white, + text: 'siKecil', + )), + const SizedBox( + height: 15, + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 40), + width: double.infinity, + child: Button( + onTap: () => context + .read() + .selectWeek('this_week'), + customButtonColor: Colors.green.shade400, + customTextColor: Colors.white, + text: 'Siaga', + )), + const SizedBox( + height: 15, + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 40), + width: double.infinity, + child: Button( + onTap: () => context + .read() + .selectWeek('this_week'), + customButtonColor: Colors.red.shade400, + customTextColor: Colors.white, + text: 'Penggalang', + )), + const SizedBox( + height: 15, + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 40), + width: double.infinity, + child: Button( + onTap: () => context + .read() + .selectWeek('this_week'), + customButtonColor: Colors.orange.shade400, + customTextColor: Colors.white, + text: 'Penegak', + )), + const SizedBox( + height: 20, + ), + ], + ), + ); + } + return Container( + height: 260, + width: double.infinity, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + const SizedBox( + height: 40, + ), + Container( + margin: const EdgeInsets.only(left: 20), + child: const Text( + 'Daftar Latihan Bebras', + textAlign: TextAlign.left, + style: TextStyle( + fontSize: 18, fontWeight: FontWeight.bold), + ), + ), + const SizedBox( + height: 25, + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 40), + width: double.infinity, + child: Button( + onTap: () => context + .read() + .selectWeek('next_week'), + customButtonColor: Colors.green.shade400, + customTextColor: Colors.white, + text: 'Latihan Minggu Depan', + )), + const SizedBox( + height: 20, + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 40), + width: double.infinity, + child: Button( + onTap: () => context + .read() + .selectWeek('this_week'), + customButtonColor: Colors.brown.shade400, + customTextColor: Colors.white, + text: 'Latihan Minggu Ini', + )) + ], + ), + ); + }, + ); + }, + ).whenComplete(() => null); + } + + return BebrasScaffold( + body: SingleChildScrollView( + child: Stack( + children: [ + Padding( + padding: const EdgeInsets.all(32), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + Assets.bebrasPandaiText, + ), + const SizedBox( + height: 40, + ), + const Text('Latihan yang pernah diikuti'), + const SizedBox( + height: 10, + ), + Container( + height: MediaQuery.of(context).size.height - 300, + width: double.infinity, + padding: const EdgeInsets.symmetric(horizontal: 16), + decoration: BoxDecoration(border: Border.all()), + child: const Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Silahkan klik Tombol `Daftar Latihan Bebras` dibawah untuk memulai', + ) + ]), + ), + const SizedBox( + height: 10, + ), + Button( + buttonType: ButtonType.tertiary, + onTap: () async { + await showModal(); + }, + text: 'Daftar Latihan Bebras', + ), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/app/lib/services/router_service.dart b/app/lib/services/router_service.dart index 4992421..31c6f29 100644 --- a/app/lib/services/router_service.dart +++ b/app/lib/services/router_service.dart @@ -4,6 +4,7 @@ import '../features/authentication/signin/presentation/pages/_pages.dart'; import '../features/error/presentation/pages/_pages.dart'; import '../features/main/presentation/pages/_pages.dart'; import '../features/onboarding/presentation/pages/_pages.dart'; +import '../features/quiz_registration/presentation/pages/_pages.dart'; GoRouter router = GoRouter( routes: [ @@ -23,5 +24,8 @@ GoRouter router = GoRouter( path: '/construction', builder: (context, state) => const UnderConstructionPage(), ), + GoRoute( + path: '/quiz_registration', + builder: (context, state) => const QuizRegistrationPage()), ], ); From c7dee2306c1a3d08e18e78c92d79c224ccb5f572 Mon Sep 17 00:00:00 2001 From: Mirza Widihananta Date: Sun, 15 Oct 2023 09:20:00 +0700 Subject: [PATCH 2/3] fix linter --- app/lib/app.dart | 2 +- .../presentation/pages/quiz_registration_page.dart | 2 +- app/lib/services/router_service.dart | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/lib/app.dart b/app/lib/app.dart index 3c5208d..df79ed7 100644 --- a/app/lib/app.dart +++ b/app/lib/app.dart @@ -25,7 +25,7 @@ class App extends StatelessWidget { OnboardingAuthEvent(), ), ), - BlocProvider(create: (context) => QuizRegistrationCubit()) + BlocProvider(create: (context) => QuizRegistrationCubit()), ], child: MaterialApp.router( theme: ThemeData( diff --git a/app/lib/features/quiz_registration/presentation/pages/quiz_registration_page.dart b/app/lib/features/quiz_registration/presentation/pages/quiz_registration_page.dart index 6667c6e..ede84f3 100644 --- a/app/lib/features/quiz_registration/presentation/pages/quiz_registration_page.dart +++ b/app/lib/features/quiz_registration/presentation/pages/quiz_registration_page.dart @@ -20,7 +20,7 @@ class _QuizRegistrationPageState extends State { builder: (BuildContext context) { return BlocConsumer( listener: (context, state) { - // TODO: implement listener + // TODO(someone): implement listener }, builder: (context, state) { if (state is QuizRegistrationWeekSelected && diff --git a/app/lib/services/router_service.dart b/app/lib/services/router_service.dart index 31c6f29..e24c062 100644 --- a/app/lib/services/router_service.dart +++ b/app/lib/services/router_service.dart @@ -25,7 +25,8 @@ GoRouter router = GoRouter( builder: (context, state) => const UnderConstructionPage(), ), GoRoute( - path: '/quiz_registration', - builder: (context, state) => const QuizRegistrationPage()), + path: '/quiz_registration', + builder: (context, state) => const QuizRegistrationPage(), + ), ], ); From 4d72f83a4839fa1caae2cc0d0ad243ba1f0e6ae1 Mon Sep 17 00:00:00 2001 From: dandiindra29 Date: Tue, 17 Oct 2023 11:28:34 +0700 Subject: [PATCH 3/3] add quiz component --- .../bloc/quiz_registration_cubit.dart | 6 + .../bloc/quiz_registration_state.dart | 20 +- .../pages/quiz_registration_page.dart | 303 ++++++++++-------- 3 files changed, 182 insertions(+), 147 deletions(-) diff --git a/app/lib/features/quiz_registration/bloc/quiz_registration_cubit.dart b/app/lib/features/quiz_registration/bloc/quiz_registration_cubit.dart index 83bc631..405075f 100644 --- a/app/lib/features/quiz_registration/bloc/quiz_registration_cubit.dart +++ b/app/lib/features/quiz_registration/bloc/quiz_registration_cubit.dart @@ -12,4 +12,10 @@ class QuizRegistrationCubit extends Cubit { emit(QuizRegistrationWeekSelected(selectedWeek)); } + + void selectLevel(String selectedLevel) { + emit(QuizRegistrationLoading()); + + emit(QuizRegistrationLevelSelected(selectedLevel)); + } } diff --git a/app/lib/features/quiz_registration/bloc/quiz_registration_state.dart b/app/lib/features/quiz_registration/bloc/quiz_registration_state.dart index 994a204..35dce2a 100644 --- a/app/lib/features/quiz_registration/bloc/quiz_registration_state.dart +++ b/app/lib/features/quiz_registration/bloc/quiz_registration_state.dart @@ -20,19 +20,11 @@ class QuizRegistrationWeekSelected extends QuizRegistrationState { List get props => [selectedWeek]; } -// class QuizRegistrationSuccess extends QuizRegistrationState { -// final List QuizRegistrations; +class QuizRegistrationLevelSelected extends QuizRegistrationState { + final String selectedLevel; -// const QuizRegistrationSuccess(this.QuizRegistrations); + const QuizRegistrationLevelSelected(this.selectedLevel); -// @override -// List get props => [QuizRegistrations]; -// } - -// class QuizRegistrationFailed extends QuizRegistrationState { -// final String error; - -// const QuizRegistrationFailed(this.error); -// @override -// List get props => [error]; -// } + @override + List get props => [selectedLevel]; +} diff --git a/app/lib/features/quiz_registration/presentation/pages/quiz_registration_page.dart b/app/lib/features/quiz_registration/presentation/pages/quiz_registration_page.dart index 6667c6e..c8e60a8 100644 --- a/app/lib/features/quiz_registration/presentation/pages/quiz_registration_page.dart +++ b/app/lib/features/quiz_registration/presentation/pages/quiz_registration_page.dart @@ -12,121 +12,52 @@ class QuizRegistrationPage extends StatefulWidget { class _QuizRegistrationPageState extends State { final nama = 'dummy'; - @override - Widget build(BuildContext context) { - Future showModal() async { - return showModalBottomSheet( - context: context, - builder: (BuildContext context) { - return BlocConsumer( - listener: (context, state) { - // TODO: implement listener - }, - builder: (context, state) { - if (state is QuizRegistrationWeekSelected && - state.selectedWeek != '') { - return Container( - constraints: const BoxConstraints(minHeight: 30), - width: double.infinity, - color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - const SizedBox( - height: 20, - ), - Container( - margin: const EdgeInsets.only(left: 20), - child: InkWell( - onTap: () => context - .read() - .selectWeek(''), - child: const Row( - children: [ - Icon(Icons.chevron_left), - Text('Pilih Minggu') - ], - ), - ), - ), - const SizedBox( - height: 20, - ), - Container( - margin: const EdgeInsets.only(left: 20), - child: Text( - 'Daftar Latihan Bebras ${state.selectedWeek == 'next_week' ? 'Minggu Depan' : 'Minggu Ini'}', - textAlign: TextAlign.left, - style: const TextStyle( - fontSize: 18, fontWeight: FontWeight.bold), - ), - ), - const SizedBox( - height: 25, - ), - Container( - padding: const EdgeInsets.symmetric(horizontal: 40), - width: double.infinity, - child: Button( - onTap: () => context - .read() - .selectWeek('next_week'), - customButtonColor: Colors.blue.shade400, - customTextColor: Colors.white, - text: 'siKecil', - )), - const SizedBox( - height: 15, - ), - Container( - padding: const EdgeInsets.symmetric(horizontal: 40), - width: double.infinity, - child: Button( - onTap: () => context - .read() - .selectWeek('this_week'), - customButtonColor: Colors.green.shade400, - customTextColor: Colors.white, - text: 'Siaga', - )), - const SizedBox( - height: 15, - ), - Container( - padding: const EdgeInsets.symmetric(horizontal: 40), - width: double.infinity, - child: Button( - onTap: () => context - .read() - .selectWeek('this_week'), - customButtonColor: Colors.red.shade400, - customTextColor: Colors.white, - text: 'Penggalang', - )), - const SizedBox( - height: 15, - ), - Container( - padding: const EdgeInsets.symmetric(horizontal: 40), - width: double.infinity, - child: Button( - onTap: () => context - .read() - .selectWeek('this_week'), - customButtonColor: Colors.orange.shade400, - customTextColor: Colors.white, - text: 'Penegak', - )), - const SizedBox( - height: 20, - ), - ], - ), - ); - } + Widget quizCard() { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 18), + decoration: BoxDecoration(border: Border.all()), + child: const Column(children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Quiz A', + style: TextStyle(fontSize: 18), + ), + Text( + 'Nilai: 100', + style: TextStyle(fontSize: 18), + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + children: [ + Text( + 'dikerjakan: 2023-09-09 09:09', + style: TextStyle(fontSize: 12), + ) + ], + ) + ]), + ); + } + + Future showModal() async { + return showModalBottomSheet( + context: context, + builder: (BuildContext context) { + return BlocConsumer( + listener: (context, state) { + // TODO: implement listener + }, + builder: (context, state) { + if (state is QuizRegistrationWeekSelected && + state.selectedWeek != '') { return Container( - height: 260, + constraints: const BoxConstraints(minHeight: 30), width: double.infinity, color: Colors.white, child: Column( @@ -134,14 +65,31 @@ class _QuizRegistrationPageState extends State { mainAxisSize: MainAxisSize.min, children: [ const SizedBox( - height: 40, + height: 20, + ), + Container( + margin: const EdgeInsets.only(left: 20), + child: InkWell( + onTap: () => context + .read() + .selectWeek(''), + child: const Row( + children: [ + Icon(Icons.chevron_left), + Text('Pilih Minggu') + ], + ), + ), + ), + const SizedBox( + height: 20, ), Container( margin: const EdgeInsets.only(left: 20), - child: const Text( - 'Daftar Latihan Bebras', + child: Text( + 'Daftar Latihan Bebras ${state.selectedWeek == 'next_week' ? 'Minggu Depan' : 'Minggu Ini'}', textAlign: TextAlign.left, - style: TextStyle( + style: const TextStyle( fontSize: 18, fontWeight: FontWeight.bold), ), ), @@ -154,13 +102,27 @@ class _QuizRegistrationPageState extends State { child: Button( onTap: () => context .read() - .selectWeek('next_week'), + .selectLevel('sikecil'), + customButtonColor: Colors.blue.shade400, + customTextColor: Colors.white, + text: 'siKecil', + )), + const SizedBox( + height: 15, + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 40), + width: double.infinity, + child: Button( + onTap: () => context + .read() + .selectLevel('siaga'), customButtonColor: Colors.green.shade400, customTextColor: Colors.white, - text: 'Latihan Minggu Depan', + text: 'Siaga', )), const SizedBox( - height: 20, + height: 15, ), Container( padding: const EdgeInsets.symmetric(horizontal: 40), @@ -168,20 +130,91 @@ class _QuizRegistrationPageState extends State { child: Button( onTap: () => context .read() - .selectWeek('this_week'), - customButtonColor: Colors.brown.shade400, + .selectLevel('penggalang'), + customButtonColor: Colors.red.shade400, customTextColor: Colors.white, - text: 'Latihan Minggu Ini', - )) + text: 'Penggalang', + )), + const SizedBox( + height: 15, + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 40), + width: double.infinity, + child: Button( + onTap: () => context + .read() + .selectLevel('penegak'), + customButtonColor: Colors.orange.shade400, + customTextColor: Colors.white, + text: 'Penegak', + )), + const SizedBox( + height: 20, + ), ], ), ); - }, - ); - }, - ).whenComplete(() => null); - } + } + return Container( + height: 260, + width: double.infinity, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + const SizedBox( + height: 40, + ), + Container( + margin: const EdgeInsets.only(left: 20), + child: const Text( + 'Daftar Latihan Bebras', + textAlign: TextAlign.left, + style: + TextStyle(fontSize: 18, fontWeight: FontWeight.bold), + ), + ), + const SizedBox( + height: 25, + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 40), + width: double.infinity, + child: Button( + onTap: () => context + .read() + .selectWeek('next_week'), + customButtonColor: Colors.green.shade400, + customTextColor: Colors.white, + text: 'Latihan Minggu Depan', + )), + const SizedBox( + height: 20, + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 40), + width: double.infinity, + child: Button( + onTap: () => context + .read() + .selectWeek('this_week'), + customButtonColor: Colors.brown.shade400, + customTextColor: Colors.white, + text: 'Latihan Minggu Ini', + )) + ], + ), + ); + }, + ); + }, + ).whenComplete(() => null); + } + @override + Widget build(BuildContext context) { return BebrasScaffold( body: SingleChildScrollView( child: Stack( @@ -206,12 +239,16 @@ class _QuizRegistrationPageState extends State { width: double.infinity, padding: const EdgeInsets.symmetric(horizontal: 16), decoration: BoxDecoration(border: Border.all()), - child: const Column( + child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( + const Text( 'Silahkan klik Tombol `Daftar Latihan Bebras` dibawah untuk memulai', - ) + ), + const SizedBox( + height: 20, + ), + quizCard() ]), ), const SizedBox(