Add extra controller condition

This commit is contained in:
shilangyu 2022-05-08 10:43:12 +02:00
parent df85b6271e
commit 926c0afe0a
1 changed files with 10 additions and 9 deletions

View File

@ -43,15 +43,16 @@ class CreatePostCommunityPicker extends HookWidget {
vertical: 16,
horizontal: 20,
),
suffixIcon: store.selectedCommunity == null
? const Icon(Icons.arrow_drop_down)
: IconButton(
onPressed: () {
store.selectedCommunity = null;
controller.clear();
},
icon: const Icon(Icons.close),
),
suffixIcon:
store.selectedCommunity == null && controller.text.isEmpty
? const Icon(Icons.arrow_drop_down)
: IconButton(
onPressed: () {
store.selectedCommunity = null;
controller.clear();
},
icon: const Icon(Icons.close),
),
),
onChanged: (_) => store.selectedCommunity = null,
),