Hiding widgets when the keyboard is active - flutter

How do you hide certain widgets when the keyboard is activated? I have an app that overflows when a textfield is activated and instead of just compressing everything I would like to hide several of the widgets that are not necessary when filling out the fields.

I'd first suggest to use SingleChildScrollView as parent. It allows you to show the whole view and make it scrollable when keyboard appears.
If you still want to hide elements, you can know if keyboard is on screen by checking if MediaQuery.of(context).viewInsets.bottom > 100.

Related

Detect if there are items left to scroll in a flutter Listview

I have listview in a gridview in a flutter calendar app. I am trying to detect if a particular list view has half-visible or invisible items which need to be scrolled to be seen. If not, the user might not see that a day has an appointment/task unless they change resolution/view.
I'd like to add a little arrow, or overlay, just to warn the user there are extra items. Making the listview scrollable doesn't work well for me because then the gridview loses scrollability, unless I make the ListViews shrinkwrap, which causes its own problems.
Any help appreciated...
you can use an Text to tell the user there is more contact and if the list is on end you remove that text
by using this inview_notifier_list package
and check if onListEndReached

Is there any way to push Widget above of the Keyboard when it shows up?

I uses TextFormField with Scrollable parent, when the keyboard shows up, is there any way to have the Widgets to be above the keyboard? Is it FocusNode that I should be using?
Current Situation
From this, you can see that when my keyboard shows up, the Button will be covered.
If you can, just put all widgets which needs to stay over the keyboard in a SingleChildScrollView, and set reverse property of the SingleChildScrollView to true

How to avoid animating movement when handling widgets out of view?

I currently have a listview which contain some widgets that I collapse when they leave the viewport, but this causes everything below to move upwards which becomes a really strange experience for the user.
Is there a way to have the widgets collapse without moving below when the collapse happens outside the viewport?
I use collapsible and visibility_detector to handle the collapse and the check for whether the widget is in view or not.

flutter - How can text on stack not up when keyboard appears?

Im making an authentication screen where there are Text widgets and TextField wrapped in Stack.
However, when writing in the Textfield, following the activation code (Text) below is pulled up when the keyboard appears;
How to keep the following code position constant at the bottom and when the keyboard appears it is overwritten?
Any answell will appreciated.
Wrap You Stack widget inside a listview, this way the keyboard won't have any effect on its position.

ExpansionTile - how to collapse other tiles, hide keyboard on press

I'm new to Flutter, trying to build my first app.
my main app body contains a one level ExpansionTile list, which can be filterable by a searchbar.
I'm trying to implement the following behavior -
after a user press a tile to reveal the expanded info
1. the keyboard, if present, should hide
2. previously open tile if expanded should collapse
I have tried using GestureDetector on the root widget with on tap function taking focus, but it does not detect tapping on tiles.
using expansionList onExpansionChanged seems logical but i don't understand how to use it
advice will be greatly appreciated..