✔️ Android
✔️ Web
✔️ Windows (Thanks to @alexmercerind)
Import it:
import 'package:system_theme/system_theme.dart';Use the getter SystemTheme.accentInstance.accent to get the system accent color.
final accentColor = SystemTheme.accentInstance.accent;To reload the accent colors, use the method load():
await SystemTheme.accentInstance.load();You can load the colors on main, so the colors can't be wrong at runtime:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await SystemTheme.accentInstance.load();
runApp(MyApp());
}Use the getter SystemTheme.darkMode to check if the device is in dark mode.
final darkMode = await SystemTheme.darkMode;Feel free to open an issue if you find an error or make pull requests.