Flutter Configuration

Estimated reading: 2 minutes 623 views

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 your base URL

  • Open lib/utils/constants.dart file and change mBaseUrl variable value with your domain.
const mBaseUrl = 'your base URL';

Setup Onesignal push notification

  1. Create a OneSignal Account

      Follow below steps

  • Click on to New App/Website button.
  • Enter the App/website name in AppName Field.
  • Select one platform configure, for Example(iOS,Android,Web push).
  • After Select Any One platform to configure. we can get Firebase Server Key and Firebase Sender Id. If you can select the iOS platform then you can require the production Push Certificate.(.p12 Certificate) and then get the Firebase server Key. Then Click on Save Button.
  • After getting the Firebase Server key and Sender ID. Goto the firebase app and on the left side you see Project overview and settings click on it and select Project Settings. and In Setting. select Cloud messaging. and Enter Server Key and Sender ID and at the end Click into Save Button.
  1. Configure OneSignal on App
  • We have already added code for SDK and other configurations for one signal push notification. Open lib/utils/constants.dart file and replace your OneSignal app ID with mOneSignalAPPKey.
  • For Android and iOS:-
    Follow instructions for OneSignal Configure Here.

Setup AdMob

  • For AdMob setup, you just need to change the app id, banner id, and interstitial id.
  • For that, you have to create a firebase account and create a new application in AdMob. and then create two ad units.
  1. Banner Ad
  2.  Interstitial Ad
  • Refer Link
  • Now come back to the Application source code.
  • Open lib/utils/constants.dart file.
  • And replace mAdMobAppIdmAdMobBannerIdmAdMobInterstitialId ids
  • Now run the application. your ads are now live.

Leave a Comment

Share this Doc

Flutter Configuration

Or copy link

CONTENTS