diff --git a/CHANGELOG.md b/CHANGELOG.md index bf0e210b..448f76c6 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.4.3 + +- Added Bitwise OR operator support for `AndroidActionModeMenuItem` class + ## 5.4.2+1 - Fixed "Latest version 5.4.2 crashes on Android - HeadlessInAppWebView.dispose" [#1155](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1155) diff --git a/lib/src/in_app_webview/in_app_webview.dart b/lib/src/in_app_webview/in_app_webview.dart index ba08fc29..482bce89 100755 --- a/lib/src/in_app_webview/in_app_webview.dart +++ b/lib/src/in_app_webview/in_app_webview.dart @@ -8,7 +8,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter/gestures.dart'; -import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import '../context_menu.dart'; import '../types.dart'; @@ -17,6 +16,7 @@ import 'webview.dart'; import 'in_app_webview_controller.dart'; import 'in_app_webview_options.dart'; import '../pull_to_refresh/pull_to_refresh_controller.dart'; +import '../pull_to_refresh/pull_to_refresh_options.dart'; ///Flutter Widget for adding an **inline native WebView** integrated in the flutter widget tree. class InAppWebView extends StatefulWidget implements WebView { diff --git a/lib/src/types.dart b/lib/src/types.dart index d0dfef75..198777cb 100755 --- a/lib/src/types.dart +++ b/lib/src/types.dart @@ -1966,7 +1966,8 @@ class AndroidActionModeMenuItem { return AndroidActionModeMenuItem.values .firstWhere((element) => element.toValue() == value); } catch (e) { - return null; + // maybe coming from a Bitwise OR operator + return AndroidActionModeMenuItem._internal(value); } } return null; @@ -1984,9 +1985,9 @@ class AndroidActionModeMenuItem { case 4: return "MENU_ITEM_PROCESS_TEXT"; case 0: - default: return "MENU_ITEM_NONE"; } + return _value.toString(); } ///No menu items should be disabled. @@ -2005,6 +2006,9 @@ class AndroidActionModeMenuItem { bool operator ==(value) => value == _value; + AndroidActionModeMenuItem operator |(AndroidActionModeMenuItem value) => + AndroidActionModeMenuItem._internal(value.toValue() | _value); + @override int get hashCode => _value.hashCode; } diff --git a/pubspec.yaml b/pubspec.yaml index 320956f4..e8ba176e 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_inappwebview description: A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window. -version: 5.4.2+1 +version: 5.4.3 homepage: https://github.com/pichillilorenzo/flutter_inappwebview environment: