Skip to content

Commit 928cca6

Browse files
committed
Fix: finish image_picker setup
1 parent f83898b commit 928cca6

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"java.configuration.updateBuildConfiguration": "automatic"
3+
}

ios/Runner/Info.plist

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@
4545
<true/>
4646
<key>UIApplicationSupportsIndirectInputEvents</key>
4747
<true/>
48-
<key>NSPhotoLibraryUsageDescription</key>
49-
<string>Allow DBU Gym to access gallery for profile picture</string>
50-
<key>NSCameraUsageDescription</key>
51-
<string>Allow DBU Gym to access camera for profile picture</string>
52-
<key>NSMicrophoneUsageDescription</key>
53-
<string>Allow DBU Gym to access microphone for video uploads</string>
48+
5449
</dict>
5550
</plist>

lib/views/widgets/signup_login_form.dart

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
// ignore_for_file: must_be_immutable
22

33
import 'package:dbu_gym/controllers/providers/form_provider.dart';
4+
import 'package:dbu_gym/utils/constants.dart';
45
import 'package:dbu_gym/views/widgets/date_picker_input.dart';
56
import 'package:dbu_gym/views/widgets/signup_login_form_input.dart';
67
import 'package:flutter/material.dart';
78
import 'package:go_router/go_router.dart';
9+
import 'package:image_picker/image_picker.dart';
810
import 'package:provider/provider.dart';
911

1012
class FormWidget extends StatelessWidget {
@@ -17,6 +19,7 @@ class FormWidget extends StatelessWidget {
1719
@override
1820
Widget build(BuildContext context) {
1921
final formProvider = Provider.of<FormProvider>(context);
22+
2023
return SingleChildScrollView(
2124
physics: BouncingScrollPhysics(),
2225
padding: EdgeInsets.only(
@@ -42,6 +45,28 @@ class FormWidget extends StatelessWidget {
4245
),
4346
),
4447
SizedBox(height: MediaQuery.of(context).size.height * 0.02),
48+
if (formType == "Sign up")
49+
Stack(
50+
alignment: Alignment(1, 1),
51+
children: [
52+
CircleAvatar(
53+
radius: 36,
54+
),
55+
GestureDetector(
56+
onTap: () async {
57+
final image = await ImagePicker()
58+
.pickImage(source: ImageSource.gallery);
59+
print(image);
60+
},
61+
child: Icon(
62+
Icons.image,
63+
size: 20,
64+
color: Colors.grey.shade400,
65+
),
66+
)
67+
],
68+
),
69+
SizedBox(height: MediaQuery.of(context).size.height * 0.02),
4570
Form(
4671
key: formType == "Login"
4772
? formProvider.loginFormKey

0 commit comments

Comments
 (0)