Swipe a container (message box like telegram) left in flutter - flutter

I'm trying to implement left dragging to a specific container or actually a message box like the one in Telegram where you can swipe the message left to reply to it.
Telegram message dragging when reply
I tried the Flutter Dismissible Widget but firstly it destroys the widget or remove it and secondly couldn't find a way to drag it to the center only.
What I want is the same technique in Telegram to implement it on Flutter
Any ideas?

You can use swipeable package, it allows you to wrap a widget with some threshold and a few callbacks that you can react, onSwipeLeft or onSwipeRight for this case. Then you save the selected message and render the message box on top of the message bar.

Related

Using AlertDialog on a stack widget in flutter

I have a basic layout where I am using a stack widget to hold my other widgets.. I have a side toolbar, inside that I have a pen menu on click of which a popup should appear. When i am clicking the pen menu an alert dialog appears but not in the expected place, what i mean is...
I am expecting a dialog like the one in the below image. Do I need to use any plugin to create a dialog like this with a chevron mark?enter image description here
As you are using Alert dialog, it will by default be aligned in center of your screen. In order to achieve what you are trying to, I would suggest using a plugin like this.

GestureDetector in Flutter: how to detect long press into vertical drag?

I have a question about the GestureDetector widget in Flutter. I have the following situation: I have two buttons. I want to do something when the first button is long pressed. Then I want to do something when the user drags vertically over the second button still in press from the first button.
How can I do this with the GestureDetector widget in Flutter?
There is a draggable class on flutter that will serve better your purpose check this https://api.flutter.dev/flutter/widgets/Draggable-class.html

Implement next,previous,home page,share button throughout my flutter app

1.I have created a lesson app USING FLUTTER in which I want to implement next,previous,share & home button in each page...How can I do this
2.I need your help
If you have a scaffold, this will have an appbar and you place the actions in the appbar with icon buttons.
A scaffold also has a body which can be a pageview which in turn, can hold your various pages.
Depending on the app, you might get the pageView or a gestureDetector to give you swipe left and right for your previous or next.

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

Flutter overlay is moving

I'm asking how to disable Overlays to move when a Scaffold.of(context).showSnackBar is called like on my video below.
The same thing is happening when the keyboard appear. Sometime the blue floattingButton (+) don't come back to it's original position :-(
Thx in advance.
Problem animation
The FloatingActionButton going up when the Scaffold is displayed is something common to all default implementations.
Give a look to the "Bootom app bar" demo in the Gallery app. Press on the search button and you will see it coming up. Or just add a Scaffold to the app that is built with flutter create command.
This happens because of the way the FAB button is placed on the screen and the effect of displaying the Snackbar by the Scaffold.
The FAB button is displayed at the bottom of the content area of the Scaffold content. When the content area is shrinked to include the BottomAppBar, the FAB goes up with it. It has nothing to do with Overlay.
You have two options:
Either you create your own versiĆ³n of the FAB which is not
controlled by the Scaffold.
Or you hack the Scaffold so the size of the SnackBar is not taken
into account.
For this second option you can try the following:
Go to the file /lib/src/material/scaffold.dart in your flutter installation and look for the line with the code snackBarSize: snackBarSize, inside the _ScaffoldLayout class.
Replace it with snackBarSize: Size(0.0, 0.0),
You will see that the FAB stays in its place.