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!

КОМЕНТАРІ • 45

  • @hossainabeer
    @hossainabeer 3 роки тому +1

    Just what a noob needs, an explanatory tutorial not the music filled one. Keep up the good work

  • @JAGANNATHSAHOOtheraw
    @JAGANNATHSAHOOtheraw 6 років тому +11

    Please make a tutorial on background process in flutter

  • @kamalkkvelly1170
    @kamalkkvelly1170 3 роки тому +1

    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

  • @risingrocksfarm
    @risingrocksfarm 3 роки тому +2

    Massive thumbs up. Thanks

  • @RajeshZmoke
    @RajeshZmoke 6 років тому +1

    If u can explain the class implementation of the will pop scope that'll be great

  • @shwetalukka529
    @shwetalukka529 3 роки тому

    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?

  • @mockingbird3809
    @mockingbird3809 5 років тому +4

    Thank You SO Much for this Video.

  • @mohammedsolyman3891
    @mohammedsolyman3891 Рік тому

    thank you very much

  • @rahul2
    @rahul2 5 років тому +2

    Sir can you explain how to use this code with WebViewScaffold ? instead of scaffold

    • @Aqibfareex
      @Aqibfareex 5 років тому

      Just wrap webviewscaffold instead of scaffold

  • @ashokchandra4911
    @ashokchandra4911 Рік тому

    Perfect ❤❤

  • @vinceramcesoliveros6739
    @vinceramcesoliveros6739 6 років тому +2

    Nice and simple tutorial.

  • @PadillaJosh
    @PadillaJosh 6 років тому

    What theme are you using? I really like the colors.

  • @kishorenani2574
    @kishorenani2574 6 років тому +1

    When I was using willpopscope again it was going to main page pls could you help to solve the issue

  • @michaeltolsma7717
    @michaeltolsma7717 4 роки тому

    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.

  • @shahadathossain6005
    @shahadathossain6005 3 роки тому

    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?

  • @Sanjay54251
    @Sanjay54251 3 роки тому

    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

  • @AhmedAshraf-tu6xl
    @AhmedAshraf-tu6xl 3 роки тому

    Really thanks

  • @aseemsrivastava3995
    @aseemsrivastava3995 6 років тому +1

    How to close my app on back press?

  • @swapnilcodes
    @swapnilcodes 2 роки тому

    Wonderful !😍

  • @dholakiyaparth
    @dholakiyaparth 5 років тому

    Thanks for such nice tutorial

  • @pistomgeral9436
    @pistomgeral9436 3 роки тому

    Thank you

  • @bharath9628
    @bharath9628 5 років тому +1

    i can't log in my live API app after using this

  • @letsdo6024
    @letsdo6024 5 років тому

    how to use willpopscope as a child of another willpopscope widget?

  • @krishnakumarramachandran5888
    @krishnakumarramachandran5888 5 років тому

    WillPopScope can use only inside Stateful widget?

  • @teddyt5231
    @teddyt5231 4 роки тому

    Thanks bro

  • @user-uk3yl1ii6v
    @user-uk3yl1ii6v 4 роки тому

    Thanks!

  • @musaesin5163
    @musaesin5163 4 роки тому

    Theme?

  • @Nobody-ky7sl
    @Nobody-ky7sl 6 років тому

    Wow this videos are awesome

  • @mtux
    @mtux 6 років тому

    very thanks!!

  • @Pabliuscf
    @Pabliuscf 4 роки тому

    Thanks for the vídeo

  • @chethanpoojary4570
    @chethanpoojary4570 4 роки тому

    Subscribed...

  • @gordinmitya
    @gordinmitya 5 років тому +1

    usually it's done by double tap on back button

    • @Aqibfareex
      @Aqibfareex 5 років тому

      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); }

    • @jajasaria
      @jajasaria 5 років тому

      @@Aqibfareex already tried this but when comes to fast double tap. the function not response quite will.

    • @Aqibfareex
      @Aqibfareex 5 років тому

      @@jajasaria nope. It works fine with even i double tap faster

    • @jajasaria
      @jajasaria 5 років тому

      @@Aqibfareex sorry. the problem is my toast package. Thanks for this tutorial

    • @Aqibfareex
      @Aqibfareex 5 років тому

      @@jajasaria no problem ^-^

  • @jaeseon
    @jaeseon 4 роки тому

    Thanks, MTECHVIRAL

  • @lattelover7186
    @lattelover7186 6 років тому

    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( ....

  • @Anvesh2013
    @Anvesh2013 5 років тому

    Always, always, always, always
    post it on github

  • @AndrewProjectos
    @AndrewProjectos 4 роки тому

    less talk, do more, go to the point...by the way, does not work

  • @dinukakulathunga5798
    @dinukakulathunga5798 3 роки тому +1

    Thank you so much..

  • @isaacbarros88
    @isaacbarros88 5 років тому

    Thanks!