How to make dart Widgets fully transparent to see platform native view under FlutterView? - flutter

I want to create a video chat app, using some platform native SDK like WebRTC to implement the video part, using flutter to implement other interactivity, how could I achieve that?
In Android, I try to hook the createFlutterView method, create a FrameLayout to hold the FlutterView and other native views under FlutterView, and make it as Activity's content view by setContentView.
FlutterView is a subclass of SurfaceView, so I can make it transparent like this:
flutterView.setZOrderOnTop(true);
flutterView.getHolder().setFormat(PixelFormat.TRANSPARENT);
To make FlutterView's surface background transparent, I declare android:colorBackground as #00000000 in my theme, according to FlutterView's source code.
With those setup, I can see the view under FlutterView for a short period, after that it's covered by Widgets declared in dart code. I think that short period is the dart code load time.
To verify that, I create a pure Android project with the same views as above, but without any dart code. In that project, views under FlutterView show well all the time.
So, my question is, how to make dart Widgets fully transparent to see platform native view under FlutterView?

Related

Flutter : Samsung Galaxy Watch 4 Classic - Rotating Bezel

So, I am using wear plugin for this, the first exciting thing I wanted to try out was scrolling through a ListView or a PageView using the rotating bezel. But that didn't happen. I searched too, but didn't find anything for flutter.
Is setting up a custom method channel the only way for now? Are there any details I'm missing out on?
UPDATE : Native method requires a View object to use view.setOnGenericMotionListener. Since flutter renders it's own views, I can't access it via method channel. Please correct me if I'm wrong and if it's possible to put a listener on the view generated by flutter itself.

Flutter Splash Screen Animation

I want to create a custom animated splash screen like the splash screen of Uber iOS App:
I tried to create two containers and animate them but not even close to what Uber did.
Is there any way to do it programmatically instead of creating the animation and import it within the app?
Your question is not detailed so all I can do is giving a topic to you to train.
Flutter has a nice capability of animating things, but if the animation is too complicated, I prefer pre-built animations like AfterEffect or sth like that.
You can possibly do what you want using AnimatedContainer. But first, you need to gather more than basic animation knowledge in this area, so, here is the topic you need to dig..
One way is using CustomPainter, but it is also possible to use other built-in flutter widgets like explained here: https://flutter.dev/docs/development/ui/animations

Making soap bubble input selection (like in apple music)

The goal is to develop a widget where I can pass an array of strings and it generates the soap bubbles like in the video, including the physics effect when you drag them around. Does anyone know how to implement a widget like this, are there any libraries that provide the physics for the bubbles?
Here is the video I am talking about: https://youtu.be/ydYah_BXt9A?t=29
I had the same issue - ended up going with React Native and then embedding it into the flutter app
Here is an example project I found on GitHub that I used as foundation: react-native-bubble-select

Animating between screens in Nativescript

Can someone please point me in the right direction to achieving this effect in both Android and iOS application, https://www.cocoacontrols.com/controls/pinterestanimator. Not necessarily this effect, but you will notice that the transition between two screens (list and details) is animated in non standard way (image enlarges).
The idea is to execute an animation between two screens, so that upon animation finish, the route is changed, backend service kicks in, etc. Not sure if I am expressing myself right, but how do I "swap" native screens transitions, with a custom animation? And doing this on case by case basis, not as a general rule to all transitions.
I am using Angular2 and Nativescript.
--
Edit: It is fine if the solution above seems like a hack, it doesn't have to be supported out of the box. To clarify, is it anyhow possible to:
capture and prevent default click action, thus preventing the native transition
animate the view
update the route programatically
execute the previously prevented action (call ngOnInit, or similar)
The page transitions can not be fully customized and currenтly you can only apply native transitions as the following listed in this API reference
curl (same as curlUp) (iOS only)
curlUp (iOS only)
curlDown (iOS only)
explode (Android Lollipop(21) and up only)
fade
flip (same as flipRight)
flipRight
flipLeft
slide (same as slideLeft)
slideLeft
slideRight
slideTop
slideBottom
Notice that some of the transitions (like curl) are supported only by iOS and others (like explode) are supported only by Android. Here is the documentation article about page transitions in Angular enabled application.

Porting iPhone UI with multiple screens over a map to Android. Use multiple Activities?

I have this setup in an iPhone app:
There is always a MKMapView on screen & a additional UI layer on top. The upper UI layer is managed by a simple state system. Each state is a UIViewController and has a .nib attached to it containing the layout.
I'm very new to Android development. What is the best way to build this on Android?
So far I see two options:
1. Have a single Activity & insert/remove layouts as the states change.
2. Have multiple Activities and have a layout for each. Is there then a way to keep a single MapView around beneath, without having one per activity?
Thanks.
In general, it is easier to have multiple activities, each with their own layout.
Before you get to far, make sure you read through the basic Android documentation and UI guidelines. Android has some UI paradigms that are a little bit different from the iPhone, so you generally don't want to just copy over exactly what you have.