Created
January 8, 2023 13:15
-
-
Save FlutterWiz/f65237c7bfa2f60667ed01a981a869b5 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
void selectUserToSendCapturedPhoto({ | |
required User user, | |
required int userIndex, | |
}) { | |
final listOfSelectedUserIDs = {...state.listOfSelectedUserIDs}; | |
if (listOfSelectedUserIDs.isEmpty) { | |
listOfSelectedUserIDs.add(user.id); | |
} | |
emit( | |
state.copyWith(listOfSelectedUserIDs: listOfSelectedUserIDs, userIndex: userIndex), | |
); | |
} | |
void removeUserToSendCapturedPhoto({ | |
required User user, | |
}) { | |
final listOfSelectedUserIDs = {...state.listOfSelectedUserIDs}; | |
listOfSelectedUserIDs.remove(user.id); | |
emit( | |
state.copyWith(listOfSelectedUserIDs: listOfSelectedUserIDs, userIndex: 0), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment