Country Code #
If you wish, the application will set your country code automatically in the login, register, address screen. To do this, just set up your country in the Admin Panel > Business Settings.
- Additionally, if you want to disable choosing another country code, then open your project and go to <project>/lib/common/basewidget/custom_textfield_widget.dart file and search CodePickerWidget. Now add a parameter with a value like this: enabled: false,
Language #
Add New Language #
If you want to add any new language then follow these steps:
- Go to /assets/language and press the right button on the language folder and create a new file and name it with your language code(.json). For example, if your language is Spanish, then you have to name your file as es.json. You have to name it with a proper and valid language code otherwise, the app won’t work. To get the language and country code, you can visit this URL: https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html
- Copy all data from en.json and paste it into your created file.
- Translate all English text placed here after colon(:) to your expected language. Their texts are in key-value format. You have to translate the value only, not the key. Otherwise, it won’t work. For example: “office”: “Office”, -> “office”: “Oficina”,
- Add your country picture in the <Project>/assets/images folder. Must keep the file extension in png format. For example, spanish.png
- Go to <Project>/lib/utils/images.dart file, add a variable with your country picture name. For example, if your added country picture name is spanish.png, then add a variable like -> static String get spanish => 'spanish'.png;
- Go to <Project>/lib/utils/app_constrants.dart file, scroll down to the bottom and add one more LanguageModel under the languages array with your imageUrl, languageName, countryCode and languageCode. Again must remember that your language code and country code should be valid otherwise, the app won’t work
Remove Existing Language #
- If you wish to eliminate any currently present language, simply exclude the particular LanguageModel from the languages list.
Make Default Language #
- To set your language as the default language, place your LanguageModel at the first index of your language list.
Now uninstall your application from your devices and install it again.
Change App Color #
If you want to customize app theme color then follow these steps :
- Open the <project>/lib/core/theme/light_theme.dart file. Set primaryColor, primarycolorDark, and other colors, and adjust them according to your preferences.
- In the same way for the dark theme, open the <project>/lib/core/theme/dark_theme.dart file. Set primaryColor, primaryColorDark, and other colors, and adjust them according to your preferences.
Change App Font #
At 6valley, we use the Ubuntu font. However, if you want to change the app’s font, then follow these steps:
- Download your preferred font from the internet. Google has many free fonts you can check them: https://fonts.google.com/
- Unzip fonts and paste them to <project>/assets/font/ folder.
- Mentioned them in <project>/pubspec.yaml file like
fonts:
- family: YOUR_FONT_FAMILY_NAME
fonts:
- assets/font/YOUR_FONT_FILE_NAME.ttf
weight: YOUR_FONT_WEIGHT
- Replace the font family name in the <project>/lib/core/theme/light_theme.dart, <project>/lib/core/theme/dark_theme.dart, and <project>/lib/utils/styles.dart files.
Change notification sound #
If you wish to change the notification sound for the web app and also for the Android app, then you need to follow these steps :
Android App :
- Go to <project>/android/app/src/main/res/raw/notification.mp3 > notification.mp3 file. Replace this file with your desired ringtone file. Ensure that you do not change the filename. It must remain as notification.mp3
Note
Please use the exact file name as described; otherwise, it will not work.
Change onboarding text and graphics (Only for User App) #
If you want to customize the onboarding title and content then follow these steps :
- Open <project>/assets/language/en.json. At the top, you will find texts with keys like “on_boarding_1_title” , “on_boarding_data_1”. Simply change the values without changing the keys. Repeat the same process for all languages.
"on_boarding_title_one" : "YOUR_PREFERRED_TITLE",
"on_boarding_title_two" : "YOUR_PREFERRED_CONTENT",
"on_boarding_title_three" : "YOUR_PREFERRED_TITLE,
- If you wish to update the graphics on the onboarding page, go to <project>/assets/images/ and replace onboard_one.gif and onboard_two.gif with your preferred GIF files.
Note
Ensure that you use the same name and extension for your graphics. Otherwise, it will not work.