Flutter - PIP mode similar to Youtube (Android) - flutter

I am trying to create an app in flutter which consists of:
Home Page
Video Player Page
From the Home Page, the user is able to navigate to the video player page. If the video is playing, when the user clicks the back button or swipe down from the video player, I want to minimize the video player to the bottom of the app (while continue playing) and navigate back to the homepage. This is how Youtube works right now.
After research, I found two approaches to implement this, but each with its own problems.
1. Use the Android PIP mode
Problem:
Android PIP mode works on activity basis. Flutter has only one activity. If I were to implement it this way, the entire app will be minimized when I invoke the PIP mode. I want the user to be able to navigate within the app while the video player is in PIP mode.
Is there a way to have more than one activity in Flutter? If it is possible, then is it advisable to implement it this way?
2. Create a persistent widget
Create a widget that persists on navigation similar to this.
Problem:
I can't wrap my head on how to implement it this way. How do I animate the media player in the nested MaterialApp to minimize to the bottom of the app where the persistent widget is (because it's two separate Material Apps). How do I pass data between them?

Related

Flutter Video Player appears on second time webpage loads and overlay buttons not functional

Link: Website
Problem: The video on the front page below the video banner does not render until you navigate away from the page and return back. When the video finally appears and plays, the play button does not work. Is there a way to have the video appear on first appearance and have the overlay work as expected.
I am using the latest video_player widget to play the video. Other videos I have implemented work just fine.
When I debug my flutter web application, the application pauses at videoController.play() inside initState(). I continue execution to see if there is was an exception, but nothing new shows in debug console.
One solution I found to work is by setting the volume to 0 then starting the video.
This allows the video to play, but the overlay still not functioning as expected, so I just removed it. For now it works, but still wondering on how the overlay can be implemented.

How to implement an expanding minplayer in flutter using just audio

I am working on a simple music player app using the just_audio plugin. I want to have a small miniplayer at the bottom of the screen in the app. It will have basic song info and controls to play and pause. The basic deisgn is -:
when the user clicks on the minplayer I want it to expand into a full screen size and show additional controls like a progress bar, buttons to control the player etc. I tried to do this by passing the audioplayer as a navigator argument but got the error which said that only one instance of player is accepted at a time. Also the big screen should have a button to collapse the player
Please help

Is there any way to capture screenshot of home screen in Flutter, not the app screen

I'm using a screen recording plugin here. I want to add a functionality to capture screenshot of the device's home screen or whatever the user is doing, and I've used different packages, but none of them worked as I wanted.

Flutter Native SplashScreens Background processes

I have created SplashScreens for my Flutter app for both iOS and Android using the native way which is editing the LaunchScreen.storyboard and it is working currently when I run my app but the SplashScreen does not hold long enough and is there a way to programmatically hide the native splashscreen in dart after I am done with some data processing and logic?
The solutions I found online are all flutter apps with SplashScreen that is build using flutter widgets and not the native way...
Even if you build the splash screen if Flutter, you still need to set one in via XCode. Otherwise, the app loads with a momentary plan white screen and Apple rejects it.
If you want to extend the time till the moment data process is over, then you will have to make a replica of LaunchScreen.storyboard in Flutter. The data processing and logic are written in Flutter. There's no way it can tell LaunchScreen.storyboard "I am done". What you can do is though, make a splash screen in Flutter which will look like LaunchScreen.storyboard. And once the data processing is done, you can navigate the user to the desired screen. Since the two screens are same, use won't see the difference and the app will smoothly show the next screen.
Just a word of caution - be careful about extending the timing of launch screen. Apple may reject the app. See if something can be done after the screen load. You can use flutter after layout package for this or the below line will do the trick :
WidgetsBinding.instance
.addPostFrameCallback((_) => myFunction(context));
This thread may help you to delay the screen for XX seconds.

How to make my app interact with Android home screen?

I am building an app that uses frontal camera to track where user is looking at the screen. When user blinks, smartphone registers that as a tap. Currently it works "inside" my app. I have a few dots around the screen, when i look at one of them and blink, it changes color.
But how can I make it work on the home screen/with other apps? Say if user looked at the facebook app, blinked, it would open.
I was thinking of a pop up window like Skype. I could design it as a cursor and it would be displayed above the home screen and all apps. But if i would blink(tap) it would perform an action inside that popup/widget and not click "through" it.
Are there any codes that can make my app interact with other apps. Maybe Accessibility services?
There is a similar app that can create a mouse on the homescreen, when user waves his hand (no physical touch) it registers that as a tap. How can I recreate that?
Picture attached...
Picture