How to create a virtualized, reorderable list with dynamic sizes, and animated item adding and removal in Flutter? - flutter

I need a flutter list package with the following features:
Only renders items in/near visible range (virtualized)
Supports different item heights.
Reorderable through drag and drop
When an item is dragged to the edge of the screen, the list scrolls
When items enter or exit, the list animates nicely
The package ReorderableListView.builder (https://api.flutter.dev/flutter/material/ReorderableListView/ReorderableListView.builder.html) supports 1,3 and 4. No support for 5. Reordering animation was bad for items with differing heights (2) when I tried it out.
The package implicitly_animated_reorderable_list
(https://pub.dev/packages/implicitly_animated_reorderable_list/changelog) supports 3 and 5. Nothing mentioned about 1 or 2 in its readme, and a comment from January here (Flutter: Reorderable AND Animated ListView - any idea?) suggests 4 is missing.
Looking for advice on how to achieve this:
An amazing package that can do all 5.
A way to add features of these different packages together somehow. Is that at all possible?
Advice on forking or not forking and just starting from scratch.
In regards to forking what in your opinion is the most/least trivial of these features to build from scratch?
I'm new to Flutter, so anything I don't know enough to ask about in relation to this subject is also greatly appreciated.

Own answer:
There really isn't a need for any plugins or forks. ReorderableListview.builder can be used to accomplish all 5.
Not sure how I botched the code that made me think ReorderableListView.builder wasn't handling different heights of items correctly, but whatever the glitch was (maybe related to keys?), I'm not able to reproduce it. Interesting that all the docs/tutorials I found only show statically sized list items when dynamically sized list items are no problem.
As for the animated exits and entrances (i.e. not letting the list items seem to jump up and down in a disorienting way), this is really trivial to do by animating height with AnimatedContainer. The existence of a separate AnimatedList widget and ImplicitlyAnimatedList plugin threw me off a bit.

Related

How to create a scrollable list for Watch OS that has a fixed size?

I'm a beginner to Watch OS programming (I'm using Storyboard) and would like some help with scrollable lists.
I need to create a scrollable list of numbers (e.g. from 1 to 20) that changes when user uses scrolls with the crown. I know how to create it using a Table, but the problem is, I don't know how to contain it to a single area.
I have added a screenshot of the "Sleep Cycle" app that has a similar feature. I would like to do the exact same thing, but instead of time, I need to show a list of numbers.
Edit: Another example would be "Zero" where the hours field is scrollable:
Please check out this library and try to customize it as per your use case:
https://github.com/calda/WatchKitTimePicker

How to create cells with different sizes using GridView in Flutter?

I want to create a similar view with Flutter as we can do it by creating a UICollectionViewLayout in iOS .
This is a sample code I am using.
https://github.com/flutter/flutter/blob/b8a2456737c9645e5f3d7210fba6267f7408486f/dev/integration_tests/flutter_gallery/lib/demo/material/grid_list_demo.dart
How to achieve this using GridView in Flutter. If not GridView, is there any other way to do it?
GridView is not designed to do this. You may be able to get a Wrap to do what you want, although from your example it may not quite do it (horizontally it definitely wont as it arrange the items into rows; vertically it might work for you or might not depending on exactly what you're doing).
If you're only ever going to have the two columns, you could simply have a Row containing two Columns and make sure to put the items in the right columns.
Or the more complicated but probably best answer would be to write the logic for arranging the items this way yourself - see CustomMultiChildLayout.
EDIT: there is also a package that may work for you. It can't do arbitrary sizing, and you need to know the sizes of the items in advance, but you can specify items to take up multiple rows or columns of the grid. See it here.
Note that if you have a lot of items, you'll probably want to do something with a CustomScrollView but that isn't really in the scope of this answer.
https://github.com/letsar/flutter_staggered_grid_view
This would help you. I think the plugin gives different size.

Can you turn subsets of slides into a custom component in Ionic 3+?

I have tried to create custom components which are subsets of slides. I'm trying to create a custom Ionic component which is a subset of slides. Then I can mix and match subsets of slides in one to make a complete slide show. Like building a master process from sub-processes. You should be able to swipe back and forth between all slides as expected, no matter an directly in the component, or slides within custom components.
I've tried various methods to no avail. Any ideas?
PLEASE SEE THIS SAMPLE PROJECT WITH 2 METHODS I HAVE TRIED TO ACCOMPLISH THIS.
No. You can't do this. You can put a into another if one scrolls vertically and one horizontally. You can insert a custom component into an which just has a couple slides in it, put the inserted slides show one over the other vertically with no way to swipe back and forth. So, no. You can't do this. Perhaps with dynamic templates you can build the from code dynamically. That's the only work around I can see.

Turning scrollbar, ListView into timeline slider

I've been seeing this UI technique quite often at Dribbble, mostly demonstrated on iPhone as timeline, and I am really wondering if it's possible to do so on Android. The idea is to exploit scrollbar, make it activate each row it is passing.
Consider these schematics of a list of contact.
The first one is the list (photos on the left side, names on the right) split roughly in the middle with scroll track.
The scrollbar cannot expand and has to be smaller than the smallest row. I believe it is possible to produce this kind of arrangement by combining two listviews and make them roll together.
The second one shows the screen when scrolled and when the scrollbar moves to the second row. After it stops, the second row will expand its height. All hidden elements there like address, phone, etc will show up. Also, the moment the scrollbar leaves the first row / hits the second, the first row will toggle off. It will shrink and remove all elements except name.
I have been thinking about this scenario and one key question in this technique is whether the scrollbar has the ability to activate the row it hits. The only tool I know in regard to scrolling is onScrollListener but I wonder if it's sufficient. Does anyone have any insight into such scenario ?
Thank you in advance.
I've been seen something similar to this in lots of applications. Some of them are just using ListView with design tricks to look like that, others with custom views or something else. The idea which I have in my about this implementation is using two Fragments: left and right which are placed in one FragmentActivity. Left Fragment will be your image holder, where for example you will have a ListView or some other view depending on your choice which will communicate with the Right Fragment and when LeftFragment's ListView stop scrolling, fire an event to RightFragment's ListView to scroll to position 5 for example and expand that item. Not really sure if it's the best option and if it will work properly as you want, but that's the first idea which I can think of to do some implementation like this.
Hope this help you find the right answer.

Is there a tree control for the iphone?

Is there a Tree control available for the iphone?
I need to represent a tree with sub nodes in a tree, how can I do it?
Thanks
No tree widget by default. It's basically not there because you shouldn't really need one and most cases it should probably be avoided.
A table navigation controller is the most common way to navigate down nodes in a hierarchy/tree usually.
It's hard to fit a tree like control we have on our desktops in the touch world where you have huge fingers (so huge nodes) and with the nodes offset to show depth, there isn't much space left over. Adding it to the iOS environment would create a weird UX flow so I would probably rethink my design flow if I think I need one.
If you need to fake it, you can use a table view and offset the left side of each subitem with some padding to show depth.
See this help
Rolling your own iPhone treeview control
part 1 : http://dotnet.kapenilattex.com/?p=566, part 2 and part 3 are in the pages : 585 and 633
part 4 : http://dotnet.kapenilattex.com/?p=648&cpage=1#comment-59842
I would use a UITableView and expand and collapse items further down the tree. You can set an indentation level for each UITableViewCell as it is displayed, depending on its position in the tree. You would need to keep track of which items in the tree are expanded/visible in order to always provide the tree with the correct data.
I just did just that for a project. Unfortunately I am not at liberty to share the full code. But it should not be terribly hard to write.
Let us know if you find an out-of-the-box solution.
From what I see, the best solution for my problem will be a BreadCrumbs control. I am looking for a ready solution of breadcrumbs, but if there isn't, it is not a big deal to write it.
OK, I did it.
I added a WebView and I am adding to it the crumb list. The design is similar to the Apple's official site.
When a user clikcs on the link, I call the popToViewController function and I am there.
This prevent the user from clicking Back and Back.
Hope this will help somebody.