Docly Child

Flutter Configuration

Estimated reading: 3 minutes

Basic App configuration

Note: Without this configuration may be your app not works as you want. Do given below steps Inside configs.dart file.
Open lib->configs.dart,

1. Replace your app name,

const APP_NAME = 'YOUR APP NAME ADD HERE';

2. Add your domain URL (NOTE: Do not add slash (/) at the end of your domain.)

 const DOMAIN_URL = 'YOUR DOMAIN NAME ADD HERE';

3. Replace your site URL to redirect user to your main site,

 const SITE_URL = 'YOUR SITE URL ADD HERE';

4. Replace your main address,

const MAILTO = "YOUR MAIN ADDRESS";

5. Replace your Terms and conditions and Privacy policy URLs for users as well as play store reviewers to check your confidentiality and data protection,

const TERMS_CONDITION = "YOUR TEMS AND CONDITION URL";
const POLICY = "YOUR PRIVACY POLICY URL"; 

6. Change app icon and splash screen icon,

const APP_ICON = 'YOUR MAIN ICON';
const APP_ICON_RB = 'YOUR SPLASH SCREEN ICON';

7. Change the OneSignal Notification ID to notify your user when a new post is uploaded.

const ONESIGNAL_APP_ID = 'YOUR ONESIGNAL ID';

8. Replace Google AdMob Ids for display banners or interstitial ads,

const appID = 'ADMOB AD ID';
const BANNER_AD_ID_FOR_ANDROID = 'BANNER AD ID';
const INTERSTITIAL_AD_ID_FOR_ANDROID = INTERSTITIAL AD ID';

 Note : If you haven’t set up AdMob then follow the steps below.

  • Refer Link
  • Come back to the Application source code.
  • Open lib/config.dart file .
  • To ensure proper functionality on Android, replace the variables “appID” and “BANNER_AD_ID_FOR_ANDROID” with the respective values, while for iOS, replace “BANNER_AD_ID_FOR_IOS” and “INTERSTITIAL_AD_ID_FOR_IOS”.
  • Now run the application. your ads are now live.

9. Change the Google AdMob App ID inside the AndroidMenifest.xml and Info.plist  file. Note that this is an important step to display ads without this your app may crash.

For Android,
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="GOOGLE ADMOB APP ID" />

For iOS,
<key>GADApplicationIdentifier</key>
<string>GOOGLE ADMOB APP ID</string>

Unable Or Disable Admob Ads

In Main directory goto the utils folder and open lib/utils/constants.dart file and change isAdsDisabled value. if isAdsDisabled value false then ads show otherwise can’t show ads.

const isAdsDisabled = true;

Change App Colors

In Main directory goto the utils folder and open lib/utils/colors.dart file  and Change Color code.

import 'package:flutter/material.dart';

const primaryColor = Color(0xFFffb4b8);
const textColorPrimary = Color(0xFF212121);
const textColorSecondary = Color(0xFF757575);
const whiteColor = Colors.white;

Set language for all user or Set language manually from mobile

In Main directory goto the utils folder and open constants.dart file and change your isLanguageEnable value. if isLanguageEnable  = false then set language for all user other wise set language manually from mobile.

const isLanguageEnable = false;

Leave a Comment

Share this Doc
CONTENTS