Created
June 18, 2022 12:34
-
-
Save FlutterWiz/30e5bbdc0f3ba3d210289aa92e777c2f 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
Consumer( | |
builder: (context, ref, child) { | |
return IconButton( | |
onPressed: () { | |
if (textfieldController.text.isEmpty) { | |
ref.refresh(searchProvider); | |
} else { | |
ref.refresh(searchProvider); | |
ref.read(searchProvider.notifier).mapEventsToState( | |
SearchedTextChanged( | |
text: textfieldController.text, | |
), | |
); | |
} | |
}, | |
icon: const Icon( | |
Icons.search, | |
color: whiteColor, | |
), | |
); | |
}, | |
), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment