restoreAppFromBackup method
This method prompts a dialog to the user that asks for his confirmation to install the backup apk from the specified path.
Implementation
Future<String> restoreAppFromBackup(String apkPath) async {
assert(apkPath.isNotEmpty, "apkPath can not be empty!");
try {
bool calledSuccessfully = await (_channel.invokeMethod(
"restoreAppFromBackup",
{"apkPath": apkPath},
));
return calledSuccessfully ? "CalledSuccessfully" : "FileNotFound";
} on PlatformException catch (e) {
throwError(e, "installing an app from backup");
return "UnexpectedError";
}
}