Skip to content

Instantly share code, notes, and snippets.

@duytq94
Last active February 18, 2024 09:01
Show Gist options
  • Save duytq94/f2a16311a36f70c844fe3cfb0488bc21 to your computer and use it in GitHub Desktop.
Save duytq94/f2a16311a36f70c844fe3cfb0488bc21 to your computer and use it in GitHub Desktop.
void _onBackPress() {
_chatProvider.updateDataFirestore(
FirestoreConstants.pathUserCollection,
_currentUserId,
{FirestoreConstants.chattingWith: null},
);
Navigator.pop(context);
}
void _getSticker() {
// Hide keyboard when sticker appear
focusNode.unfocus();
setState(() {
isShowSticker = !isShowSticker;
});
}
void _onFocusChange() {
if (focusNode.hasFocus) {
// Hide sticker when keyboard appear
setState(() {
isShowSticker = false;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment