How do I programmatically scale or pinch in flutter? - flutter

I have a screen that uses gestures to do some calculations in onScaleUpdate. Now I'd like to manually call onScaleUpdate when certain action is performed, how can I do it?
I tried to use flutter driver to achieve my goal but I don't think it's the right way to do it.

Related

Flutter: Achieving custom page swipe animation with pageview

I'm trying to make a custom animation for pageview and was looking for some guidance.
I already tried using transformer pageview but in my use case it's crashing and found it unreliable.
I'm looking to implement 2 animations
depth based transition where a pages move behind and scale back
regular overlay, during swipe pages are stacked on top of each other
I want to know if it's possible to achieve this with regular pageview, if so how do I go about it?
Appreciate your help

How do I detect more than one gesture on a single widget in flutter?

I want to listen for tap events on a widget and take one action for that, and a hold event and take a different action for that. It looks like flutter gesture detector can only detect a single gesture? This seems like it would be hugely limiting for mobile development though, so I figured there must be a way to detect two different gestures on one widget. How would I do that?
if you see the api docs, you will see there are detectors like doubletap, longpress etc
https://api.flutter.dev/flutter/widgets/GestureDetector-class.html

Flutter pan/zoom via gesture or function

My goal is to have a container of some sort, that I can zoom and pan via gestures, but also need to be able to zoom and pan to a specific location in the container via a button. I've tried all sorts of combinations of GestureDetector's mixed with Matrix4Transform and MatrixGestureDetector but am not having any luck allowing both hand and function initiated gestures to work together. Does anyone have something like this already working, and if so could you share any hints? Thanks
Take a look at this package: photo_view.

How to implement stories progress view in flutter

I want to know to the best way in order to develop a widget/view which can work as instagram, snapchat stories which illustrated in image below. There are many depndencies for android, but can't find any for flutter.
I'm thinking to use carousal/viewpager to move between stories of different users, but I'm unable to get how to move backward and forward in between stories of single user(either image or video) with progress bar on top of it which will move automatically to next when progress bar completes.
Try to create a custom ViewPager perhaps using Stack + Transform and use GestureDetector to switch between pages/stories.
I know this question has been asked for a long time, but for those who still ask the same question, you can use this library: https://pub.dev/packages/story_view or look at it's source to implement the same thing.
Not sure if you also want to give the user a chance to manually switch to the next image.
Here are some basic ingredients you want to use for an animated "story":
AnimationController with duration depending on the number of images in the story. Start the animation to go through the images and to animate the progress bar. The animation controller usually has a range from 0.0 to 1.0. Let's say you have 5 images. You would display the first image from 0.0 to 0.2, the second image from 0.2 to 0.4...
AnimatedBuilder that listens to the animation controller. The content inside the animation builder will be rebuilt every frame while the animation runs. Inside of the builder, calculate which image must be shown.
CustomPaint to manually draw a progress bar with sections for the single image. Pass the current animation value and the number of images to your CustomPainter.
Image widget to draw the image.

How can I make an iPhone UIView "pulse" or fade from one color to another repeatedly?

I want a UIView with a glowing or pulsing effect, like the status bar during a call on the iPhone. Does anyone know how I would go about doing this? I've experimented with NSTimer but can't seem to find how to go about this.
Thanks!
The animation API has the ability to message a callback you provide when the animation completes. You can use the API to daisy-chain together a series of animations from one state to another, giving the pulse effect you are looking for.