Access Variable form another class in top level function Flutter

I have a background notification handler in my flutter app, which is a top-level function like so: Future<void> _onBackgroundMessage(RemoteMessage message) async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); final chatClient = StreamChatClient(STREAM_API_KEY); print(Utils.user?.uid); print(Utils.user?.streamToken); chatClient.connectUser( su.User(id: Utils.user?.uid ?? ”), Utils.user?.streamToken ?? ”, connectWebSocket: false, ); NotificationUtils.handleGetStreamNotification(message, chatClient); SharedPreferences prefs = await SharedPreferences.getInstance(); int appBadgeCounter = prefs.getInt(appBadgePrefsKey) ?? 0;… Read More Access Variable form another class in top level function Flutter

Android 12 Kotlin – Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable

This is the code for pendingIntent: val pi = PendingIntent.getActivity( applicationContext, 0, ii, PendingIntent.FLAG_UPDATE_CURRENT ) I’m getting this error when using it: java.lang.IllegalArgumentException: de.xxx.xxx: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on… Read More Android 12 Kotlin – Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable