import 'package:flutter/material.dart'; import '../../business_logic/websocket.dart' as websocket; class Notifications extends StatefulWidget { const Notifications({Key? key}) : super(key: key); @override State createState() => _NotificationsState(); } class _NotificationsState extends State { List notifs = []; List subscriptions = []; @override Widget build(BuildContext context) { for (int i = 0; i < websocket.map.length; i++) { final keyI = websocket.map.keys.toList()[i]; subscriptions.add(websocket.map[keyI]!["home"]!.stream.listen((event) { print(event); })); } return Text("Notifs"); } }