How to create a reorderable (draggable) gridview with animations - flutter

As title said, I want to create a gridview that can do the following:
add items with animations (like how animatedList pushes the lower items down with animation)
can hold and drag a grid to reorder it
hovering a grad item in between 2 will create a space for it (like how you reorder apps on a mobile phone
So far I have tried these methods:
GridView.builder with SlideTransition (animation didnt trigger when adding items)
Stack with AnimatedPosition (animations didnt trigger)
Animated Grid (no animation for reordering)
I know there is libraries out there but I wanted to try implementing it myself, i would be appreciated if there is some sort of guidance to making my own custom GridView.

Related

Animate Flutter DataTable

I'm relatively new to Flutter and am now trying to animate some of my widgets.
I'm currently struggling to animate my DataTable. I have a dynamically built DataTable that has to be able to add and delete values. I'm trying to animate insertions and deletions of a new Column. Right now this is happening instantaneously.
I've seen that Flutter offers a lot of animated widgets out of the box already. For example AnimatedList which would probably be perfect. Unfortunately, I haven't found any alternatives like that for the DataTable widget.
How would one go on to animate something like this?

Smooth animated transition with valuelistenablebuilder

I have designed a simple dashboard menu using valuelistenablebuilder which basically changes based on the selected icon.
Here's an example of how it looks
Whenever i click one of the dashboard buttons (cards inside a gridview), it updates the listennablevalue, and thus it leads to a similar view but the number of buttons (and the content within the button) changes.
however, there is no transition or animation as the basic material pageroute given the builder is just rebuilding the view.
Is there a way to add a smooth transition using this listener?

Is it possible to drag ReorderableListView items to another ReorderableListView?

I'm trying to drag an item from one ReorderableListView into another ReorderableListView.
It seems it is only possible by using a regular ListView with Dragable and DragTarget widgets and without the look and feel of a ReorderableListView.
Am I right or is there a way?
This is a bit delayed but I'm leaving this answer for anyone else that landed here after searching:
Consider using this flutter package:
https://pub.dev/packages/drag_and_drop_lists
Features
Reorder elements between multiple lists
Reorder lists
Drag and drop new elements from outside of the lists
Vertical or horizontal layout
Use with drag handles, long presses, or short presses
Expandable lists
Can be used in slivers
Prevent individual lists/elements from being able to be dragged
Easy to extend with custom layouts

How to keep the scrolling position when adding a new elements in the top using ListView or CustomScrollView in Flutter

Is it possible to add new elements into the top of the ListVeiw or CustomScrollView and keep the scroll position as it's with Flutter
I've tried the following
extentAfter = _scrollController.position.extentAfter;
_scrollController.jumpTo(_scrollController.position.maxScrollExtent - extentAfter);
but this won't work well with SliverAppBar - floating and its actually not optimal solution.
Actually the cleanest way would be to add those items only when user scrolls back to the top of the ListView. You can cache them in memory for the moment user is far enough from the top (in your case) of the list.

Android development view pager show on widget

I want shown view pager on widget.Previously i used android list at
widget but i want to show only single item on widget view this
is change on swipe. please help
You can use the AdapterViewFilper - Simple ViewAnimator that will animate between two or more views that have been added to it. Only one child is shown at a time. If requested, can automatically flip between each child at a regular interval. - Example
And you can use:
Starting with API level 11 (Android 3.0.x) you can use "android.widget.RemoteViewsService.RemoteViewsFactory" and and assign a widget to use (from docs):
ListView: A view that shows items in a vertically scrolling list. For an example, see the Gmail app widget.
GridView: A view that shows items in two-dimensional scrolling grid. For an example, see the Bookmarks app widget.
StackView: A stacked card view (kind of like a rolodex), where the user can flick the front card up/down to see the previous/next card, respectively. Examples include the YouTube and Books app widgets.
See http://developer.android.com/guide/topics/appwidgets/index.html section Using App Widgets with Collections.