updateNavigationBar method

dynamic updateNavigationBar([
  1. BuildContext? context
])

Implementation

updateNavigationBar([BuildContext? context]) {
  if (Platform.isAndroid) {
    bool isDarkMode = isDarkModel(context ?? Get.context!);
    if (_themeMode != ThemeMode.system) {
      isDarkMode = _themeMode == ThemeMode.dark;
    }
    SystemChrome.setSystemUIOverlayStyle(
      SystemUiOverlayStyle(
        systemNavigationBarDividerColor: Colors.transparent,
        systemNavigationBarColor: isDarkMode ? Colors.black87 : Colors.white,
        systemNavigationBarIconBrightness: isDarkMode
            ? Brightness.light // Light icons on dark background
            : Brightness.dark,
        statusBarColor: Colors.transparent,
        statusBarIconBrightness:
            isDarkMode ? Brightness.light : Brightness.dark,
        statusBarBrightness: isDarkMode ? Brightness.dark : Brightness.light,
        systemStatusBarContrastEnforced: isDarkMode,
      ),
    );
  }
}