From 40140e50e12d253952e05b475477f849694f9d79 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Fri, 22 Apr 2022 13:43:25 +0200 Subject: [PATCH] updated setOptions and getOptions deprecated methods --- lib/src/in_app_webview/in_app_webview_controller.dart | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/src/in_app_webview/in_app_webview_controller.dart b/lib/src/in_app_webview/in_app_webview_controller.dart index 33dd0bb2..b68b9445 100644 --- a/lib/src/in_app_webview/in_app_webview_controller.dart +++ b/lib/src/in_app_webview/in_app_webview_controller.dart @@ -1847,19 +1847,16 @@ class InAppWebViewController ///Use [setSettings] instead. @Deprecated('Use setSettings instead') Future setOptions({required InAppWebViewGroupOptions options}) async { - Map args = {}; - - args.putIfAbsent('settings', () => options.toMap()); - await _channel.invokeMethod('setSettings', args); + InAppWebViewSettings settings = InAppWebViewSettings.fromMap(options.toMap()); + await setSettings(settings: settings); } ///Use [getSettings] instead. @Deprecated('Use getSettings instead') Future getOptions() async { - Map args = {}; + InAppWebViewSettings? settings = await getSettings(); - Map? options = - await _channel.invokeMethod('getSettings', args); + Map? options = settings?.toMap(); if (options != null) { options = options.cast(); return InAppWebViewGroupOptions.fromMap(options as Map);