mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 06:28:41 +00:00
add limit check
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
This commit is contained in:
parent
285859cee6
commit
085702c0bb
1 changed files with 3 additions and 1 deletions
|
|
@ -78,7 +78,9 @@ class _SelectAdditionalUsers extends State<SelectAdditionalUsers> {
|
|||
void toggleSelectedUser(int userId) {
|
||||
if (_alreadySelected.contains(userId)) return;
|
||||
if (!selectedUsers.contains(userId)) {
|
||||
selectedUsers.add(userId);
|
||||
if (selectedUsers.length < widget.limit) {
|
||||
selectedUsers.add(userId);
|
||||
}
|
||||
} else {
|
||||
selectedUsers.remove(userId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue