Circle/wheel ScrollView in Flutter - flutter

I'm having a hard time finding a widget I need in Flutter, which I thought wouldn't be that rare.
What I'm looking fore is something very similar to this:
Which is available at pub.dev, but doesn't have the flexibility I'm looking for.
Ideally, the widget I'm looking for wouldn't end like this one (when you keep scrolling it would go back to the first element). Also, I intend on stacking concentric wheel ScrollViews with different diameters.

Related

How expensive are videos in Flutter?

Normally, if a widget has to rebuild many times or requires a lot of GPU resources, it is expensive. So, how about videos?
For example, consider the two following scenarios:
A screen with a black star shape (made of a widget like ClipPath or similar) animated on the screen.
Exactly the same thing as item 1, but instead of the star being made with a widget, the screen is actually a full screen video of a black star being animated.
Which alternate would probably be more expensive?
I know this is a broad question, but having a sense of what approaches are relatively costly would be very useful. I’m not very knowledgeable about the deep workings of Flutter, so I’m hoping someone could give me a better sense about the costs of videos.
Widget rebuild is very fast and not expensive. It is intended be to rebuilt very frequently. You can rebuild and animate hundreds of widget every frame without lagging.
Video player are implemented in native language, and the performance are very different on different devices
For simple animation, you should use widget, using video won't improve performance, but for very complex animation or 3D animation, using pre-rendered video could be useful

3D wheel effect with list or scroll view

I need to create a list view that has a few key requirements
Infinite scroll of a fixed number of items (ie looping)
Multiple child item types (images, text, inputs)
Multiple child item heights
"3d" wheel look/feel. 2d perspective changes and shadowing/coloring should suffice
It needs to be iOS and Android compatible in Flutter.
I've tried the List Wheel Scroll View widget (https://api.flutter.dev/flutter/widgets/ListWheelScrollView-class.html) and am currently using Carousel Slider (https://pub.dev/packages/carousel_slider), but neither quite get the job done. List Wheel can't do interactive inputs or mixed child heights and the carousel can't do mixed heights or '3d'.
Has anybody created or come across something that might at least get me going in the right direction?
UPDATE
Currently playing with CustomScrollView with some success. It allows me to have multiple child heights and I ~think~ I'll be able to add some perspective to the children in the scroll listener.
What I can't figure out with CustomScrollView is how to get the looping/infinite scroll.
I liked using the flutter_swiper package a while ago. Not sure if it supports mixed heights, but it has 3D effects. But it doesn't seem maintained, so I would try this null-saefty unofficial fork : flutter_swiper_null_safety

How to do trajectory animation in Flutter?

I'm looking for trajectory animation just like how https://leo9studio.com/ has done. You see while scrolling, those balls get scrolled from top to bottom. How can we replicate exactly in Flutter Web?
Additionally, how to create such a smooth scrolling effect in Flutter?
rive.app would be a good place to start looking, since you aren't really providing any context or code other than just a random idea, they have a great community and I have used their packaged for some neat animation on my web apps. They have a way to create your own designs and animations which would probably be the case there, unless you wanted to make it all with code then that would be a different story.
Or look at this post here How to animate a path in flutter?

Is it possible to not reuse child widgets in using Flutter's AnimatedList?

I'm working on a Flutter app that has features similar to whatsapp where there can be a bunch of messages that are essentially audio players. I'm using AnimatedList so the chat bubbles animate in and out.
The issue is it doesn't seem that AnimatedList supports keepAlive and I haven't come across any alternatives. I don't want the widgets to be recycled because if a message is playing and I scroll the message in and out of view, I want the message to keep playing AND animating and right now I instantiate an audio player and animation controller in each child widget. I could see this being more "optimal" if I maintained all this state outside of the child widgets (at the same level as the list) but the max amount of chat bubbles per conversation in this app is ~50 and we want to move fast instead of be optimal right now so I think this simplification is a good idea if I can keep the widgets alive.
I tried wrapping the child widgets in a KeepAlive with no luck. Below seem like my options:
There is some supported way to do this and I'm not aware of it
There is some alternative / 3rd party lib that supports this
Try using a non animated list and explore other ways to animate
Implement the state above the children
I'd be curious to hear of potential solutions from the community. Thanks!
All the proposed solutions are fine (the fourth is probably the most reliable if you need it to work quickly but not the most efficient for sure...).
Did you think about using one InheritedWidget that you would place above your animated list, which would control the audio player. (I am assuming that you only want one audio playing at a time).
So concretely, you would have an inherited widget that would expose a start(File file) method and a pause(File file) method and the duration property and a unique identifier for the current message being played. This would allow you to keep your state structure simple and still be quite efficient.
I can write a piece of code if my explanation is not clear enough .

Android ListView-like scrolling WITHOUT the ListView

I've been Googling like crazy for a while now, and I simply can't find any answers to the question: is it possible to implement the Android List scrolling, without using an actual list UI?
I'm trying to make a grid of rectangles such as the kind you would find in a typical game app respond to finger movement in the same way that it does using Android lists (bounce on the bounds, the 'flick' effect, etc), but all of the approaches I've found involve over-complicated solutions involving extending the list, defining XML layouts, etc.
Would it not be possible to simply give an object variables for 'document' height, 'viewable' height and y-offset? I'm happy to give the delta (MS since last update) to the object on every update. It would also be good if the actual interactive region was also definable.
Additionally; are there strong advantages to using the ListView instead that I'm missing? I assume responsiveness comes into play, but I'm quite happily managing that manually at the moment.
Just use ScrollView directly, assuming you only need vertical scrolling.