I am trying to implement a ReverseAnimation (hero animation) in my pageview possibly without using external packages - flutter

I have a pageview with 6 pages. In each of these there is the app logo (a png enclosed by hero). I need that, although it is a pageview and the Navigator is not called, the animation is a ReverseAnimation.
I have read that you can use the "coast" package, but I am not able to implement it and, to be honest, I would like to minimize the use of packages.
I apologize for the bad quality of the gifs but I had to compress the files.

I know this is not what you want to hear but I Must say, without using the "coast" package or something similar, implementing what you want is exceedingly difficult. that's exactly why there are packages in the first place. if you faced problems with implementing that package, please post that problem instead.

Related

Is it possible to make Flutter 60FPS smooth, no matter how janky and slow my app currently is, using general-purpose and easy-to-use existing tools?

I have a Flutter app which is becoming more and more janky as time goes by and more features are added. Therefore, is there some utility to make it as smooth as 60FPS?
I know there are some official guides here: https://docs.flutter.dev/perf. However, I have tried to optimize and it is still slow. You know, some things just cannot be fast enough, such as long text, dynamic layout, necessary synchronous computations, etc. Especially when entering a new page or scrolling down a ListView. In addition, I have to use brainpower to find out what is slow and optimize when new features are added, so I hope there is some fully automatic thing which I can drop-in replace and forget it and it just works forever.
Disclaimer: I wrote this package and this is a Q&A style StackOverflow answer.
Yes, I have made it: https://github.com/fzyzcjy/flutter_smooth.
No matter how heavy the tree is to build/layout, it will run at (roughly) full FPS, feel smooth, has zero uncomfortable janks, with neglitable overhead. (I have made some benchmark reports here)
As for usage, for common scenarios, add 6 characters ("Smooth") - ListView becomes SmoothListView, MaterialPageRoute becomes SmoothMaterialPageRoute. For complex cases, use SmoothBuilder(builder: ...) and put whatever you want to be smooth inside the builder.
Roughly speaking about the implementation, it is done by submitting extra frames to the rasterizer every ~16ms, without disturbing all existing code. Therefore, the existing app code will almost not even know the existence of this package.
You need to check how do you use widgets, unnecessary rebuilds, some heavy operations when the widget is creating o rebuilding and it’s recommended to use the performance profiler in the devtools.

flutter - is it possible to use flutter code to represent something similar to this?

Is there a way to show the following with flutter?
As far as I know, only the corners of a container can be rounded off. I asked myself whether it is also possible to display something similar to the one in the picture below using flutter codes?
Since I don't even begin to know how and if you could do something like that, I am very curious about the answers, but I reckon that it could possibly be complicated.
YES!
It can be done by using path in flutter.
You can do each shape separately and then put them in a row.
Read this well organized article about path in flutter, then you can build all types of path. good luck :)
I see two main ways to approach this. Either use an image with the design from above, and use a Stack widget to add the text and icon on top.
The second option would be to use customPainter or possibly paths to make your custom shape. The documentation is here: https://api.flutter.dev/flutter/rendering/CustomPainter-class.html

Flutter - Merge video and widgets

I have a screen with a video as background and I can add text, images (gif or not), emojis, etc.. over it. I can already generate images from Widgets which will work well for non gifs images.
All right it is working quite right, but now I need to compile all into a single video. Someone can tell me what is the easyest way to do that?
Ps.: There's this package, but I'm not sure if it is what I need for it.
https://pub.dev/packages/flutter_ffmpeg
Yes, this package will do the work, but is very complex and request a lot of time studying it, have fun =)

Easy way to build an in-app demo like they do in Convertbot?

I want to make a little in-app demo like Tapbots does in Convertbot. Maybe there is a better solution than mine?
make everything programmatically controlable
write a huge class with hundreds of performSelector:withObject:afterDelay: calls to control the whole app for the demo
The demo actually only does two things:
Simulate touches on controls (i.e. programmatically pressing buttons)
Show text message bubbles when appropriate to explain what is going on
How would you do it?
I don't think there is an easy way to accomplish this.
My suggestion would be to create a class that runs a script of actions for you. The script itself could be as simple as an NSArray of objects representing steps in the demo, each with values such as text for a callout bubble, an action/target pairing (for calling selectors), delay, and so forth. Use NSButton setHighlighted: to simulate button presses. Your class then runs through the array of steps to conduct the demo. You could code this directly, or construct the script at runtime from a YAML file (or other file format that you find easy to edit).
I would expect that investing some time in a mechanism like this will make your life a lot easier when it comes time to a) write and b) fine tune your demo, particularly down the road when you want to add features. You don't want to be managing a huge list of hardcoded calls. And you might even be able to re-use the demo-running code on other projects.

Display "custom" view (various images, various text). Should I use UIWebView?

First: No, none of the content should be loaded from the web. All content parts are shipped with the main bundle.
I have n images and mass of text (including lists). Instead of building all view parts programmatically in objective-c if was thinking of using an UIWebView and build "only" the HTML dynamically.
Does anything speaks against it?
How does UIWebView work with local content?
Links and resources welcome.
Thanks
I would not recommend using the WebView for building application UIs. It introduces many elements that may cripple the user experience. Well, it basically depends on the complexity of the UI.
I created an App UI in WebView myself, using JavaScript and all that advanced CSS animations/transforms that WebKit has to offer, but in the end it was not good for the consumer. My goal was to make the app skinnable, but if something goes wrong - for example in JS - the WebView is stuck, except you spend the time into building a WebView wrapper for your app that deals with this.
That said I, i don't know how complex your UI is going to be, but I would say using IB or building the UI in code with cocoa is still more efficient.
Regards, Erik
I've thought about using web views in these situations sometimes, but then decided against it. 99% of the time, it's better to design the screen in Interface Builder. That will be as fast as or faster than creating an HTML page, and will give you all the benefits of elements functioning as expected (text input for example) and the possibility of customizing things programmatically. But of course, in many scenarios a web view might be the way to go (in fact, several standard UI elements have underlying web views).