getNamespace static method
Get the namespace of a channel
Implementation
static String? getNamespace(String channel) {
if (!channel.startsWith('/')) {
return null;
}
final segments = channel.split('/').where((s) => s.isNotEmpty).toList();
if (segments.isEmpty) {
return '/';
}
return '/${segments.first}';
}