remove chips tapping on them

This commit is contained in:
Salvatore Giordano
2020-11-23 10:30:58 +01:00
parent e87c945863
commit 37891ae3c5
2 changed files with 38 additions and 23 deletions
+17 -2
View File
@@ -131,7 +131,11 @@ class _NewChatScreenState extends State<NewChatScreen> {
controller: _controller, controller: _controller,
focusNode: _searchFocusNode, focusNode: _searchFocusNode,
chipBuilder: (context, user) { chipBuilder: (context, user) {
return Stack( return GestureDetector(
onTap: () {
_chipInputTextFieldState.removeItem(user);
},
child: Stack(
alignment: AlignmentDirectional.centerStart, alignment: AlignmentDirectional.centerStart,
children: [ children: [
Container( Container(
@@ -148,14 +152,25 @@ class _NewChatScreenState extends State<NewChatScreen> {
), ),
), ),
), ),
UserAvatar( Opacity(
opacity: .8,
child: UserAvatar(
showOnlineStatus: false,
user: user, user: user,
constraints: BoxConstraints.tightFor( constraints: BoxConstraints.tightFor(
height: 24, height: 24,
width: 24, width: 24,
), ),
), ),
),
Positioned(
child: Icon(
StreamIcons.close,
color: Colors.white,
),
),
], ],
),
); );
}, },
onChipAdded: (user) { onChipAdded: (user) {
+1 -1
View File
@@ -1,6 +1,6 @@
name: example name: example
description: A new Flutter project. description: A new Flutter project.
version: 1.0.64+66 version: 1.0.65+67
environment: environment:
sdk: ">=2.2.2 <3.0.0" sdk: ">=2.2.2 <3.0.0"