networkCapabilityStream property
Emits native network capability updates as the active network changes.
This stream listens to native network callbacks so active network changes can update the app without a manual refresh.
Implementation
@override
Stream<NetworkCapability> get networkCapabilityStream {
return networkCapabilityEventChannel.receiveBroadcastStream().map((
Object? event,
) {
if (event is Map<Object?, Object?>) {
return NetworkCapability.fromMap(event);
}
return NetworkCapability.fromMap(<Object?, Object?>{});
});
}