mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-04 07:50:57 +10:00
Added mute channel functionality (#209)
This commit is contained in:
@@ -155,4 +155,19 @@ class AppSettingsService extends ChangeNotifier {
|
||||
Future<void> setUnitSystem(UnitSystem value) async {
|
||||
await updateSettings(_settings.copyWith(unitSystem: value));
|
||||
}
|
||||
|
||||
bool isChannelMuted(String channelName) {
|
||||
return _settings.mutedChannels.contains(channelName);
|
||||
}
|
||||
|
||||
Future<void> muteChannel(String channelName) async {
|
||||
final updated = Set<String>.from(_settings.mutedChannels)..add(channelName);
|
||||
await updateSettings(_settings.copyWith(mutedChannels: updated));
|
||||
}
|
||||
|
||||
Future<void> unmuteChannel(String channelName) async {
|
||||
final updated = Set<String>.from(_settings.mutedChannels)
|
||||
..remove(channelName);
|
||||
await updateSettings(_settings.copyWith(mutedChannels: updated));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user