# Edit Profile Screen

Complete the following steps to configure edit profile.

  1. Create folder lib/services/profile

  2. Add latest image_picker (opens new window) package to pubspec.yaml

  3. Add NSCameraUsageDescription, NSMicrophoneUsageDescription and NSPhotoLibraryUsageDescription to ios/Runner/info.plist










 
 
 
 
 
 




<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>$(DEVELOPMENT_LANGUAGE)</string>

  ....

  <key>NSCameraUsageDescription</key>
  <string>To set or update your profile picture, the app needs access to your device's camera.</string>
  <key>NSMicrophoneUsageDescription</key>
  <string>Not using</string>
  <key>NSPhotoLibraryUsageDescription</key>
  <string>To set or update your profile picture, the app needs access to your photo library.</string>
</dict>
</plist>

  1. Add latest image_cropper (opens new window) package to pubspec.yaml

  2. Add UCropActivity to android/app/src/AndroidManifest.xml






 
 
 
 

















<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        android:label="Hunt Fitness"
        android:name="${applicationName}"
        android:icon="@mipmap/launcher_icon">
        <activity
            android:name="com.yalantis.ucrop.UCropActivity"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
        <activity
            android:name=".MainActivity"
            android:exported="true">
            ...
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
    <queries>
        ...
    </queries>
</manifest>

  1. Add latest flutter_image_compress (opens new window) package to pubspec.yaml

  2. Add latest cached_network_image (opens new window) package to pubspec.yaml

  3. Add latest firebase_storage (opens new window) package to pubspec.yaml

  4. Run pub get

  5. Delete ios/Podfile.lock and run pod install on terminal

  6. Open firebase console on web.

    • Under Build click storage

    • Click Get Started button

    • Choose Start in production mode and click Next

    • Click Done

    • Change storage rules as

      rules_version = '2';
      
      service firebase.storage {
        match /b/{bucket}/o {
          match /{allPaths=**} {
            allow read: if true;
            allow write: if request.auth != null;
          }
        }
      }
      
  7. Download edit_profile folder from here (opens new window) and add it inside lib/services/profile/ folder

# Edit Profile Test

  1. Update image on iOS and Android
  2. Update name on iOS and Android