Flutter ModalBarrier Widget
Вставка
- Опубліковано 10 січ 2023
- This Tutorial will show you how to use the ModalBarrier with flutter. To learn more about every flutter widgets, you can check our flutter playlist about all flutter widgets here: • Flutter AboutDialog Wi...
This was how to make and use the ModalBarrier widget within your Flutter app
COURSES
Flutter courses (Beginner & Advanced): fluttermapp.com/
OVERVIEW
0:00 ModalBarrier Flutter
MISSION
Our mission at Flutter Mapp (Flutter Mobile App) is to help purpose driven Flutter developers go full-time doing what they love and making an impact through coding. We achieve this with useful Flutter tips and straight to the point Flutter videos.
RECOMMENDED VIDEOS
Playlist of more than 200 Flutter tips: • 35 Flutter Tips That W...
Learn Flutter in 1 hour: • Flutter Tutorial For B...
Zero to Hero Flutter Course (Beginners): • Video
Hero to Pro Flutter Course (Advanced): • Video
EDITOR
Amaan Ansari: / amaan_0605
SOCIAL MEDIA:
Instagram : fluttermapp
Twitter : FlutterMapp
Website: www.fluttermapp.com
Discord Invite: / discord
CONTACT
For business inquiries email me here: info@fluttermapp.com
Website: fluttermapp.com
#FlutterMapp
#Flutter
Fantastic tutorial
What is his utility?
It is actually used inside the AlertDialog widget to dismiss it when click outside the dialog, or to prevent clicks outside if dismissable is set to false.
Do u happen to know a way to prevent the iOS swipe to pop gesture when using a modal barrier?
AbsorbPointer?
@@lemmerelassal2795 not really. I show a modal barrier when loading things from the backend, but the user can still swipe to the left to pop the current widget. I tried many things to prevent that, but could not. It's an iOS specific behaviour.
@@souhailmarghabi4113 But have you tried AbsorbPointer?
@@lemmerelassal2795 the back action is a system behaviour not a custom widget in the tree so no use for an AbsorbePointer in this scenario.
I think you are looking for the widget WillPopScope, I can't test it on iOS rn but this widget blocks the "pop" action when the "onWillPop" parameter returns false.
What's the use case for such a widget?
It can be used to prevent any background interaction with the UI in case of an asynchronous process. For example when a user is loggin in and you do not want them to press some other buttons after the login.
@@Eternal600 That's cool. Thanks