Created
January 8, 2023 13:05
-
-
Save FlutterWiz/fc90f977520f914421b1d9fba98f978a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Future<void> sendCapturedPhotoToSelectedUsers({ | |
| required String pathOfTheTakenPhoto, | |
| required int sizeOfTheTakenPhoto, | |
| }) async { | |
| if (state.isInProgress) { | |
| return; | |
| } | |
| emit(state.copyWith(isInProgress: true)); | |
| final channelId = state.currentUserChannels[state.userIndex].id; | |
| // For showing the progress indicator, and well UX. | |
| await Future.delayed(const Duration(seconds: 1)); | |
| await _chatService.sendPhotoAsMessageToTheSelectedUser( | |
| channelId: channelId!, | |
| pathOfTheTakenPhoto: pathOfTheTakenPhoto, | |
| sizeOfTheTakenPhoto: sizeOfTheTakenPhoto, | |
| ); | |
| emit(state.copyWith(isInProgress: false, isCapturedPhotoSent: true)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment