## Introduction

- Thank you for choosing the EraShop app. We are pleased to have you with us. Enclosed is the documentation to help you set up and launch the app easily. Please read it carefully, as it contains important information. If you need any assistance or have questions, our support team is just a message away.

## Prerequisites

- If you use the specified versions, our code will work properly because the libraries and SDKs we used have not been updated yet. Whenever those libraries are updated, we will also update the code accordingly. As long as you use the same versions, the code will function exactly as shown in the demo app without any issues, so there’s no need to worry.

- We have used the following versions in this project, so you also need to use the same while setting it up:
  - Flutter 3.32.5
  - Java 21.0.5
  - Android Studio Narwhal | 2025.1.1 Patch 1

- To modify this project, it's essential to ensure that Flutter and Dart are installed and properly configured on your computer.
- If you have already installed and configured the Android SDK, the steps to install Flutter are as follows:

1. Download the Flutter SDK from the official website and extract it.
2. Add the path to the previously extracted SDK to your PATH variable.
3. Run the flutter doctor tool to verify if everything is configured correctly.

- For detailed instructions, please refer to the following documentation:https://flutter.dev/docs/get-started/install/

## Android Studio Windows Setup

- Download Android Studio from the official website:https://developer.android.com/studio/
- Access the Flutter SDK through:https://flutter.dev/docs/get-started/install
- For further information on Android Studio, visit:https://developer.android.com/studio/intro/

### Step 1 : Get the Flutter SDK

- Please download the provided installation bundle to access the latest stable release of the Flutter SDK.
- Upon downloading, extract the zip file and place the 'flutter' directory in your chosen installation directory for the Flutter SDK (e.g., C:\src\flutter). Avoid installing Flutter in directories such as C:\Program Files, as it may require elevated privileges.

### Step 2 : Update your path

- To enable running Flutter commands in the regular Windows console, follow these steps to add Flutter to the PATH environment variable:

1. Open the Start menu and search for 'env', then select 'Edit environment variables for your account'.
2. In the User variables section, check if there is an entry named Path.
3. If the Path entry already exists, append the full path to the flutter\bin directory using ; as a separator from existing values.
4. If the Path entry doesn’t exist, create a new user variable named Path and set its value to the full path to the flutter\bin directory.
5. Remember to close and reopen any existing console windows for these changes to take effect.
6. You are now prepared to run Flutter commands in the Flutter Console!

### Step 3 : Run flutter doctor

- From a console window with the Flutter directory added to the PATH (as described above), execute the following command to check for any platform dependencies that may be required to complete the setup:

flutter doctor

- If any complications arise during the environment setup, kindly refer to our online resources for guidance. Please click the following link to access:Click Here

## Android Studio macOS​ setup​

- Download Android Studio from the official website:https://developer.android.com/studio/
- Download Xcode from the App Store:https://apps.apple.com/us/app/xcode/id497799835?mt=12 .
- Access the Flutter SDK through:https://flutter.dev/docs/get-started/install
- For further information on Android Studio, visit:https://developer.android.com/studio/intro/

### Step 1 : Get the Flutter SDK

- Please download the provided installation bundle to acquire the latest stable release of the Flutter SDK.
- After downloading, extract the SDK by double-clicking on the downloaded file. Subsequently, copy the extracted folder and paste it into your desired location, such as Documents\flutter.

### Step 2 : Update your path

- To update the PATH variable and access the "flutter" command from the terminal, follow these steps:

1. Open the terminal.
2. For updating the PATH variable for the current terminal window only, enter the command:
export PATH="$PATH:`pwd`/flutter/bin"
3. To update the PATH variable permanently, open or create the .bash_profile file by entering:
sudo open -e $HOME/.bash_profile
4. Append the following line to the .bash_profile file, placing it at the bottom:
export PATH="$PATH:[PATH_TO_FLUTTER_SDK_DIRECTORY]/flutter/bin"
5. Replace [PATH_TO_FLUTTER_SDK_DIRECTORY] with the actual path to the Flutter SDK folder.
6. Refresh the PATH variables by running the command:
source $HOME/.bash_profile
7. Verify that the SDK is successfully installed by running:
flutter doctor

- If the check list of Flutter SDK requirements is displayed, the SDK is successfully installed, and you can proceed with building Flutter apps.
- For troubleshooting during environment setup on macOS, refer to our online resourcesClick Here

## SetUp Resend ( Email - Password Login )

- You will need to create an API key as shown in the image below. For reference, please refer to the Resend API Key documentation.Resend
- Once the API key is generated, update it in the settings to enable email-password login functionality, as demonstrated in the image below.

## Configure Firebase

- Please navigate to your Firebase project, which you may have created while following the backend documentation. If you haven't created one yet, please follow the steps below to set up a project:

1. Begin by visiting the Firebase website through the following link: https://firebase.google.com/
2. If you do not already have a Firebase account, kindly sign up for one. Otherwise, proceed to sign in with your existing account credentials.
3. Upon successful login, you will be directed to the Firebase Console. Click on the "Add project" button to initiate the creation of a new project.
4. Enter a suitable name for your project and configure your preferred options for Firebase Analytics and Google Analytics. Subsequently, click on the "Continue" button.
5. First, select the default Firebase account, then proceed to create the project.

## Download Firebase Private Key

- Here's a step-by-step guide to downloading your Firebase private key in a professional manner:

1. If you have multiple projects, select the Firebase project for which you need the private key.
2. Click on the gear icon (Settings) next to "Project Overview" on the top left corner of the Firebase Console.
3. In the project settings, navigate to the "Service Accounts" tab.
4. Scroll down to the "Firebase Admin SDK" section.
5. Click on the "Generate New Private Key" button.
6. A prompt will appear asking you to confirm your action.
7. Once downloaded, store the JSON file containing the private key securely on your local machine.
8. Please update the downloaded private key file in the 'Private Key' section of the Firebase Notification settings.

#### Add Android App To Firebase

- In the next step, we have to choose the platform to add Firebase to our application. Click on Android.
- The platform can be Android, iOS, Web etc..
- Your package name is generally the applicationId in your build.gradle (app-level) file
- Refer to thePagefor guidance on utilizing keytool to obtain the SHA-1 hash of your signing certificate.
- Add your applicationid in the first field and SHA-1 to the third field as shown in the image below.
- Download the google-services.json file & place it in your project's app root directory.
- Back in the Firebase console-setup workflow, click Next to skip the remaining steps and then finish and complete

### Step 1 : Enter SHA Key in firebase console

- If you fail to provide the SHA-1 key in the Firebase project, functionalities such as phone login and Google login will be impaired.
- It is essential to add your SHA-1 keys for both debug and live modes to ensure seamless operation.

#### Add IOS App In Firebase

- we have to choose the platform to add Firebase to our application. Click on iOS.
- On the next screen, enter your iOS bundle ID & App nickname and click on Register App. You can find your bundle ID in the General tab for your app's primary target in Xcode. If specified, the app nickname will be used throughout the Firebase console to represent this app. Nicknames aren't visible to users.
- Download the GoogleService-Info.plist file & move the GoogleService-Info.plist file you just downloaded into the root of your Xcode project and add it to all targets.
- Back in the Firebase console-setup workflow, click Next to skip the remaining steps and then finish and complete

### Step 1 : Enter SHA Key in firebase console

- If you fail to provide the SHA-1 key in the Firebase project, functionalities such as phone login and Google login will be impaired.
- It is essential to add your SHA-1 keys for both debug and live modes to ensure seamless operation.

## Google Sign In Configuration

- Navigate to the "Authentication" section and select the "Sign-in method" tab.
- Click to Enable
- Select your support email and save
- Google sign-in method has been successfully enabled.

#### Create APNs Auth Key For Push Notification

1. Navigate to https://developer.apple.com/account.
2. Log in using your Apple developer credentials.
3. Obtain a provider certificate from your developer account. This can be found in the "Certificates" section, as depicted in the image below.
4. Select the "Certificate, IDs & Profiles" tab.
5. Select the "Keys" tab.
6. Click on the "+" button.
7. A key can be generated which gives the FCM full access over the Apple Push Notification service (APNs). On the "Keys" menu item, register a new key. The name of the key can be anything, however you must ensure the APNs service is enabled.
8. Click "Continue" & then "Save". Once saved, you will be presented with a screen displaying the private "Key ID" & the ability to download the key. Copy the ID, and download the file to your local machine.
9. Copy the Key ID and download the file.
10. The file & Key ID can now be added to your Firebase Project. On the Firebase Console, navigate to the "Project settings" and select the "Cloud Messaging" tab. Select your iOS application under the "iOS app configuration" heading.s
11. Upload the downloaded file and enter the Key & Team IDs;

## SetUp Zego Cloud

- Open the Zego Cloud consoleClick Here
- Generate a Zego App ID.
- To use the live-streaming function, you must generate a secret key in the Zego Cloud console.
- Enter the Zego Cloud App ID and Zego Cloud App Sign In details in the admin panel under the settings section.

## Extract The Project

- To import the app, open Android Studio and import or open the template. Ensure that you wait for all processes, including the Gradle Build, to complete before proceeding to the next step.
- To install the Flutter and Dart plugins, follow these steps:

1. Click on the settings button located in the corner.
2. A pop-up will appear. Select "Plugins".
3. In the search bar within the pop-up, enter the names of the plugins you wish to install (as shown in the image below).

- Click on "Open" and open your project.
- A pop-up will appear; select your project and then click on the "Ok" button.
- In some cases, the Gradle Build may fail. If additional components are required, Android Studio will prompt you to download them in the 'messages' tab. Simply follow the instructions provided to install and download the necessary additional components.

## Change baseURL And secretKey

- Change baseURL and secretkey in lib > utiles > app_url.dart as shown in the image below.
- This baseURL and secretkey should be consistently applied across ourback-end,front-endandapp-codeto ensure uniform protection.

## Change Package Name

- Android
  - Navigate to the "android/app" directory and locate the "build.gradle" file.
  - Within this file, update the "applicationId" and its corresponding dependencies as necessary

- IOS

- Please initiate a right-click on the iOS directory, followed by selecting "Flutter" and then "Open iOS module in Xcode" to proceed further.
- After successfully opening the project in Xcode, proceed to the following steps:

1. Navigate to "Runner" > "Signing & Capabilities".
2. Modify the bundle identifier according to your requirements.
3. Save the changes, and the process is complete.

## Change App Color

- Go to your project lib > utils > color_res.dart as shown in the below image.

## Change App Icon

- To generate icons of various sizes for both iOS and Android platforms,visit
- Upload the icon image, select the desired options for iPhone and Android compatibility, and click on "Generate". This website will efficiently produce icons in multiple sizes for both platforms simultaneously.
- Upon completion, the website will download a ZIP file named "AppIcons", containing folders named "android" and "Assets.xcassets", along with images suitable for the App Store and Google Play Store. These assets can be directly uploaded as icons in both app stores.
- Please open your project in Android Studio.
- Android
  - Navigate to the "android/app/src/main/res" directory in your project. Right-click on the "res" folder and select "open in Finder". Once in Finder, delete all the existing mipmap folders. Then, paste the mipmap folders from the AppIcon/android directory that you have downloaded.
- IOS
  - Navigate to the "ios/Runner directory and locate the ".xcassets" file. Right-click on the "Runner" folder and select "open in Finder". Once in Finder, delete the "Assets.xcassets" folder. Then, paste the "Assets.xcassets" folder from the "AppIcon" directory that you have downloaded.
- After replacing the images in the Android and iOS folders manually, proceed to "lib/main.dart" and run the Flutter project using the following command in the Flutter console.
flutter run

## Change App Name

- Andriod
  - Navigate to "android/app/src/main/AndroidManifest.xml" and make the changes as depicted in the provided image.
- IOS
  - Please right-click on the "iOS" directory, then navigate to "Runner", and select "info.plist". Finally, open the iOS module in Xcode.

## Build Debug APK

- To generate APK (Application Package File) for distribution and installation on Android devices, Flutter provides a straightforward method using the "flutter build apk" command. Below, we outline the steps involved in building APK files for Android using Flutter.

1. Navigate to your project location.
2. Access the build options by following this path: "Build" > "Flutter" > "Build APK".

## Release APK

- Execute the following command: "flutter build apk --release", as demonstrated in the image below.
flutter build apk --release
- Once the APK has been successfully generated, it will be automatically saved to the specified destination, as illustrated in the image below.

## Want to talk with us?

Email : incodeslab@gmail.com

Whatsapp : +91 9909515320

>