Global Configuration

Estimated reading: 2 minutes 38 views

You can do global configuration of your application via config/global_config.dart. This file stores all application-level configuration that affects the entire dashboard system. Most branding and behavior customization should be done here.

What can be configured here?

You can control:

✔ Branding

  • app name
  • short name
  • description
  • logo path

✔ Themes

  • light/dark
  • palette index
  • enable/disable theme selector

✔ Localization

  • default language
  • available languages
  • RTL mode

✔ Authentication

  • enable/disable auth for demo mode

✔ API layer

  • base URL
  • timeout

Changing the App Name

Dart
static const String appName = "MyCompany Dashboard";
static const String appShortName = "MyCompany";

This name will automatically appear in:

  • Sidebar Header
  • AppBar Title
  • Footer
  • Etc

Switch Theme Mode

Dart
static const ThemeMode initialThemeMode = ThemeMode.dark;

Options:

  • ThemeMode.light
  • ThemeMode.dark
  • ThemeMode.system (follow device)

Default Palette

Dart
static const int defaultThemeIndex = 0;

Index corresponds to your theme configuration under /theme/themes.dart.

Default Language

Dart
static const String defaultLocale = "id";

Supported languages must match folders in /lib/l10n.

Enable Authentication

Dart
static const bool enableAuth = true;

This activates restricted routes inside app_router.dart.

Change API URL

Dart
static const String apiBaseUrl = "https://backend.mydomain.com/api";
static const Duration apiTimeout = Duration(seconds: 10);

Later,You can use apiBaseUrl in your Services.

Enable Right to Left (RTL)

Dart
static const bool isRTL = true;

Useful for Arabic, Hebrew, Persian, etc.


Technical Notes

  • most UI references read AppSettings directly
  • logos must exist in assets/images
  • changing locale requires proper l10n ARB files
  • authentication depends on app_router.dart setup

Share this Doc

Global Configuration

Or copy link

CONTENTS