make profile picture field not visible and add edit button
This commit is contained in:
@@ -245,17 +245,40 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
|
|||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
backgroundImage: propicPreview,
|
backgroundImage: propicPreview,
|
||||||
//'https://media.licdn.com/dms/image/D4D03AQGd1-QhjtWWpA/profile-displayphoto-shrink_400_400/0/1671698053061?e=2147483647&v=beta&t=a3dJI5yxs5-KeXjj10LcNCFuC9IOfa8nNn3k_Qyr0CA'),
|
//'https://media.licdn.com/dms/image/D4D03AQGd1-QhjtWWpA/profile-displayphoto-shrink_400_400/0/1671698053061?e=2147483647&v=beta&t=a3dJI5yxs5-KeXjj10LcNCFuC9IOfa8nNn3k_Qyr0CA'),
|
||||||
radius: 50,
|
radius: 70,
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 110,
|
width: 155,
|
||||||
child: Image(image: logoFrame),
|
child: Image(image: logoFrame),
|
||||||
)
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: 0,
|
||||||
|
right: 0,
|
||||||
|
child: IconButton.filled(
|
||||||
|
onPressed: () async {
|
||||||
|
FilePickerResult? result = await FilePicker.platform.pickFiles(
|
||||||
|
type: FileType.custom,
|
||||||
|
allowedExtensions: ['jpg', 'png'],
|
||||||
|
);
|
||||||
|
if (result == null) return;
|
||||||
|
final selectedFile = result.files.first;
|
||||||
|
setState(() {
|
||||||
|
proPic = selectedFile;
|
||||||
|
propicPreview = MemoryImage(proPic.bytes!);
|
||||||
|
});
|
||||||
|
|
||||||
|
setState(() {
|
||||||
|
proPicController.text = selectedFile.name;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.edit),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: 60,
|
width: 155,
|
||||||
child: Image(image: logoFrame),
|
child: Image(image: logoFrame),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -292,27 +315,30 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
|
|||||||
bodyItems: [
|
bodyItems: [
|
||||||
displayProPic(),
|
displayProPic(),
|
||||||
const SizedBox(height: 25.0),
|
const SizedBox(height: 25.0),
|
||||||
MIHFileField(
|
Visibility(
|
||||||
controller: proPicController,
|
visible: false,
|
||||||
hintText: "Profile Picture",
|
child: MIHFileField(
|
||||||
editable: false,
|
controller: proPicController,
|
||||||
required: false,
|
hintText: "Profile Picture",
|
||||||
onPressed: () async {
|
editable: false,
|
||||||
FilePickerResult? result = await FilePicker.platform.pickFiles(
|
required: false,
|
||||||
type: FileType.custom,
|
onPressed: () async {
|
||||||
allowedExtensions: ['jpg', 'png'],
|
FilePickerResult? result = await FilePicker.platform.pickFiles(
|
||||||
);
|
type: FileType.custom,
|
||||||
if (result == null) return;
|
allowedExtensions: ['jpg', 'png'],
|
||||||
final selectedFile = result.files.first;
|
);
|
||||||
setState(() {
|
if (result == null) return;
|
||||||
proPic = selectedFile;
|
final selectedFile = result.files.first;
|
||||||
propicPreview = MemoryImage(proPic.bytes!);
|
setState(() {
|
||||||
});
|
proPic = selectedFile;
|
||||||
|
propicPreview = MemoryImage(proPic.bytes!);
|
||||||
|
});
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
proPicController.text = selectedFile.name;
|
proPicController.text = selectedFile.name;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10.0),
|
const SizedBox(height: 10.0),
|
||||||
MIHTextField(
|
MIHTextField(
|
||||||
|
|||||||
Reference in New Issue
Block a user