Docly Child

Flutter Configuration

Estimated reading: 3 minutes

Changing the App's Name

 In the main directory go to the lib -> configs.dart

const APP_NAME = 'YOUR APP NAME';

Changing the Default Language

 In the main directory go to the lib -> utils -> constants.dart

class Constants {
static const defaultLanguage = 'en';
}

Reconfiguring the Server URL

 In the main directory go to the lib -> configs.dart

const DOMAIN_URL = "ADD YOUR BASE URL" ;

Changing the App Font

In the main directory go to the lib -> app_theme.dart

fontFamily: GoogleFonts.FONT_NAME().fontFamily,

Changing Primary Color

 In the main directory go to the lib -> utils -> colors.dart

const appColorPrimary = Color(0xFF2F65B9);

Changing About Us URL

In the main directory go to the lib -> configs.dart

/// Terms and Conditions URL
const TERMS_AND_CONDITIONS_URL = 'TERMS AND CONDITIONS URL';

/// Privacy Policy URL
const PRIVACY_POLICY_URL = 'YOUR PRIVACY POLICY URL';

/// Support URL
const SUPPORT_URL = 'YOUR SUPPORT URL';

Changing OneSignal Id

 In the main directory go to the lib -> configs.dart

/// OneSignal Notification App Id
const ONESIGNAL_APP_ID = 'YOUR ONESIGNAL ID HERE';

Add Keys for Payments

In Main directory go to the lib -> configs.dart file and change your keys.

/// STRIPE PAYMENT DETAIL
const STRIPE_MERCHANT_COUNTRY_CODE = ''; //Add Your Country code
const STRIPE_CURRENCY_CODE = ''; //Add Your Currency Code

/// RAZORPAY PAYMENT DETAIL
const RAZORPAY_CURRENCY_CODE = ''; //Add Your Currency Code

Add Default Country

In Main directory go to the lib -> configs.dart file and change your keys.

Country defaultCountry() 
{ return Country( phoneCode: '', countryCode: '',
e164Sc: ,
geographic: ,
level: ,
name: '',
example: '',
displayName:'',
displayNameNoCountryCode: '',
e164Key: '',
fullExampleWithPlusSign: '',
); }

Changing Consumer Secret and Consumer Key

In Main directory go to the lib -> utils -> constants.dart file and change your keys.

const CONSUMER_KEY = 'YOUR_CONSUMER_KEY';
const CONSUMER_SECRET = 'YOUR_CONSUMER_SECRET';

Reconfiguring the Web Socket Domain

 In the main directory go to the lib -> configs.dart

NOTE: For Better Message Web socket Version.
Do not add (https://) or (http://) in start and slash (/) at the end of your domain.

const WEB_SOCKET_DOMAIN= "ADD YOUR BASE URL" ;

Setup AddMob

  • For AdMob setup, you just need to change the app id, banner id.
  • For that, you have to create a firebase account and create a new application for Android and IOS in AdMob. and then create ad units for both.
  1. Banner Ad
  • Refer Link
  • Now come back to the Application source code.
  • Open lib/config.dart file .
  • To ensure proper functionality on Android, replace the variables “mAdMobAppId” and “mAdMobBannerId” with the respective values, while for iOS, replace “mAdMobAppIdIOS” and “mAdMobBannerIdIOS“.
  • Navigate to android directory => app/main/src/main/ 
    Open your AndroidManifest.xml and add your Android App Id where shown in image below.
  • Now run the application. your ads are now live.
Great! You have successfully configured Flutter!

Leave a Comment

Share this Doc
CONTENTS