diff --git a/app/assets/images/beaver.png b/app/assets/images/beaver.png new file mode 100644 index 00000000..83b4668d Binary files /dev/null and b/app/assets/images/beaver.png differ diff --git a/app/lib/features/authentication/register/bloc/user_register_bloc.dart b/app/lib/features/authentication/register/bloc/user_register_bloc.dart index 43c51c27..6f2c3968 100644 --- a/app/lib/features/authentication/register/bloc/user_register_bloc.dart +++ b/app/lib/features/authentication/register/bloc/user_register_bloc.dart @@ -55,18 +55,18 @@ class UserRegisterBloc extends Bloc { 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(), + ), ), ), }, @@ -199,10 +199,10 @@ class UserRegisterBloc extends Bloc { 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()); @@ -211,10 +211,10 @@ class UserRegisterBloc extends Bloc { userId: userId, email: email, name: name, - // birthDate: birthDate, + birthDate: birthDate, school: school, province: province, - // bebrasBiro: bebrasBiro, + bebrasBiro: bebrasBiro, ); emit(UserRegisterSuccessState()); } catch (e) { @@ -233,10 +233,10 @@ class UserRegisterBloc extends Bloc { 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()); @@ -245,10 +245,10 @@ class UserRegisterBloc extends Bloc { userId: userId, email: email, name: name, - // birthDate: birthDate, + birthDate: birthDate, school: school, province: province, - // bebrasBiro: bebrasBiro, + bebrasBiro: bebrasBiro, ); emit(UserRegisterSuccessState()); } catch (e) { diff --git a/app/lib/features/authentication/register/presentation/pages/_pages.dart b/app/lib/features/authentication/register/presentation/pages/_pages.dart index 502ea0d8..b9e860dd 100644 --- a/app/lib/features/authentication/register/presentation/pages/_pages.dart +++ b/app/lib/features/authentication/register/presentation/pages/_pages.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import '../../../../../core/bases/widgets/atoms/button.dart'; import '../../../../../core/bases/widgets/layout/bebras_scaffold.dart'; import '../../../../../core/constants/assets.dart'; import '../../../../../core/theme/font_theme.dart'; @@ -13,5 +15,9 @@ import '../widgets/biro_bebras_dropdown.dart'; import '../widgets/custom_date_picker.dart'; import '../widgets/custom_text_field.dart'; import '../widgets/province_dropdown.dart'; +import 'v2/widgets/biro_bebras_dropdownV2.dart'; +import 'v2/widgets/custom_date_pickerV2.dart'; +import 'v2/widgets/custom_text_fieldV2.dart'; +import 'v2/widgets/province_dropdownV2.dart'; part 'register_page.dart'; diff --git a/app/lib/features/authentication/register/presentation/pages/register_page.dart b/app/lib/features/authentication/register/presentation/pages/register_page.dart index e929b4f3..7d062d5c 100644 --- a/app/lib/features/authentication/register/presentation/pages/register_page.dart +++ b/app/lib/features/authentication/register/presentation/pages/register_page.dart @@ -66,7 +66,7 @@ class _RegisterPageState extends State { body: Padding( padding: const EdgeInsets.only( left: 16, - top: 30, + top: 20, right: 16, ), child: Form( @@ -74,24 +74,54 @@ class _RegisterPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Image.asset( - Assets.bebrasPandaiText, - height: 40, + Row( + children: [ + GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: Container( + child: Icon(Icons.arrow_back), + ), + ), + Flexible( + child: Container( + child: Center( + child: const Text('Edit Profil', + textAlign: TextAlign.start, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + color: Colors.black, + )), + ), + ), + ) + ], ), const SizedBox( - height: 40, + height: 10, ), - Container( - padding: const EdgeInsets.all(8), - child: Text( - 'Data Diri', - style: FontTheme.blackSubtitleBold(), + Column(children: [ + CircleAvatar( + maxRadius: 50, + backgroundColor: Colors.grey.shade200, + backgroundImage: const AssetImage( + 'assets/images/beaver.png', + ), ), - ), + ]), const SizedBox( - height: 8, + height: 10, ), - CustomTextField( + Text( + 'Email', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ), + CustomTextFieldV2( 'Email', (value) { BlocProvider.of(context).add( @@ -103,7 +133,14 @@ class _RegisterPageState extends State { }, state.email.value, ), - CustomTextField( + Text( + 'Nama', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 10, + ), + ), + CustomTextFieldV2( 'Nama', (value) { BlocProvider.of(context) @@ -114,24 +151,56 @@ class _RegisterPageState extends State { }, state.name.value, ), - // CustomDatePicker( - // 'Tanggal Lahir', + // Text( + // 'Tempat Lahir', + // style: TextStyle( + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ), + // CustomTextFieldV2( + // 'Tempat Lahir', // (value) { - // BlocProvider.of(context).add( - // BirthDateEvent( - // birthDate: BlocFormItem( - // value: value, - // ), - // ), - // ); + // BlocProvider.of(context) + // .add(NameEvent(name: BlocFormItem(value: value))); // }, // (val) { - // return state.birthDate.error; + // return state.name.error; // }, - // state.birthDate.value, + // state.name.value, // ), - CustomTextField( - 'Sekolah', + Text( + 'Date', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ), + CustomDatePickerV2( + 'Date', + (value) { + BlocProvider.of(context).add( + BirthDateEvent( + birthDate: BlocFormItem( + value: value, + ), + ), + ); + }, + (val) { + return state.birthDate.error; + }, + state.birthDate.value, + ), + Text( + 'Asal Sekolah', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ), + CustomTextFieldV2( + 'Asal Sekolah', (value) { BlocProvider.of(context).add( SchoolEvent( @@ -146,8 +215,14 @@ class _RegisterPageState extends State { }, state.school.value, ), - ProvinceDropdown( - 'Provinsi', + Text('Provinsi', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 12, + )), + const SizedBox(height: 3), + ProvinceDropdownV2( + // 'Provinsi', (value) { BlocProvider.of(context).add( ProvinceEvent( @@ -164,25 +239,32 @@ class _RegisterPageState extends State { ? state.province.value : 'Provinsi', ), - // BiroBebrasDropdown( - // 'Bebras Biro', - // (value) { - // BlocProvider.of(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), + Text( + 'Biro Bebras', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ), + BiroBebrasDropdownV2( + 'Bebras Biro', + (value) { + BlocProvider.of(context).add( + BebrasBiroEvent( + bebrasBiro: BlocFormItem( + value: value, + ), + ), + ); + }, + (val) { + return state.bebrasBiro.error; + }, + state.bebrasBiro.value.isNotEmpty + ? state.bebrasBiro.value + : 'Bebras Biro', + ), + const SizedBox(height: 5), BlocConsumer( bloc: _userRegisterBloc, listener: (context, state) { @@ -210,10 +292,10 @@ class _RegisterPageState extends State { return ElevatedButton( style: ElevatedButton.styleFrom( fixedSize: Size(size.width, 45), - backgroundColor: Colors.black, + backgroundColor: Colors.lightBlue, foregroundColor: Colors.white, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), + borderRadius: BorderRadius.circular(5), ), ), onPressed: () { @@ -229,7 +311,7 @@ class _RegisterPageState extends State { }, child: Text( widget.isUpdateProfile == 'true' - ? 'Perbarui' + ? 'Simpan' : 'Daftar', style: const TextStyle(fontWeight: FontWeight.w600), diff --git a/app/lib/features/authentication/register/presentation/pages/v2/_pages.dart b/app/lib/features/authentication/register/presentation/pages/v2/_pages.dart index c3c60e1d..bbc09d5e 100644 --- a/app/lib/features/authentication/register/presentation/pages/v2/_pages.dart +++ b/app/lib/features/authentication/register/presentation/pages/v2/_pages.dart @@ -16,4 +16,4 @@ import 'widgets/custom_date_pickerV2.dart'; import 'widgets/custom_text_fieldV2.dart'; import 'widgets/province_dropdownV2.dart'; -part 'register_page.dart'; +// part 'register_page.dart'; diff --git a/app/lib/features/authentication/register/presentation/pages/v2/register_page.dart b/app/lib/features/authentication/register/presentation/pages/v2/register_page.dart index 508461ae..59e129c5 100644 --- a/app/lib/features/authentication/register/presentation/pages/v2/register_page.dart +++ b/app/lib/features/authentication/register/presentation/pages/v2/register_page.dart @@ -1,363 +1,363 @@ -// ignore_for_file: lines_longer_than_80_chars +// // ignore_for_file: lines_longer_than_80_chars -part of '_pages.dart'; +// part of '_pages.dart'; -class RegisterPageV2 extends StatefulWidget { - const RegisterPageV2({super.key, this.isUpdateProfile}); +// class RegisterPageV2 extends StatefulWidget { +// const RegisterPageV2({super.key, this.isUpdateProfile}); - final String? isUpdateProfile; +// final String? isUpdateProfile; - @override - State createState() => _RegisterPageStateV2(); -} +// @override +// State createState() => _RegisterPageStateV2(); +// } -class _RegisterPageStateV2 extends State { - Future showModal() { - return showModalBottomSheet( - context: context, - builder: (BuildContext context) { - return StatefulBuilder( - builder: (BuildContext context, StateSetter setState) { - return Container( - height: 206, - width: double.infinity, - color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - const SizedBox( - height: 30, - ), - Container( - margin: const EdgeInsets.only(left: 20), - child: const Text( - 'Anda akan meninggalkan halaman ini. Data formulir tidak akan disimpan. Lanjutkan?', - textAlign: TextAlign.left, - style: - TextStyle(fontSize: 12, fontWeight: FontWeight.bold), - ), - ), - const SizedBox( - height: 15, - ), - Container( - padding: const EdgeInsets.symmetric(horizontal: 40), - width: double.infinity, - child: Button( - customButtonColor: Color.fromARGB(255, 243, 238, 238), - customTextColor: Colors.blue, - text: 'Ya'), - ), - const SizedBox( - height: 5, - ), - Container( - padding: const EdgeInsets.symmetric(horizontal: 40), - width: double.infinity, - child: Button( - customButtonColor: Color(0xFF1BB8E1), - customTextColor: Colors.white, - text: 'Tidak'), - ), - ], - ), - ); - }); - }); - } +// class _RegisterPageStateV2 extends State { +// Future showModal() { +// return showModalBottomSheet( +// context: context, +// builder: (BuildContext context) { +// return StatefulBuilder( +// builder: (BuildContext context, StateSetter setState) { +// return Container( +// height: 206, +// width: double.infinity, +// color: Colors.white, +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.center, +// mainAxisSize: MainAxisSize.min, +// children: [ +// const SizedBox( +// height: 30, +// ), +// Container( +// margin: const EdgeInsets.only(left: 20), +// child: const Text( +// 'Anda akan meninggalkan halaman ini. Data formulir tidak akan disimpan. Lanjutkan?', +// textAlign: TextAlign.left, +// style: +// TextStyle(fontSize: 12, fontWeight: FontWeight.bold), +// ), +// ), +// const SizedBox( +// height: 15, +// ), +// Container( +// padding: const EdgeInsets.symmetric(horizontal: 40), +// width: double.infinity, +// child: Button( +// customButtonColor: Color.fromARGB(255, 243, 238, 238), +// customTextColor: Colors.blue, +// text: 'Ya'), +// ), +// const SizedBox( +// height: 5, +// ), +// Container( +// padding: const EdgeInsets.symmetric(horizontal: 40), +// width: double.infinity, +// child: Button( +// customButtonColor: Color(0xFF1BB8E1), +// customTextColor: Colors.white, +// text: 'Tidak'), +// ), +// ], +// ), +// ); +// }); +// }); +// } - late final UserRegisterBloc _userRegisterBloc; - String? selectedValue; +// late final UserRegisterBloc _userRegisterBloc; +// String? selectedValue; - @override - void initState() { - _userRegisterBloc = get(); +// @override +// void initState() { +// _userRegisterBloc = get(); - super.initState(); - } +// super.initState(); +// } - @override - Widget build(BuildContext context) { - final size = MediaQuery.of(context).size; - return BlocProvider( - create: (_) => get() - ..add( - const InitialValueEvent(), - ), - child: BlocListener( - listener: (context, state) { - if (state is UserRegisterSuccessState) { - if (widget.isUpdateProfile == 'true') { - // refresh page - Navigator.pop(context); - Navigator.push( - context, - // ignore: inference_failure_on_instance_creation - MaterialPageRoute( - builder: (context) => - const RegisterPageV2(isUpdateProfile: 'true'), - ), - ); +// @override +// Widget build(BuildContext context) { +// final size = MediaQuery.of(context).size; +// return BlocProvider( +// create: (_) => get() +// ..add( +// const InitialValueEvent(), +// ), +// child: BlocListener( +// listener: (context, state) { +// if (state is UserRegisterSuccessState) { +// if (widget.isUpdateProfile == 'true') { +// // refresh page +// Navigator.pop(context); +// Navigator.push( +// context, +// // ignore: inference_failure_on_instance_creation +// MaterialPageRoute( +// builder: (context) => +// const RegisterPageV2(isUpdateProfile: 'true'), +// ), +// ); - context.read().fetchUser(); +// context.read().fetchUser(); - // add notification - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('Pembaruan data profil berhasil'), - behavior: SnackBarBehavior.floating, - ), - ); - } else { - context.go('/main'); - } - } - }, - child: BlocBuilder( - builder: (context, state) { - return BebrasScaffold( - avoidBottomInset: false, - body: Padding( - padding: const EdgeInsets.only( - left: 16, - top: 20, - right: 16, - ), - child: Form( - key: state.formKey, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Row( - children: [ - GestureDetector( - onTap: () { - showModal(); - }, - child: Container( - child: Icon( - Icons.arrow_back, - // color: Colors.blue, - ), - ), - ), - Flexible( - child: GestureDetector( - onTap: () async { - await context.push( - Uri( - path: '/register', - queryParameters: { - 'isUpdateProfile': 'true', - }, - ).toString(), - ); - }, - child: Container( - // width: double.infinity, - child: Center( - child: const Text( - 'Edit Profile', - textAlign: TextAlign.start, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ), - ), - ), - ), - ), - ], - ), - const SizedBox( - height: 10, - ), - Column(children: [ - CircleAvatar( - maxRadius: 50, - backgroundImage: NetworkImage( - Assets.bLogo, - ), - ), - const SizedBox( - height: 15, - ), - Text('Putri Nabila', - textAlign: TextAlign.center, - style: TextStyle(fontWeight: FontWeight.w600)), - ]), - const SizedBox( - height: 10, - ), - CustomTextFieldV2( - 'Email', - (value) { - BlocProvider.of(context).add( - EmailEvent(email: BlocFormItem(value: value)), - ); - }, - (val) { - return state.email.error; - }, - state.email.value, - ), - CustomTextFieldV2( - 'Nama', - (value) { - BlocProvider.of(context) - .add(NameEvent(name: BlocFormItem(value: value))); - }, - (val) { - return state.name.error; - }, - state.name.value, - ), - CustomTextFieldV2( - 'Tempat Lahir', - (value) { - // BlocProvider.of(context).add( - // NameEvent(name: BlocFormItem(value: value)), - // ); - }, - (val) { - // return state.name.error; - null; - }, - null, - ), - CustomDatePickerV2( - 'Date', - (value) { - BlocProvider.of(context).add( - BirthDateEvent( - birthDate: BlocFormItem( - value: value, - ), - ), - ); - }, - (val) { - return state.birthDate.error; - }, - state.birthDate.value, - ), - CustomTextFieldV2( - 'Asal Sekolah', - (value) { - BlocProvider.of(context).add( - SchoolEvent( - school: BlocFormItem( - value: value, - ), - ), - ); - }, - (val) { - return state.school.error; - }, - state.school.value, - ), - ProvinceDropdownV2( - 'Provinsi', - (value) { - BlocProvider.of(context).add( - ProvinceEvent( - province: BlocFormItem( - value: value, - ), - ), - ); - }, - (val) { - return state.province.error; - }, - state.province.value.isNotEmpty - ? state.province.value - : 'Provinsi', - ), - BiroBebrasDropdownV2( - 'Bebras Biro', - (value) { - BlocProvider.of(context).add( - BebrasBiroEvent( - bebrasBiro: BlocFormItem( - value: value, - ), - ), - ); - }, - (val) { - return state.bebrasBiro.error; - }, - state.bebrasBiro.value.isNotEmpty - ? state.bebrasBiro.value - : 'Bebras Biro', - ), - BlocConsumer( - bloc: _userRegisterBloc, - listener: (context, state) { - if (state is UserRegisterSuccessState) { - if (widget.isUpdateProfile == 'true') { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: const Text( - 'Profile data successfully updated', - ), - action: SnackBarAction( - label: 'OK', - onPressed: () { - // Some code to undo the change. - }, - ), - ), - ); - } else { - context.go('/main'); - } - } - }, - builder: (context, state) { - return ElevatedButton( - style: ElevatedButton.styleFrom( - fixedSize: Size(size.width, 45), - backgroundColor: Colors.lightBlue, - foregroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - ), - onPressed: () { - if (state is! UserRegisterLoadingState) { - if (widget.isUpdateProfile == 'true') { - BlocProvider.of(context) - .add(const FormSubmitUpdateEvent()); - } else { - BlocProvider.of(context) - .add(const FormSubmitEvent()); - } - } - }, - child: Text( - widget.isUpdateProfile == 'true' - ? 'Perbarui' - : 'Daftar', - style: - const TextStyle(fontWeight: FontWeight.w600), - ), - ); - }, - ), - ], - ), - ), - ), - ); - }, - ), - ), - ); - } -} +// // add notification +// ScaffoldMessenger.of(context).showSnackBar( +// const SnackBar( +// content: Text('Pembaruan data profil berhasil'), +// behavior: SnackBarBehavior.floating, +// ), +// ); +// } else { +// context.go('/main'); +// } +// } +// }, +// child: BlocBuilder( +// builder: (context, state) { +// return BebrasScaffold( +// avoidBottomInset: false, +// body: Padding( +// padding: const EdgeInsets.only( +// left: 16, +// top: 20, +// right: 16, +// ), +// child: Form( +// key: state.formKey, +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.stretch, +// children: [ +// Row( +// children: [ +// GestureDetector( +// onTap: () { +// showModal(); +// }, +// child: Container( +// child: Icon( +// Icons.arrow_back, +// // color: Colors.blue, +// ), +// ), +// ), +// Flexible( +// child: GestureDetector( +// onTap: () async { +// await context.push( +// Uri( +// path: '/register', +// queryParameters: { +// 'isUpdateProfile': 'true', +// }, +// ).toString(), +// ); +// }, +// child: Container( +// // width: double.infinity, +// child: Center( +// child: const Text( +// 'Edit Profile', +// textAlign: TextAlign.start, +// style: TextStyle( +// fontSize: 16, +// fontWeight: FontWeight.bold, +// color: Colors.black, +// ), +// ), +// ), +// ), +// ), +// ), +// ], +// ), +// const SizedBox( +// height: 10, +// ), +// Column(children: [ +// CircleAvatar( +// maxRadius: 50, +// backgroundImage: NetworkImage( +// Assets.bLogo, +// ), +// ), +// const SizedBox( +// height: 15, +// ), +// Text('Putri Nabila', +// textAlign: TextAlign.center, +// style: TextStyle(fontWeight: FontWeight.w600)), +// ]), +// const SizedBox( +// height: 10, +// ), +// CustomTextFieldV2( +// 'Email', +// (value) { +// BlocProvider.of(context).add( +// EmailEvent(email: BlocFormItem(value: value)), +// ); +// }, +// (val) { +// return state.email.error; +// }, +// state.email.value, +// ), +// CustomTextFieldV2( +// 'Nama', +// (value) { +// BlocProvider.of(context) +// .add(NameEvent(name: BlocFormItem(value: value))); +// }, +// (val) { +// return state.name.error; +// }, +// state.name.value, +// ), +// CustomTextFieldV2( +// 'Tempat Lahir', +// (value) { +// // BlocProvider.of(context).add( +// // NameEvent(name: BlocFormItem(value: value)), +// // ); +// }, +// (val) { +// // return state.name.error; +// null; +// }, +// null, +// ), +// CustomDatePickerV2( +// 'Date', +// (value) { +// BlocProvider.of(context).add( +// BirthDateEvent( +// birthDate: BlocFormItem( +// value: value, +// ), +// ), +// ); +// }, +// (val) { +// return state.birthDate.error; +// }, +// state.birthDate.value, +// ), +// CustomTextFieldV2( +// 'Asal Sekolah', +// (value) { +// BlocProvider.of(context).add( +// SchoolEvent( +// school: BlocFormItem( +// value: value, +// ), +// ), +// ); +// }, +// (val) { +// return state.school.error; +// }, +// state.school.value, +// ), +// ProvinceDropdownV2( +// 'Provinsi', +// (value) { +// BlocProvider.of(context).add( +// ProvinceEvent( +// province: BlocFormItem( +// value: value, +// ), +// ), +// ); +// }, +// (val) { +// return state.province.error; +// }, +// state.province.value.isNotEmpty +// ? state.province.value +// : 'Provinsi', +// ), +// BiroBebrasDropdownV2( +// 'Bebras Biro', +// (value) { +// BlocProvider.of(context).add( +// BebrasBiroEvent( +// bebrasBiro: BlocFormItem( +// value: value, +// ), +// ), +// ); +// }, +// (val) { +// return state.bebrasBiro.error; +// }, +// state.bebrasBiro.value.isNotEmpty +// ? state.bebrasBiro.value +// : 'Bebras Biro', +// ), +// BlocConsumer( +// bloc: _userRegisterBloc, +// listener: (context, state) { +// if (state is UserRegisterSuccessState) { +// if (widget.isUpdateProfile == 'true') { +// ScaffoldMessenger.of(context).showSnackBar( +// SnackBar( +// content: const Text( +// 'Profile data successfully updated', +// ), +// action: SnackBarAction( +// label: 'OK', +// onPressed: () { +// // Some code to undo the change. +// }, +// ), +// ), +// ); +// } else { +// context.go('/main'); +// } +// } +// }, +// builder: (context, state) { +// return ElevatedButton( +// style: ElevatedButton.styleFrom( +// fixedSize: Size(size.width, 45), +// backgroundColor: Colors.lightBlue, +// foregroundColor: Colors.white, +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(10), +// ), +// ), +// onPressed: () { +// if (state is! UserRegisterLoadingState) { +// if (widget.isUpdateProfile == 'true') { +// BlocProvider.of(context) +// .add(const FormSubmitUpdateEvent()); +// } else { +// BlocProvider.of(context) +// .add(const FormSubmitEvent()); +// } +// } +// }, +// child: Text( +// widget.isUpdateProfile == 'true' +// ? 'Perbarui' +// : 'Daftar', +// style: +// const TextStyle(fontWeight: FontWeight.w600), +// ), +// ); +// }, +// ), +// ], +// ), +// ), +// ), +// ); +// }, +// ), +// ), +// ); +// } +// } diff --git a/app/lib/features/authentication/register/presentation/pages/v2/widgets/biro_bebras_dropdownV2.dart b/app/lib/features/authentication/register/presentation/pages/v2/widgets/biro_bebras_dropdownV2.dart index 2e3ceb91..a17383c8 100644 --- a/app/lib/features/authentication/register/presentation/pages/v2/widgets/biro_bebras_dropdownV2.dart +++ b/app/lib/features/authentication/register/presentation/pages/v2/widgets/biro_bebras_dropdownV2.dart @@ -30,7 +30,7 @@ class BiroBebrasDropdownV2 extends StatelessWidget { items: bebrasBiroList, dropdownDecoratorProps: DropDownDecoratorProps( textAlignVertical: TextAlignVertical.center, - baseStyle: const TextStyle(fontSize: 12), + baseStyle: const TextStyle(fontSize: 15), dropdownSearchDecoration: InputDecoration( helperText: '', helperStyle: const TextStyle( diff --git a/app/lib/features/authentication/register/presentation/pages/v2/widgets/custom_date_pickerV2.dart b/app/lib/features/authentication/register/presentation/pages/v2/widgets/custom_date_pickerV2.dart index 946ea198..e9a32b3d 100644 --- a/app/lib/features/authentication/register/presentation/pages/v2/widgets/custom_date_pickerV2.dart +++ b/app/lib/features/authentication/register/presentation/pages/v2/widgets/custom_date_pickerV2.dart @@ -40,11 +40,11 @@ class _CustomDatePickerState extends State { child: TextFormField( controller: dateinput, validator: widget.validator, - style: const TextStyle(fontSize: 12, color: Colors.black), + style: const TextStyle(fontSize: 15, color: Colors.black), decoration: InputDecoration( helperText: '', helperStyle: const TextStyle(fontSize: 10), - labelText: widget.labelText, + // labelText: widget.labelText, filled: true, fillColor: Colors.grey.shade200, border: OutlineInputBorder( diff --git a/app/lib/features/authentication/register/presentation/pages/v2/widgets/custom_text_fieldV2.dart b/app/lib/features/authentication/register/presentation/pages/v2/widgets/custom_text_fieldV2.dart index 9edecb8e..cd4457ea 100644 --- a/app/lib/features/authentication/register/presentation/pages/v2/widgets/custom_text_fieldV2.dart +++ b/app/lib/features/authentication/register/presentation/pages/v2/widgets/custom_text_fieldV2.dart @@ -22,11 +22,11 @@ class CustomTextFieldV2 extends StatelessWidget { onChanged: (value) => handleTextInput!(value), validator: validator, initialValue: initValue, - style: const TextStyle(fontSize: 12), + style: const TextStyle(fontSize: 15), decoration: InputDecoration( helperText: '', helperStyle: const TextStyle(fontSize: 10), - labelText: labelText, + // labelText: labelText, filled: true, fillColor: Colors.grey.shade200, border: OutlineInputBorder( diff --git a/app/lib/features/authentication/register/presentation/pages/v2/widgets/province_dropdownV2.dart b/app/lib/features/authentication/register/presentation/pages/v2/widgets/province_dropdownV2.dart index ff519caa..5c178202 100644 --- a/app/lib/features/authentication/register/presentation/pages/v2/widgets/province_dropdownV2.dart +++ b/app/lib/features/authentication/register/presentation/pages/v2/widgets/province_dropdownV2.dart @@ -5,14 +5,14 @@ import '../../../../../../../core/constants/indonesia_province.dart'; class ProvinceDropdownV2 extends StatelessWidget { const ProvinceDropdownV2( - this.labelText, + // this.labelText, this.handleTextInput, this.validator, this.initValue, { super.key, }); - final String labelText; + // final String labelText; final void Function(String value)? handleTextInput; final String? Function(String?)? validator; final String? initValue; @@ -30,11 +30,11 @@ class ProvinceDropdownV2 extends StatelessWidget { items: provinceList, dropdownDecoratorProps: DropDownDecoratorProps( textAlignVertical: TextAlignVertical.center, - baseStyle: const TextStyle(fontSize: 12), + baseStyle: const TextStyle(fontSize: 15), dropdownSearchDecoration: InputDecoration( helperText: '', helperStyle: const TextStyle(fontSize: 10), - hintText: labelText, + // labelText: labelText, filled: true, fillColor: Colors.grey.shade200, border: UnderlineInputBorder( diff --git a/app/lib/features/authentication/register/repositories/register_user_repo.dart b/app/lib/features/authentication/register/repositories/register_user_repo.dart index 561ea750..f2a951ef 100644 --- a/app/lib/features/authentication/register/repositories/register_user_repo.dart +++ b/app/lib/features/authentication/register/repositories/register_user_repo.dart @@ -13,10 +13,10 @@ class RegisterUserRepository { required String userId, required dynamic email, required String name, - // required String birthDate, + required String birthDate, required String school, required String province, - // required String bebrasBiro, + required String bebrasBiro, }) async { try { final now = DateTime.now(); @@ -24,10 +24,10 @@ class RegisterUserRepository { { 'name': name, 'email': email, - // 'birth_date': birthDate, + 'birth_date': birthDate, 'school': school, 'province': province, - // 'bebras_biro': bebrasBiro, + 'bebras_biro': bebrasBiro, 'created_at': now, 'updated_at': now, }, @@ -46,20 +46,20 @@ class RegisterUserRepository { required String userId, required dynamic email, required String name, - // required String birthDate, + required String birthDate, required String school, required String province, - // required String bebrasBiro, + required String bebrasBiro, String? updatedAt, }) async { try { await _firecloud.doc(userId).update({ 'name': name, 'email': email, - // 'birth_date': birthDate, + 'birth_date': birthDate, 'school': school, 'province': province, - // 'bebras_biro': bebrasBiro, + 'bebras_biro': bebrasBiro, 'updated_at': DateTime.now(), }); } on FirebaseException catch (e) {