Flutter Configuration

Estimated reading: 4 minutes 739 views

Change App Font

1.In the main directory, go to font folder and add respective font file.

2.After Adding ttf file in fonts folder open add this code end of the pubspec.yaml file.

fonts:
- family: YOUR_FONT_FAMILY_NAME
fonts:
- asset: fonts/YourRegularFontFamilyName.ttf
- asset: fonts/YourBoldFontFamilyName.ttf

Important:

pattern follow when add code in Pubspec.yaml file.

3. Click in to pub get

4. Open Strings.dart file inside lib/utils/ folder and change font value as your family name.

const font = "YOUR_FONT_FAMILY_NAME";

Change App Colors

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

import 'package:flutter/material.dart';

const Color PRIMARY_COLOR = Color(0xff4268cd);

Configure app with your server

In Main directory Goto the lib/utils folder and open config.dart file and change your url.

String BASE_URL = 'https://Your_Server_Url/wp-json/';

Configure your Consumer Secret and Consumer Key

In Main directory Goto the lib/utils folder and open config.dart file and change your keys.

String CONSUMER_SECRET = 'YOUR_CONSUMER_SECRET_JKEY';
String CONSUMER_KEY = 'YOUR_CONSUMER_KEY';

Update your loader effect

If you want to update loader effect for your app loading, book loader, load more book loader and Download book loader then change below json file with your new json file and put into assets folder.

Download your new json file from: https://lottiefiles.com/

const BOOK_LOADER = 'assets/book_loader.json';
const MORE_DATA_LOADER = 'assets/more_data_loader2.json';
const APP_LOADER = 'assets/app_loader.json';
const FILE_DOWNLOAD_LOADER = 'assets/downloading.json';

How to change default language of app.

In Main directory Goto the lib/utils folder and open config.dart file and change your language code.

const String DEFAULT_LANGUAGE_CODE = "en";

How to change app language

Open Global/select app language and click on save changes.

Supported language code:

  • English (“en”)
  • Hindi (“hi”)
  • French (“fr”)
  • Spanish (“es”)
  • German (“de”)
  • Indonesian (“in”)
  • Afrikaans (“af”)
  • Portuguese (“pt”)
  • Turkish (“tr”)
  • Arabic (“ar”)
  • Vietnamese (“vi”)

How to add language of app

1. In the Main directory Goto the lang folder and create a new file.

The file name must be languagecode.json.

For example: en.json

{
"key":"value",
...
}

Important:

The key name must be same as other. Only value is changed

2. After Adding json file in lang folder.Open pubspec.yaml file and add this code in asset.

assets:
- lang/filename.json

Important:

pattern follow when add code in Pubspec.yaml file.

3. Click in to pub get

4. In Main directory Goto the lib folder and open app_localization.dart file and add your language code.

5. In Main directory Goto the lib folder and open app_state.dart file and add code.

6. In Main directory Goto the lib folder and open main.dart file and add code.

Change Admob App ID

  • Open the android project and open AndoridManifest.xml file. and change your App Id.
<application
android:name="io.flutter.app.FlutterApplication"
android:label="BookKart"
android:icon="@mipmap/ic_launcher">
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="YOUR ADS APPLICATION ID"/>
  • In iOS open iOS project and open info.plist and change Admob App Id.
  • open utils folder and open lib/utils/config.dart file and change banner id and interstital id.
const BANNER_AD_ID_ANDROID = "YOUR_KEY;
const BANNER_AD_ID_IOS = "YOUR_KEY";
const INTERSTITIAL_AD_ID_ANDROID = "YOUR_KEY";
const INTERSTITIAL_AD_ID_IOS = "YOUR_KEY";

Unable and Disable Admob Ads

In Main directory goto the utils folder and open Constants.dart file and change your isAdsLoading value. if isAdsLoading value true then ads show otherwise can’t show ads.

const isAdsLoading = true;

Change Payment Method

Open Wp-Admin. Open Global/select payment method and click on save changes.

Leave a Comment

Share this Doc

Flutter Configuration

Or copy link

CONTENTS