Flutter: Handle Back Button Pressed | WillPopScope Widget
Вставка
- Опубліковано 5 вер 2024
- In this video, I will explain how to handle back button press on android.
Please give stars for this project on git and like the video.
Flutter UI Kit - goo.gl/N2RxBf
Flutter Example Apps - goo.gl/8hZQkq
Instagram - / codepur_ka_superhero
FB Group - goo.gl/hwnX2F
Be sure to ask for help in the comments if you need any. Suggestions for future Flutter tutorials are also very welcome! :)
Flutter is an SDK owned by Google to create applications for Android and iOS using a single codebase. Flutter uses the Dart programming language (also owned by Google). Flutter was in beta when I released this video, so things might still change a bit. But the SDK is already mature enough to write some cool production apps!
Please Subscribe my channel to motivate me.
Subscribe Our Channel: goo.gl/BlFui4
For Fun - www.youtube.co....
Connect with us on social media:
Facebook: / mtechviral
Pawan Kumar - / imthepk
Ask Pawan Kumar - / thepawankumaar
Instagram - / codepur_ka_superhero
Twitter: / imthepk
LIKE | SHARE | SUBSCRIBE FOR MORE VIDEOS LIKE THIS
THANKS FOR WATCHING!
Just what a noob needs, an explanatory tutorial not the music filled one. Keep up the good work
Please make a tutorial on background process in flutter
thanks sir g i love you in future if i will earn or do something in programming ... i wuold like to share with ... great thanks again
Massive thumbs up. Thanks
If u can explain the class implementation of the will pop scope that'll be great
Hello sir i referred ur 2 hrs tutorial fully its very much simple and just great. May i get help for the modules of my app which i m developing?
Thank You SO Much for this Video.
thank you very much
Sir can you explain how to use this code with WebViewScaffold ? instead of scaffold
Just wrap webviewscaffold instead of scaffold
Perfect ❤❤
Nice and simple tutorial.
What theme are you using? I really like the colors.
When I was using willpopscope again it was going to main page pls could you help to solve the issue
The function only works once. When you press "Yes" then go back in the app and do it again, the alert doesn't pop up.
I want that feature in my Webview flutter. Already using WillPopScope for backward and forward feature (true false) bt cant do the exit feature. any help plz?
hi sir i want to press back arrow and send some data at the same time how will i do i use getx for statemamagnent i use for local storage get_storage i
i want to refresh my previous screen when i back press icon on top left
what will i do
Really thanks
How to close my app on back press?
Wonderful !😍
Thanks for such nice tutorial
Thank you
i can't log in my live API app after using this
how to use willpopscope as a child of another willpopscope widget?
WillPopScope can use only inside Stateful widget?
Totally
Thanks bro
Thanks!
Theme?
Wow this videos are awesome
very thanks!!
Thanks for the vídeo
Subscribed...
usually it's done by double tap on back button
You can do that this way:
DateTime currentBackPressTime;
Future onWillPop() { DateTime now = DateTime.now(); if (currentBackPressTime == null || now.difference(currentBackPressTime) > Duration(seconds: 2)) { currentBackPressTime = now; Fluttertoast.showToast(msg: exit_warning); return Future.value(false); } return Future.value(true); }
@@Aqibfareex already tried this but when comes to fast double tap. the function not response quite will.
@@jajasaria nope. It works fine with even i double tap faster
@@Aqibfareex sorry. the problem is my toast package. Thanks for this tutorial
@@jajasaria no problem ^-^
Thanks, MTECHVIRAL
Nice, The OnWillPop event works good, it's successfully prevent app from hidden. Unfortunately the dialog does not show up. Is this bug or expected behaviours since i'm using WillPopScope on home property of MaterialApp.
return MaterialApp(
home: WillPopScope(
onWillPop: _onBackPressed,
child: Scaffold( ....
Always, always, always, always
post it on github
less talk, do more, go to the point...by the way, does not work
Thank you so much..
Thanks!