Hello, the FF community, This is my first post. Basically I have 2 background colors: greyLight and greyDark, based on it, I want to update the status bar color. Here is the code that I tried, but it doesn't want to compile.
Future<void> statusDynamic(BuildContext context) async { // Determine the appropriate status bar style based on the app's background color SystemUiOverlayStyle style; if (FlutterFlowTheme.of(context).backgroundColor == FlutterFlowTheme.of(context).greyLight) { style = SystemUiOverlayStyle.dark.copyWith( statusBarIconBrightness: Brightness.dark, ); } else if (FlutterFlowTheme.of(context).backgroundColor == FlutterFlowTheme.of(context).greyDark) { style = SystemUiOverlayStyle.light.copyWith( statusBarIconBrightness: Brightness.light, ); } // Apply the determined status bar style SystemChrome.setSystemUIOverlayStyle(style); }