@@ -8,6 +8,7 @@ import 'package:dbu_gym/models/gym_user.dart';
8
8
import 'package:dbu_gym/providers/form_provider.dart' ;
9
9
import 'package:dbu_gym/providers/image_provider.dart' ;
10
10
import 'package:dbu_gym/utils/clear_form_inputs.dart' ;
11
+ import 'package:dbu_gym/utils/constants.dart' ;
11
12
import 'package:dbu_gym/views/pages/image_pick_selector.dart' ;
12
13
import 'package:dbu_gym/views/widgets/date_picker_input.dart' ;
13
14
import 'package:dbu_gym/views/widgets/signup_form_drop_down_btn.dart' ;
@@ -88,31 +89,34 @@ class _FormWidgetState extends State<FormWidget> {
88
89
children: [
89
90
CircleAvatar (
90
91
radius: 36 ,
91
- backgroundImage: imageProvider.profileImagePath != null
92
- ? FileImage (File (imageProvider.profileImagePath! ))
93
- : null ,
94
- child: imageProvider.profileImagePath == null
95
- ? Icon (Icons .person, size: 48 )
96
- : null ,
97
- ),
98
- GestureDetector (
99
- onTap: () {
100
- formProvider.setSelectedImagePicker ("profilePicture" );
101
- showModalBottomSheet (
102
- showDragHandle: true ,
103
- constraints: BoxConstraints .tight (Size (
104
- MediaQuery .of (context).size.width,
105
- MediaQuery .of (context).size.height * 0.3 )),
106
- context: context,
107
- builder: (context) => ImagePickSelector (),
108
- );
109
- },
110
- child: Icon (
111
- Icons .add,
112
- size: 30 ,
113
- color: Theme .of (context).colorScheme.primary,
92
+ backgroundImage: AssetImage (
93
+ "assets/images/profile_image/naruto_on_muscles.jpg" ,
114
94
),
115
- )
95
+ // child: imageProvider.profileImagePath == null
96
+ // ? Icon(Icons.person, size: 48)
97
+ // : null,
98
+ ),
99
+ // ******************************************************** */
100
+ // ! To be included in the next update
101
+ // GestureDetector(
102
+ // onTap: () {
103
+ // formProvider.setSelectedImagePicker("profilePicture");
104
+ // showModalBottomSheet(
105
+ // showDragHandle: true,
106
+ // constraints: BoxConstraints.tight(Size(
107
+ // MediaQuery.of(context).size.width,
108
+ // MediaQuery.of(context).size.height * 0.3)),
109
+ // context: context,
110
+ // builder: (context) => ImagePickSelector(),
111
+ // );
112
+ // },
113
+ // child: Icon(
114
+ // Icons.add,
115
+ // size: 30,
116
+ // color: Theme.of(context).colorScheme.primary,
117
+ // ),
118
+ // )
119
+ // ******************************************************** */
116
120
],
117
121
),
118
122
SizedBox (height: MediaQuery .of (context).size.height * 0.02 ),
@@ -439,35 +443,39 @@ class _FormWidgetState extends State<FormWidget> {
439
443
endDate: _endDateController.text,
440
444
context: context,
441
445
);
442
-
443
- if (imageProvider.profileImagePath == null ) {
444
- // if the form is sign up form and user didn't provide profile image, show an error snackbar
445
- CustomError error = CustomError (
446
- errorTitle: "Error" ,
447
- errorBody: "Please provide a profile picture" ,
448
- );
449
- error.showError (context);
450
- }
446
+ // ****************************** * /
447
+ // ! To be included in the next update
448
+ // if (imageProvider.profileImagePath == null) {
449
+ // // if the form is sign up form and user didn't provide profile image, show an error snackbar
450
+ // CustomError error = CustomError(
451
+ // errorTitle: "Error",
452
+ // errorBody: "Please provide a profile picture",
453
+ // );
454
+ // error.showError(context);
455
+ // }
456
+ // ****************************** * /
451
457
// valid sign up inputs
452
458
if (formProvider.signUpFormKey.currentState! .validate () &&
453
459
! formProvider.hasPassRepassInputError &&
454
460
! formProvider.hasDateInputError &&
455
- imageProvider.profileImagePath != null &&
456
461
formProvider.affiliationStatusError == null ) {
457
462
formProvider.setIsAuthtentcating (true );
458
463
// set image profile field from image provider
459
464
460
465
// catch is there is storage uploading error
461
- Either <CustomError , String > profileUploadRes =
462
- await formProvider.uploadProfileImage (
463
- imageProvider.profileImagePath! ,
464
- imageProvider.profileImageName! ,
465
- );
466
- // show error if profile upload returns an error
467
- profileUploadRes.fold ((err) {
468
- err.showError (context);
469
- }, (r) => null );
466
+ // ****************************** * /
467
+ // ! To be included in the next update
468
+ // Either<CustomError, String> profileUploadRes =
469
+ // await formProvider.uploadProfileImage(
470
+ // imageProvider.profileImagePath!,
471
+ // imageProvider.profileImageName!,
472
+ // );
470
473
474
+ // show error if profile upload returns an error
475
+ // profileUploadRes.fold((err) {
476
+ // err.showError(context);
477
+ // }, (r) => null);
478
+ // ****************************** * /
471
479
if (formProvider.affiliationStatus == 'insider' ) {
472
480
Either <CustomError , String > idImageRes =
473
481
await formProvider.uploadIdImage (
@@ -490,7 +498,7 @@ class _FormWidgetState extends State<FormWidget> {
490
498
numWorkoutDays: formProvider.selectedWorkoutDays,
491
499
subscribedWorkoutType:
492
500
formProvider.preferedWorkoutType,
493
- profileImageUrl: formProvider. profileImageUrl,
501
+ profileImageUrl: profileImageUrl,
494
502
phoneNumber: _phoneNumberController.text,
495
503
createdAt: DateTime .now (),
496
504
paymentHistory: [],
0 commit comments