Flutter Tutorial - Handle Back Button Pressed | WillPopScope Widget
Use WillPopScope widget to handle back button pressed on Android and iOS in Flutter and detect if the user leaves the current screen. Click here to Subscribe to Johannes Milke: https://www.youtube.com/JohannesMilke?sub_confirmation=1 👉 12 Week Flutter Training | https://heyflutter.com 👉 Flutter Masterclass Courses | https://heyflutter.com/masterclass Source Code | https://github.com/JohannesMilke/willpopscope_example My Courses | https://heyflutter.com Follow Newsletter | https://johannesmilke.com/#/newsletter SUBSCRIBE HERE http://bit.ly/JohannesMilke SUPPORT & SPONSOR ME https://github.com/sponsors/JohannesMilke RESOURCES Press Back Button Again To Exit App Tutorial: https://www.youtube.com/watch?v=h-4triVsxEs User Profile Page Tutorial: https://www.youtube.com/watch?v=gSl-MoykYYk Check Internet Connectivity Tutorial: https://www.youtube.com/watch?v=ttSuRvs36Bc Dismiss Keyboard On Scroll/Tap Tutorial: https://www.youtube.com/watch?v=SftssVoNB5Y Hide/Show Keyboard Programmatically Tutorial: https://www.youtube.com/watch?v=MKrEJtheGPk Detect Keyboard Visibility Tutorial: https://www.youtube.com/watch?v=Sy2Uge3iGyE Keyboard Events Tutorial: https://www.youtube.com/watch?v=5ykfmHhJUu4 On Hover Button Effect Tutorial: https://www.youtube.com/watch?v=NqvJEtcQweU Image Picker Tutorial: https://www.youtube.com/watch?v=MSv38jO4EJk Scroll To Index/Item In ListView Tutorial: https://www.youtube.com/watch?v=VOV2V0asFaE Take Screenshot Of Screen & Widget Tutorial: https://www.youtube.com/watch?v=rABnaF-Xk3E Push, Pop Navigation Tutorial: https://www.youtube.com/watch?v=yuGaEsLRB38 TIMELINE 0:00 Introduction Handle Back Button Pressed 0:49 Create WillPopScope Widget 1:04 Return Value False In WillPopScope To Stay On Same Screen 1:16 Return Value True In WillPopScope To Pop Screen OR Exit App 1:32 Show Dialog Via WillPopScope Widget 2:42 Fix Null Safe showDialog Returning Future Bool With WillPopScope 2:55 Showcase Exit App On Back Press 3:17 Show Dialog OnBackPressed And Back Button Event SHARE | SUBSCRIBE | LIKE FOR MORE VIDEOS LIKE THIS ********* SOCIAL MEDIA: Follow Us :-) Twitter | https://twitter.com/HeyFlutter_ Linkedin | https://www.linkedin.com/company/heyflutter LEARN MORE SOURCE CODE | https://github.com/JohannesMilke ARTICLES | https://medium.com/@JohannesMilke PLAYLISTS All Flutter Videos | https://www.youtube.com/watch?v=3f9oqIvxNc0&list=PL1WkZqhlAdC_MPQBXUFwAHviZ3XkWPDBG Widgets - Flutter | https://www.youtube.com/watch?v=1nEmFuX1Cig&list=PL1WkZqhlAdC8enpcvzv_uAS9FmHTDOCJ8 Plugins - Flutter | https://www.youtube.com/watch?v=3f9oqIvxNc0&list=PL1WkZqhlAdC9shbzjQao6cdzqB_Wu7Hr4 Animations - Flutter | https://www.youtube.com/watch?v=RLPZzDOPXG4&list=PL1WkZqhlAdC9pQE4nd9oAJi5eM9YXJeji Designs - Flutter | https://www.youtube.com/watch?v=aLwjk-G2Qik&list=PL1WkZqhlAdC-i3Vs_HBQw9BPT9-_zMSun Firebase - Flutter | https://www.youtube.com/watch?v=IruuzPydPz4&list=PL1WkZqhlAdC9TgTee50FWiiwVZ6kQg4W7 State Management - Flutter | https://www.youtube.com/watch?v=8H3bwxxla4Y&list=PL1WkZqhlAdC-GNyxQbfn8Db9pR6bRcQuw CREDITS Copyright song "Corporate Technology" by scottholmesmusic.com #Flutter #Tutorial #JohannesMilke LIKE & SHARE & ACTIVATE THE BELL Thanks For Watching :-) http://bit.ly/JohannesMilke
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.