I would like to make a Hero animation between a marker displayed on the map and a detail page.
The problem is the marker is not a Widget and can not be wrapped by a Hero object.
Is there a workaround / solution ?
Those are default markers .You can create custom widgets for Markers also.There you can wrap your widget with Hero tag.You can see this link how to create custom marker widget google maps flutter.
Related
I'm looking for an animation from a GridView Selection to a new Page.
Here is the transmission I like to have:
But I don't know how to make this. I could use a AnimatedContainer for each GridViewItem, but this would not help to "break out" from the Grid during the animation.
Should I use a Stack and a Positioned AnimatedContainer? What is the best attempt here?
Try to use the Hero Widget. In Simple, you'll have to wrap the grid element with the hero widget and pass the tag within the screen.
A Code example is available in the official documentation.
I am making an app whose structure is very simple.
A ListView with Listtiles in it.
I want to add animation such that when the screen is opened the listtiles slide in.
Flutter provides a AnimatedList Widget.
Perhaps this native widget will give you the desired output
I want to have a sticky widget similar to the floating widgets in scaffolds, difference is that this widget would belong to a ListView, when it isn't on screen it would behave as a floating widget, when user scrolls so its position be visible it would start animating to stay on its position on the ListView.
Here is a visual example of what I am trying to achieve
https://miro.medium.com/max/1200/1*GsH-kEVNtoDZaM0ZjNYRpQ.gif (the 'MY STICKY BUTTON' widget)
is this even possible in flutter ? and if so how ?
Thanks in advance!
How can I combine a swiper action with a fade-in/fade-out action in another area of the screen?
My screen is divided into two halves: The Top is a text widget and the bottom is a swiper widget with two pages. My goal is to fade-out the text in the top half when I swipe to the second page in the bottom half.
I'm using this dependency for the swiper widget in the bottom half: https://pub.dev/packages/flutter_swiper
I solved it by using GestureDetector widget and updated the opacity via the state.
The GestureDetector needed two functions: onDragUpdate and onDragEnd. Both changed the state of the progress which is also used to update the opacity in the other half.
Quite some work for such a small interaction, however, it works.
Is it possible to use anchor links on a flutter screen to scroll a listview / customscrollview to a certain spot in a page - similar to using anchor links (a href="#" a name="") in HTML?
I've searched for code examples or flutter packages but haven't found anything.
if i'm understaing clearly that you want to jump to certain index
there is a simple method using this package
You can also simply build your own anchor logic with .jumpTo(double (vertical Offset value)) method from ScrollController that you can pass to any sliver widget like CustomScrollView.
Then you can write an extension method on widget that registers Offsets of your anchor objects (have to declare globalKeys on them)
extension GetOffset on Widget {
Offset getOffset() { return this.key.currenContext.findRenderObject().localToGlobal(Offset.zero)}
}
then register the offsets in some shared state to be accesible to the ScrollController and then you can programatically jump to certain positions on the scroll view