Closed tayfunuyar closed 3 weeks ago
Hi, The dark and light theme switch is not working correctly when the device is set to the default dark theme in the system settings.
ListTile( dense: true, title: Text('darkMode'.tr(), style: TextStyle(fontSize: 16)), leading: Icon(isThemeDark() ? Icons.dark_mode : Icons.light_mode), trailing: Switch( value: isThemeDark(), onChanged: (value) { NyTheme.set(context, id: value ? 'dark_theme' : 'light_theme'); setState(() {}); }, ), ), bool isThemeDark() { var isThemeDark = ThemeProvider.controllerOf(context).currentThemeId == getEnv('DARK_THEME_ID'); return isThemeDark; }
Hi @tayfunuyar,
I think this is related to this https://github.com/nylo-core/framework/issues/29#issuecomment-1701907118 Check out my comment there 👍
Hi, The dark and light theme switch is not working correctly when the device is set to the default dark theme in the system settings.