I've been developing in Linux but it seems I can't detect the brightness inside Theme.of(context).brightness.
So I just grab the current scaffold background color if its black or white.
bool kIsDarkMode(BuildContext context) {
return Theme.of(context).scaffoldBackgroundColor == MyColors.black;
}