android dialog phonegap - android-widget

I'm using phonegap on android. Now I encouter some problems about showing dialog on current activity. There are two activity in my application(another is googlemap activity). The question is that, when my googlemap activity is in the top, but when I use phonegap show dialog method, the dialog is invisiable except you finish googlemap activity and return back to droidgap activity.

Make sure you specify the googlemap activity as the context when you create your dialog.

Related

How to handle back button on appBar of Scaffold layout in flutter module and navigate to previous page on the host app

I have a question, I have to create a flutter module and integrate it directly into the host app. I want to handle the back button on flutter UI by clicking it and navigating to the previous page on the host app. I use go_router to handle navigation on the module and host app. I have never integrated it. I have no idea to handle the back button it works on the appBar inside the flutter module. In this case, I would like to handle it by method channel or not?
I want to get the solution for the handle back button on the appBar in the flutter module. It must to click and navigate from flutter module and goto previous page on the host app.
I just found a way. After setup the flutter module inside Android or iOS, We can use this code setup inside the AppBar to close the page.
if(Platform.isAndroid){
SystemNavigator.pop();
} else {
exit(0);
}

ShowSearch function rebuilds the whole widget tree on Flutter

I have a problem when i navigate to multiple pages and then show search.
More specifically, i have a product page with some details. At the bottom there is a list of similar products.
The flow is:
open many similar products (so I navigate to the same screen using Navigator pushNamed).
then, navigate from the las product page to the search page
tap on search bar, open search delegate using the showSearch function
My issue is that when i tap on the search bar, then the whole widget tree is rebuilded and my app is very heavy because rebuilds the previous product pages and everything else.
This happens due to the general rebuild on keyboard changes(i.e: showing and hiding Keyboard).
I recommend to have a heavy operation like loading data from backend should be held on initState in State with StatefullWidget.
Try to debug and understand why do you rebuild the tree. It seems to me, that you need to simplify a navigation flow.

I don't know how to activate the phone button to go back without appbar

I created a flutter webview, but when I try to go back to the previous page the app closes. How can I activate the back key on the phone? I would like to use the phone key without adding any more. I thought about using Onbackpressed but in flutter it is not possible. Or you can use Willpopscope () but it doesn't work for me, someone help me please!!
You need to put your app in scaffold and implement onWillPop feature for scaffold.

To show pop-up on screen after call ends in flutter

How to make a flutter app work always in the background, so that after a call ends, I can show a pop-up on the screen(similar to truecaller app).
How to implement this in dart?
You can checkout Alert Dialog here
https://api.flutter.dev/flutter/material/AlertDialog-class.html

How do i implement platform specific notification that when clicked opens the flutter app or a particular widget in the app

I have a platform specific background service in android that shows a notification. i want it to have a functionality - when the notification is been clicked i want the flutter app to start or even better open to a particular widget, is this possible in flutter ?
Open the app is the default behavior when a notification is tapped. To perform a specific operation when the app is open you can pass data in that notification and handle it in a root widget, to intercept it and for example navigate to a specific page in your app.