Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On back button pressed event #22

Closed
AhmedNourJamalElDin opened this issue Dec 29, 2020 · 5 comments
Closed

On back button pressed event #22

AhmedNourJamalElDin opened this issue Dec 29, 2020 · 5 comments
Assignees

Comments

@AhmedNourJamalElDin
Copy link

AhmedNourJamalElDin commented Dec 29, 2020

Hi,

I wanted to show the chat as a widget inside a screen. but it seems not possible, right?
so I have changed my mind.

Now I want to know if the chat is closed by pressing the back button or via Android physical back button or anyway. just need to add some code at closing the chatting screen.

How to achieve so?

Thanks

@Samir1810
Copy link
Contributor

Hi Ahmed,

I wanted to show the chat as a widget inside a screen.

Could you please explain more about this use-case, inside which screen you mean?

For closing the back buttons would work. Also are you flutter ios or android?

@AhmedNourJamalElDin
Copy link
Author

AhmedNourJamalElDin commented Jan 3, 2021

Hi hi

Could you please explain more about this use-case, inside which screen you mean?

I'd like to add some other widgets above or below the chatting widget, perhaps WillPopScope to catch back button event. or maybe adding the chat as a main tab in my application.

For closing the back buttons would work.

Yes, it does work 100%. but I want to capture the closing event and do some logic like logging some event, redirecting, etc.

Also are you flutter ios or android?

Android for now for getting it ready, but I want to have it working on both of them and published in my iOS version as I have iOS version published and working fine.

@Samir1810
Copy link
Contributor

Hi Ahmed,

Adding our Android developer @reytum to update your usecase.

@reytum
Copy link
Contributor

reytum commented Jan 12, 2021

@AhmedNourJamalElDin As of now we do not provide an option to add the chat screen inside your widget in Flutter. The chat screen will open independently. Also we do no provide an event for the back press of the chat button. One workaround you could use to achieve this is by checking the onResume and onPause events in your screen from where the chat screen is launched. So when the chat is opened, the event fired would be onPause and when you return back from the chat screen, onResume event will be fired. Hope this thread could be helpful: https://stackoverflow.com/questions/49869873/flutter-update-widgets-on-resume

@AhmedNourJamalElDin
Copy link
Author

Thanks a lot. I will try them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants