I'm using a staggered grid (flutter staggered grid view package) to display notes. It all works fine but I can't find any information on pinning tiles, like 'google keep' notes.
The notes are stored in a database (sqlite) and it's no problem to add a column (pinned), but how do I tell the staggered grid view widget to keep pinned notes at the top and preferably separate from the other notes? ideally I would like to add the "pinned" and "others" text as well.
pinned note example
don't do it in just one staggeredGrid, make them 2 separated grids, once remove and add to different grids
Related
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.
How to create drag and reorder grid view item in flutter without using any package?
I want create grid view with user can reorder its item. but there is no custom way available
and there are only few packages are there
Not sure I know what you mean, but you can use the Draggable() Widget to make something dragable. Just put a container in there and you can drag it.
Then, you can use the DragTarget() Widget with a container child to allow a Draggable() to be dragged on top of it.
You can use the onAccept method to define what happens when a Draggable() Widget gets dragged on top of there.
I'm trying to make a carousel-like view here using SingleChildScrollView, I want the item to snap in the middle of the screen when scrolling, one item at a time.
I would personally recommend using the carousel_slider package, which provides a lot of flexibility: You can use custom widgets and views, and create both horizontal and vertical carousels.
Pub link: https://pub.dev/packages/carousel_slider
Alternatively, if you'd want to create it yourself, I think you'd have to try around working with custom ScrollControllers. Maybe take a look at the source code of the aforementioned package for some pointers.
This is a Flutter Specific Query.
I Want to achieve the Layout Referenced in the Image above. Two Tabs
Below a Container.
The Tabs can be switched using Swipe Animation like that in a
Page View.
The Tabs Contain Dynamically Generated Widgets from Provider.
The Entire Page along with the Fixed Container must be
Scroll-able.
When Switching between the Tabs the fixed container should stay
in place and only tab Content(Column of Widgets) should swipe
left and right.
What I've Tried :
Using a Parent List View and Nesting the Fixed Container Child
and Using Tab Bar to switch the Widget using Animated Switcher and
Slide Animation. Here the Problem is i cannot swipe left and right
and create the Page View like Effect. I also tried Nesting Page-View
inside List-View but since the Page-View does not have a fixed height
( because the tab contents are dynamically generated ).
A few many more concepts i tried to tackle but the issue every time was
that the tab contents are not having a fixed height.
I really want to achieve this Layout and i want to know if there's any way.
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.