Skip to content

Instantly share code, notes, and snippets.

@FlutterWiz
Created January 8, 2023 13:04
Show Gist options
  • Save FlutterWiz/4b92dca9fcb48c1c0ac7e4dbc98907bf to your computer and use it in GitHub Desktop.
Save FlutterWiz/4b92dca9fcb48c1c0ac7e4dbc98907bf to your computer and use it in GitHub Desktop.
@override
Future<void> close() async {
await _currentUserChannelsSubscription?.cancel();
super.close();
}
void reset() {
emit(
state.copyWith(
isInProgress: false,
isChannelCreated: false,
isCapturedPhotoSent: false,
listOfSelectedUsers: {},
listOfSelectedUserIDs: {},
channelName: "",
),
);
}
void channelNameChanged({required String channelName}) {
emit(state.copyWith(channelName: channelName));
}
void validateChannelName({required bool isChannelNameValid}) {
emit(
state.copyWith(isChannelNameValid: isChannelNameValid),
);
}
Future<void> _listenCurrentUserChannelsChangeStream(List<Channel> currentUserChannels) async {
emit(state.copyWith(currentUserChannels: currentUserChannels));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment