I am currently developing a Launcher application using flutter. I got all installed application using dart plugin but after that if I select the application to open it opens but it do not enables the Kiosk mode. And my second concern is after opening the application in Kiosk mode I only want to disable the Home button and recent button I do not want to disable back button as I do not need to disable it according to requirement.
Code Snippet
onTap: () async {
loadSelectedApp();
await _showConfirmationDialog(context, application);
},
- This is where I am opening my application
Future<void> _showConfirmationDialog(
BuildContext context, Application application) {
return showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text("Open Application"),
content: Text("Are you Sure you want to open Application?"),
actions: [
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text("No")),
TextButton(
onPressed: () {
stopKioskMode()
.then((value) =>
{DeviceApps.openApp(application.packageName)})
.then((value) => {showMessageAlert(context)});
Navigator.of(context).pop();
},
child: Text("Yes"))
],
);
});
}
- This is the function where i am opening my application in Kiosk Mode but it do not pin my application. And I just want to disable
Home button
andrecent button
.