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
+37 -22
View File
@@ -131,31 +131,46 @@ class _NewChatScreenState extends State<NewChatScreen> {
controller: _controller, controller: _controller,
focusNode: _searchFocusNode, focusNode: _searchFocusNode,
chipBuilder: (context, user) { chipBuilder: (context, user) {
return Stack( return GestureDetector(
alignment: AlignmentDirectional.centerStart, onTap: () {
children: [ _chipInputTextFieldState.removeItem(user);
Container( },
decoration: BoxDecoration( child: Stack(
color: Colors.black.withOpacity(0.05), alignment: AlignmentDirectional.centerStart,
borderRadius: BorderRadius.circular(12), children: [
), Container(
padding: const EdgeInsets.only(left: 24), decoration: BoxDecoration(
child: Padding( color: Colors.black.withOpacity(0.05),
padding: const EdgeInsets.fromLTRB(8, 4, 12, 4), borderRadius: BorderRadius.circular(12),
child: Text( ),
user.name, padding: const EdgeInsets.only(left: 24),
style: TextStyle(color: Colors.black), child: Padding(
padding: const EdgeInsets.fromLTRB(8, 4, 12, 4),
child: Text(
user.name,
style: TextStyle(color: Colors.black),
),
), ),
), ),
), Opacity(
UserAvatar( opacity: .8,
user: user, child: UserAvatar(
constraints: BoxConstraints.tightFor( showOnlineStatus: false,
height: 24, user: user,
width: 24, constraints: BoxConstraints.tightFor(
height: 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"