How do I do a two-finger rotate gesture in Flutter? - dart

I'm using Flutter for my mobile app. My designer told me to use a "two-finger rotate" gesture for one of our screens. How do I implement this with Flutter?

I hope I'm wrong. But it doesn't seems like this has been implemented yet.
Ideally you should create a RotationGestureRecognizer that extends OneSequenceGestureRecognizer ; which can then be added in GestureDetector (and submit a cool pull request). You can use ScaleGestureRecognizer as exemple.
You could also use onPanDown, onPanUpdate and onPanEnd to keep the position of all pointers. And use the onPanUpdate delta to calculate the rotation.

Related

Create a grid of 1000*1000 in flutter

i'm looking for create a grid of 1000*1000 box. User should be able to click on one and zoom in. Do anyone knows a material to do so ?
I tried to do a gridview, way to long to be initialize for only 2000 unity
Thanks for reading
If performance is a problem, use a CustomPainter and a GestureDetector to handle painting and gesture detection manually. Make sure that you only paint the boxes which are visible on screen.

How does Uber achieve this UI in WatchKit?

How does it superimpose elements (the timer is above the map) ?
To my understanding, you can only use background images on groups, no other kind of custom views...
Any idea ?
My initial guess is that they're using a dynamically-generated image of a map as the background image in the group. The giveaway is that, while WKInterfaceMap allows you to add custom annotations, you can't draw custom shapes like the blue route line.
I could be way off.
The way Uber (and most of the big companies custom's UI) is done is that they're just generating an image in the iOS which is the sent back to the WatchKit extensions and simply displayed as an image.
If you want to create your custom UI with hte current version of the SDK, this is the only way to achieve exactly what you want. You will need some hacks to achieve interactivity but you should be able to do that on your own :)

iOS texting bubble physics at work

On an iPhone, in the standard messaging app, the text bubble will keep going up even after it has seemingly met the edge-of-the-screen limit, if you keep pushing it with two fingers.
What is allowing that to happen?
How would I replicate that so my code isn't so "fixed" and just stops exactly at the variable where it's supposed to?
Also, is there a name for the "bouncy" text physics that we see in android and iOS?
UIKit Dynamics is the high level name. http://www.doubleencore.com/2013/09/ios-7-uikit-dynamics/
Don't make a boundary - make a constraint.
Is it the case that you can't push the bubble 'outside of the screen', or is it more that you can't drag it further than the initial drag point?

iOS: Facebook chat heads behaviour and animations

This question is probably a little out of date, but I've been using the new Facebook for iOS with the "chat heads" feature (with the chat heads only present within the app), and was wondering how Facebook went about implementing this? E.g. How did they handle the drag animations for the chat heads, and also (when clicking on the chat head) how did they manage to overlay a UITableView on top of the "base" UIViews in the background?
Is this all part of UIKit, or did they create their own classes to handle this?
To answer #StuartM's question in the comments, in the last couple of months I've had a bit more experience with UIKit, and I think I have a rough idea on how I would implement something like this if I was going to do it.
What I would do is for the chat head, create a styled UIButton and add it as subview to the main Window. For the dragging, I would add a Gesture Recognizer to the UIButton to respond to the drags, and for the "snapping to edges" I would use iOS 7's new UIKit Dynamics (http://www.raywenderlich.com/50197/uikit-dynamics-tutorial).
As for showing the UITableView overlay with the chat history, I would use a Child View Controller (https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html#//apple_ref/doc/uid/TP40007457-CH18-SW6) and as for the popping open animation, I would just use the default UIView animations, maybe using animation transactions as I'm not sure I can do everything with just the implicit animations?
And I think that should be it. To be honest, I think anyone who has a handle on those frameworks should be able to build anything in their iOS apps, and if you were to create a "chat heads" like sample project in your spare time, should give you a pretty indepth knowledge of how those frameworks work.

iOS - View Transition open and close

In the latest Expedia app for iOS, they have a very interesting effect that I am trying to wrap my head around.
When you tap on any tile it flip and zoom animation.
Can you please help me for the same for UIView transition.
I've wanted to use this kind of animations in my app as well, so I have written a simple custom segue that does just that - you can even choose between multiple types of flips!
It's called IBCellFlipSegue, give it a try and let me know what you think!
https://github.com/IBLabs/IBCellFlipSegue

Resources