Flutter Configuration

Estimated reading: 2 minutes 404 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: YOURFONTFAMILYNAME
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 main.dart file and change fontFamily value.

MaterialApp(
  title: 'Custom Fonts',
  theme: ThemeData(fontFamily: 'FontFamilyName'),
  home: MyHomePage(),
);

Change App Colors

In Main directory goto the utils folder and open 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;

Change Server URL

In Main directory goto the utils folder and open constants.dart file and change your Baseurl.

const BaseUrl = 'YOUR SERVER URL';

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="News and Blog"
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 constants.dart file and banner id and interstital id.
const bannerAdIdForAndroid = "YOUR BANNER AD ID FOR ANDROID";
const bannerAdIdForIos = "YOUR BANNER AD ID FOR iOS";
const InterstitialAdIdForAndroid = "YOUR INTERSTITIAL AD ID FOR ANDROID";
const interstitialAdIdForIos = "YOUR INTERSTITIAL AD ID FOR iOS";

Unable and Disable Admob Ads

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

const isAdsDisabled = true;

Change Category list Background

In Main directory goto the utils folder and open constants.dart file and change your isColorImgCat value. if isColorImgCat value true then Images show otherwise can’t show Imges.

const isColorImgCat = true;

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

Flutter Configuration

Or copy link

CONTENTS