import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:image_picker/image_picker.dart'; import 'package:job_app/singletons/profile_image.dart'; import 'package:modal_bottom_sheet/modal_bottom_sheet.dart'; import 'package:permission_handler/permission_handler.dart'; Future updateProfilePicture(BuildContext context)async { return showMaterialModalBottomSheet( context: context, backgroundColor: Colors.white, builder: (context)=>Container( height: MediaQuery.of(context).size.height * 0.25, child: Padding( padding: const EdgeInsets.all(22.0), child: Row( children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "Profile photo", style: TextStyle( color: Colors.black, fontFamily: 'MontserratSemiBold', fontSize: 18), ), SizedBox( height: 15, ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ GestureDetector( onTap: ()async{ var storageStatus =await Permission.storage.status; if(!storageStatus.isGranted){ await Permission.storage.request(); ProfileImage profileImage = ProfileImage(); await profileImage.pickImage(ImageSource.gallery); }else if(storageStatus.isGranted){ ProfileImage profileImage = ProfileImage(); await profileImage.pickImage(ImageSource.gallery); } }, child: Column( children: [ SvgPicture.asset( 'assets/icons/fromGallery.svg', height: 60, ), Text( "From gallery", style: TextStyle( fontFamily: 'MontserratExtraLight', fontSize: 14, fontWeight: FontWeight .bold), ) ], ), ), SizedBox( width: 40, ), Column( children: [ SvgPicture.asset( 'assets/icons/fromCamera.svg', height: 70, ), Text( "From Camera", style: TextStyle( fontFamily: 'MontserratExtraLight', fontSize: 14, fontWeight: FontWeight .bold), ) ], ), ], ) ], ), ], ), ), ) ); }