Flutter Configuration
Setting up Flutter for your Pawlly Project
Change The App Name
In the main directory, go to lib -> configs.dart
const APP_NAME = 'YOUR APP NAME';
Reconfiguring The Server URL
In the main directory, go to lib -> utils -> configs.dart
const DOMAIN_URL = "ADD YOUR DOMAIN URL";
Change The Default Language
In the main directory, go to lib -> configs.dart
const DEFAULT_LANGUAGE = "LANGUAGE CODE"; // (e.g., "en", "ar", "de", "pt", "es")
- Set the language code from the provided list
["en", "ar", "de", "pt", "es"]
for supported languages in the application. For other languages, customization is required. - Use only the language code, not the entire language name. You can find the language codes here.
Change The App Font
In the main directory, go to lib -> app_theme.dart
fontFamily: GoogleFonts.FONT_NAME().fontFamily,
textTheme: GoogleFonts.FONT_NAMETextTheme(),
Remember to apply these steps to both the DarkTheme and LightTheme in the app_theme.dart file to ensure consistent behavior across your app's themes.
Change Primary & Secondary Color
In the main directory, go to lib -> utils -> colors.dart
var primaryColor = Color(0xFF9D67EF);
var secondaryColor = Color(0xFFFD866E);
Best practice and setting the hex value after 0xFF, you can avoid unexpected color rendering issues and ensure consistent appearance of your UI elements.
Add FirebaseOptions
After completion of Firebase Configuration you can proceed further.
In the main directory, go to lib -> config.dart.
final FirebaseOptions firebaseConfig = FirebaseOptions(
appId: isIOS?"FIREBASE iOS APP ID":"FIREBASE ANDROID APP ID",
apiKey: 'FIREBASE API KEY',
projectId: 'FIREBASE PROJECT ID',
messagingSenderId: 'FIREBASE SENDER ID',
storageBucket: 'FIREBASE STORAGE BUCKET',
iosBundleId: 'FIREBASE iOS',
);
- Open your Firebase Console.
For apiKey go to Project Settings and Click on General Tab you’ll find Web API Key and Project ID and paste it all blocks in dart file mentioned above.
Scroll Down and in Your Apps section you’ll find App Id in Android and iOS section.
Copy respective App ID and paste it to appId.
Copy Bundle ID and paste it to iosBundleId.
For messagingSenderId Click on Cloud Messaging you will see Sender ID. Copy that paste it to messagingSenderId.
For storageBucket
Navigate to android → app
Open google-service.json
Under "project_info find "storage_bucket" and Copy value and paste it intostorageBucket.
Note - You can leave it empty as well.
Assign firebaseConfig in Firebase Initialization
- Open main.dart
- You will find Firebase.initializeApp in void main() method.
- assign firebaseConfig to options.
await Firebase.initializeApp(options: firebaseConfig);
Update Notification Icon Name
After creating notification icon you can perform this change.
How generate notification icon?
- Open lib → utils → firebase_messaging_utils.dart.
- In showNotification() method find lines below
const AndroidInitializationSettings initializationSettingsAndroid = AndroidInitializationSettings('@drawable/YOUR NOTIFICATION ICON NAME');
var androidPlatformChannelSpecifics = AndroidNotificationDetails(
'notification',
'Notification',
importance: Importance.high,
visibility: NotificationVisibility.public,
autoCancel: true,
//color: primaryColor,
playSound: true,
priority: Priority.high,
icon: '@drawable/YOUR NOTIFICATION ICON NAME',
);
for android devices do configure steps mention in the documentation - here for iOS devices do configure steps mention in the documentation - here