Skip to content

Commit

Permalink
resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
12henbx committed Apr 2, 2024
2 parents 74330ac + 393f42c commit e7c7d21
Show file tree
Hide file tree
Showing 76 changed files with 3,834 additions and 547 deletions.
5 changes: 5 additions & 0 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ init:
make build_runner
@echo "╠ Initialize successed!"

release:
make init
@flutter pub run flutter_launcher_icons
@flutter build appbundle

dev:
@flutter run lib/main.dart

Expand Down
6 changes: 3 additions & 3 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ make build_apk

### 🔑 Authentication
**Android**
1. Add your Signature SHA1 key in Bebras Pandai Firebase Project, specifically on the `Project settings` > `Android apps` ([URL](https://console.firebase.google.com/u/1/project/toki-bebras-proto/settings/general/android:com.toki.bebras_pandai)) > Add Fingerprint
- Reference on getting the Signature SHA1 key https://www.geeksforgeeks.org/how-to-generate-sha-1-key-in-flutter/
1. Download `.env` & `google-services.json` file from Firebase storage `secret` directory \
(ask in the group if you aren't sure how to do this, please don't download it from the project menu & renewing the key)
1. Put `.env` in this `app/` directory, and `google-services.json` inside `app/android/app/`
1. Add your SHA1 key in the `Project settings` > `Android apps` \
https://www.geeksforgeeks.org/how-to-generate-sha-1-key-in-flutter/
1. Follow the step in [this section](#-how-to-run-and-build-apk) to test it

**iOS**
Expand All @@ -52,4 +52,4 @@ make build_apk
1. Open finder, then go to `app/ios` directory
1. Right click `Runner.xcodeproj`, choose open with `Xcode.app`
1. Add `GoogleService-Info.plist` into the `Runner` directory inside `Xcode.app`
1. Follow the step in [this section](#-how-to-run-and-build-apk) to test it
1. Follow the step in [this section](#-how-to-run-and-build-apk) to test it
1 change: 0 additions & 1 deletion app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

<application
android:label="Bebras Pandai"
Expand Down
Binary file added app/assets/icon/ic_google.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/b-logo.webp
Binary file not shown.
Binary file added app/assets/images/ic_login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/ic_onboard_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/ic_onboard_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/ic_onboard_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
257 changes: 246 additions & 11 deletions app/ios/Runner.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import 'package:google_fonts/google_fonts.dart';
import 'features/authentication/register/bloc/user_register_bloc.dart';
import 'features/main/presentation/bloc/home_cubit.dart';
import 'features/onboarding/presentation/bloc/user_initialization_bloc.dart';
import 'features/quiz_download/presentation/bloc/quiz_registration_cubit.dart';
import 'features/quiz_exercise/presentation/bloc/quiz_exercise_cubit.dart';
import 'features/quiz_registration/presentation/bloc/quiz_registration_cubit.dart';
import 'features/quiz_result/presentation/bloc/quiz_result_cubit.dart';
import 'features/quiz_start/presentation/bloc/quiz_start_cubit.dart';
import 'features/task_detail/presentation/bloc/task_detail_cubit.dart';
Expand Down
37 changes: 27 additions & 10 deletions app/lib/core/bases/widgets/atoms/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class Button extends StatelessWidget {
final double fontSize;
final Color customButtonColor;
final Color customTextColor;
final Color customBorderColor;
final String icon;
final double borderRadius;

const Button({
required this.text,
Expand All @@ -27,6 +30,9 @@ class Button extends StatelessWidget {
this.fontSize = 16,
this.customButtonColor = Colors.transparent,
this.customTextColor = BaseColors.black,
this.borderRadius = 16,
this.customBorderColor = Colors.transparent,
this.icon = '',
super.key,
});

Expand Down Expand Up @@ -69,18 +75,29 @@ class Button extends StatelessWidget {
),
decoration: BoxDecoration(
color: buttonColor,
borderRadius: BorderRadius.circular(16),
borderRadius: BorderRadius.circular(borderRadius),
border: Border.all(color: customBorderColor),
),
width: double.infinity,
child: AutoSizeText(
text,
textAlign: TextAlign.center,
style: TextStyle(
color: textColor,
fontSize: fontSize,
fontWeight: FontWeight.w600,
),
minFontSize: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (icon != '')
Image.asset(
icon,
),
SizedBox(width: icon != '' ? 9.0 : 0),
AutoSizeText(
text,
textAlign: TextAlign.center,
style: TextStyle(
color: textColor,
fontSize: fontSize,
fontWeight: FontWeight.w600,
),
minFontSize: 2,
),
],
),
),
),
Expand Down
2 changes: 2 additions & 0 deletions app/lib/core/bases/widgets/atoms/html_cached_image.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_html_svg/flutter_html_svg.dart';

class HtmlWithCachedImages extends StatelessWidget {
final String data;
Expand All @@ -15,6 +16,7 @@ class HtmlWithCachedImages extends StatelessWidget {
return Html(
data: data,
extensions: <HtmlExtension>[
const SvgHtmlExtension(),
ImageExtension(
builder: (ExtensionContext extensionContext) {
final element = extensionContext.styledElement!;
Expand Down
8 changes: 6 additions & 2 deletions app/lib/core/bases/widgets/layout/bottom_navbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,13 @@ class _BottomNavBarState extends State<BottomNavBar> {
bottom: 9,
),
alignment: Alignment.bottomCenter,
child: const Text(
child: Text(
'Latihan',
style: TextStyle(fontSize: 11),
style: TextStyle(
fontSize: 11,
color: widget.currentIndex == 2
? const Color(0xFF1BB8E1) : const Color(0xFF666666),
),
),
),
buildIconButton(FontAwesomeIcons.gear, 'Pengaturan', 1),
Expand Down
6 changes: 6 additions & 0 deletions app/lib/core/constants/assets.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
class Assets {
static const sourceImg = '{sourceImg}';
static const urlImg =
'https://storage.googleapis.com/toki-bebras-proto.appspot.com/uploads';
static const flagDir = 'assets/images/flags/';
static const icon = 'assets/icon/icon.png';
static const logo = 'assets/images/logo.png';
static const iconGoogle = 'assets/icon/ic_google.png';
static const iconLogin = 'assets/images/ic_login.png';
static const bebrasPandaiText = 'assets/images/bebras-banner.png';
static const bLogo = 'assets/images/b-logo.webp';
static const studyBackground = 'assets/images/study-background.jpg';
static const bebrasMascot = 'assets/images/bebras-mascot.png';
}
23 changes: 23 additions & 0 deletions app/lib/core/constants/get_started.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
List<Map<String, dynamic>> getStartedList = [
{
'image': 'assets/images/ic_onboard_1.png',
'title': 'Temukan Dunia Pengetahuanmu!',
'description':
'Selamat datang di Bebras Pandai, tempat di mana kamu dapat membuka '
'pintu menuju pengetahuan yang tak terbatas.'
},
{
'image': 'assets/images/ic_onboard_2.png',
'title': 'Pintu Gerbang Kecerdasan Terbuka',
'description':
'Setiap langkah akan membawa kita lebih dekat dengan pengetahuan '
'yang tak terbatas.'
},
{
'image': 'assets/images/ic_onboard_3.png',
'title': 'Temukan Keajaiban!',
'description':
'Setiap momen belajar menjadi petualangan yang penuh keceriaan. '
'Ayo bergabung dalam dan nikmati manfaat yang luar biasa'
}
];
22 changes: 22 additions & 0 deletions app/lib/core/constants/status_task_set.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
List<Map<String, String>> dropdownItems = [
{
'value': 'draft',
'text': 'Draft',
},
{
'value': 'need_review',
'text': 'Need Review',
},
{
'value': 'ready',
'text': 'Ready',
},
{
'value': 'reserve',
'text': 'Reserve',
},
{
'value': 'canceled',
'text': 'Canceled',
},
];
2 changes: 2 additions & 0 deletions app/lib/core/theme/base_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ class BaseColors {
static const Color yellow = Color(0xFFfeb451);
static const Color asparagus = Color(0xFF6da34d);
static const Color grey = Colors.grey;
static const Color brightBlue = Color(0xFF1BB8E1);
static const Color greyCustom = Color(0xFFD9D9D9);
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ class UserRegisterBloc extends Bloc<UserRegisterEvent, RegisterFormState> {
email: BlocFormItem(
value: value['email'].toString(),
),
birthDate: BlocFormItem(
value: value['birth_date'].toString(),
),
// birthDate: BlocFormItem(
// value: value['birth_date'].toString(),
// ),
school: BlocFormItem(
value: value['school'].toString(),
),
province: BlocFormItem(
value: value['province'].toString(),
),
bebrasBiro: BlocFormItem(
value: value['bebras_biro'].toString(),
),
// bebrasBiro: BlocFormItem(
// value: value['bebras_biro'].toString(),
// ),
),
),
},
Expand Down Expand Up @@ -199,10 +199,10 @@ class UserRegisterBloc extends Bloc<UserRegisterEvent, RegisterFormState> {
if (state.formKey!.currentState!.validate()) {
final email = state.email.value;
final name = state.name.value;
final birthDate = state.birthDate.value;
// final birthDate = state.birthDate.value;
final school = state.school.value;
final province = state.province.value;
final bebrasBiro = state.bebrasBiro.value;
// final bebrasBiro = state.bebrasBiro.value;

emit(UserRegisterLoadingState());

Expand All @@ -211,10 +211,10 @@ class UserRegisterBloc extends Bloc<UserRegisterEvent, RegisterFormState> {
userId: userId,
email: email,
name: name,
birthDate: birthDate,
// birthDate: birthDate,
school: school,
province: province,
bebrasBiro: bebrasBiro,
// bebrasBiro: bebrasBiro,
);
emit(UserRegisterSuccessState());
} catch (e) {
Expand All @@ -233,10 +233,10 @@ class UserRegisterBloc extends Bloc<UserRegisterEvent, RegisterFormState> {
if (state.formKey!.currentState!.validate()) {
final email = state.email.value;
final name = state.name.value;
final birthDate = state.birthDate.value;
// final birthDate = state.birthDate.value;
final school = state.school.value;
final province = state.province.value;
final bebrasBiro = state.bebrasBiro.value;
// final bebrasBiro = state.bebrasBiro.value;

emit(UserRegisterLoadingState());

Expand All @@ -245,10 +245,10 @@ class UserRegisterBloc extends Bloc<UserRegisterEvent, RegisterFormState> {
userId: userId,
email: email,
name: name,
birthDate: birthDate,
// birthDate: birthDate,
school: school,
province: province,
bebrasBiro: bebrasBiro,
// bebrasBiro: bebrasBiro,
);
emit(UserRegisterSuccessState());
} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,22 @@ class _RegisterPageState extends State<RegisterPage> {
},
state.name.value,
),
CustomDatePicker(
'Tanggal Lahir',
(value) {
BlocProvider.of<UserRegisterBloc>(context).add(
BirthDateEvent(
birthDate: BlocFormItem(
value: value,
),
),
);
},
(val) {
return state.birthDate.error;
},
state.birthDate.value,
),
// CustomDatePicker(
// 'Tanggal Lahir',
// (value) {
// BlocProvider.of<UserRegisterBloc>(context).add(
// BirthDateEvent(
// birthDate: BlocFormItem(
// value: value,
// ),
// ),
// );
// },
// (val) {
// return state.birthDate.error;
// },
// state.birthDate.value,
// ),
CustomTextField(
'Sekolah',
(value) {
Expand Down Expand Up @@ -164,24 +164,24 @@ class _RegisterPageState extends State<RegisterPage> {
? state.province.value
: 'Provinsi',
),
BiroBebrasDropdown(
'Bebras Biro',
(value) {
BlocProvider.of<UserRegisterBloc>(context).add(
BebrasBiroEvent(
bebrasBiro: BlocFormItem(
value: value,
),
),
);
},
(val) {
return state.bebrasBiro.error;
},
state.bebrasBiro.value.isNotEmpty
? state.bebrasBiro.value
: 'Bebras Biro',
),
// BiroBebrasDropdown(
// 'Bebras Biro',
// (value) {
// BlocProvider.of<UserRegisterBloc>(context).add(
// BebrasBiroEvent(
// bebrasBiro: BlocFormItem(
// value: value,
// ),
// ),
// );
// },
// (val) {
// return state.bebrasBiro.error;
// },
// state.bebrasBiro.value.isNotEmpty
// ? state.bebrasBiro.value
// : 'Bebras Biro',
// ),
const SizedBox(height: 20),
BlocConsumer<UserRegisterBloc, RegisterFormState>(
bloc: _userRegisterBloc,
Expand Down
Loading

0 comments on commit e7c7d21

Please sign in to comment.