Skip to content

Commit

Permalink
fix publish.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
pichillilorenzo committed Mar 1, 2021
1 parent 03a09bf commit a885802
Show file tree
Hide file tree
Showing 12 changed files with 2,118 additions and 1,263 deletions.
738 changes: 738 additions & 0 deletions .idea/libraries/Dart_Packages.xml

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions .idea/libraries/Flutter_Plugins.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2,193 changes: 1,149 additions & 1,044 deletions example/integration_test/webview_flutter_test.dart

Large diffs are not rendered by default.

41 changes: 24 additions & 17 deletions example/lib/chrome_safari_browser_example.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'main.dart';

class MyChromeSafariBrowser extends ChromeSafariBrowser {

@override
void onOpened() {
print("ChromeSafari browser opened");
Expand All @@ -22,8 +21,7 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser {
}

class ChromeSafariBrowserExampleScreen extends StatefulWidget {
final ChromeSafariBrowser browser =
MyChromeSafariBrowser();
final ChromeSafariBrowser browser = MyChromeSafariBrowser();

@override
_ChromeSafariBrowserExampleScreenState createState() =>
Expand All @@ -34,16 +32,22 @@ class _ChromeSafariBrowserExampleScreenState
extends State<ChromeSafariBrowserExampleScreen> {
@override
void initState() {
widget.browser.addMenuItem(ChromeSafariBrowserMenuItem(id: 1, label: 'Custom item menu 1', action: (url, title) {
print('Custom item menu 1 clicked!');
print(url);
print(title);
}));
widget.browser.addMenuItem(ChromeSafariBrowserMenuItem(id: 2, label: 'Custom item menu 2', action: (url, title) {
print('Custom item menu 2 clicked!');
print(url);
print(title);
}));
widget.browser.addMenuItem(ChromeSafariBrowserMenuItem(
id: 1,
label: 'Custom item menu 1',
action: (url, title) {
print('Custom item menu 1 clicked!');
print(url);
print(title);
}));
widget.browser.addMenuItem(ChromeSafariBrowserMenuItem(
id: 2,
label: 'Custom item menu 2',
action: (url, title) {
print('Custom item menu 2 clicked!');
print(url);
print(title);
}));
super.initState();
}

Expand All @@ -61,11 +65,14 @@ class _ChromeSafariBrowserExampleScreenState
await widget.browser.open(
url: Uri.parse("https://flutter.dev/"),
options: ChromeSafariBrowserClassOptions(
android: AndroidChromeCustomTabsOptions(addDefaultShareMenuItem: false, keepAliveEnabled: true),
android: AndroidChromeCustomTabsOptions(
addDefaultShareMenuItem: false,
keepAliveEnabled: true),
ios: IOSSafariOptions(
dismissButtonStyle: IOSSafariDismissButtonStyle.CLOSE,
presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN
)));
dismissButtonStyle:
IOSSafariDismissButtonStyle.CLOSE,
presentationStyle:
IOSUIModalPresentationStyle.OVER_FULL_SCREEN)));
},
child: Text("Open Chrome Safari Browser")),
));
Expand Down
55 changes: 26 additions & 29 deletions example/lib/headless_in_app_webview.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class HeadlessInAppWebViewExampleScreen extends StatefulWidget {
new _HeadlessInAppWebViewExampleScreenState();
}

class _HeadlessInAppWebViewExampleScreenState extends State<HeadlessInAppWebViewExampleScreen> {
class _HeadlessInAppWebViewExampleScreenState
extends State<HeadlessInAppWebViewExampleScreen> {
HeadlessInAppWebView? headlessWebView;
String url = "";

Expand All @@ -19,13 +20,9 @@ class _HeadlessInAppWebViewExampleScreenState extends State<HeadlessInAppWebView
super.initState();

headlessWebView = new HeadlessInAppWebView(
initialUrlRequest: URLRequest(
url: Uri.parse("https://flutter.dev")
),
initialUrlRequest: URLRequest(url: Uri.parse("https://flutter.dev")),
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(

),
crossPlatform: InAppWebViewOptions(),
),
onWebViewCreated: (controller) {
print('HeadlessInAppWebView created!');
Expand Down Expand Up @@ -69,40 +66,40 @@ class _HeadlessInAppWebViewExampleScreenState extends State<HeadlessInAppWebView
)),
drawer: myDrawer(context: context),
body: SafeArea(
child: Column(children: <Widget>[
Container(
child: Column(children: <Widget>[
Container(
padding: EdgeInsets.all(20.0),
child: Text(
"CURRENT URL\n${(url.length > 50) ? url.substring(0, 50) + "..." : url}"),
),
Center(
child: ElevatedButton(
onPressed: () async {
await headlessWebView?.dispose();
await headlessWebView?.run();
},
child: Text("Run HeadlessInAppWebView")),
onPressed: () async {
await headlessWebView?.dispose();
await headlessWebView?.run();
},
child: Text("Run HeadlessInAppWebView")),
),
Center(
child: ElevatedButton(
onPressed: () async {
try {
await headlessWebView?.webViewController.evaluateJavascript(source: """console.log('Here is the message!');""");
} on MissingPluginException {
print("HeadlessInAppWebView is not running. Click on \"Run HeadlessInAppWebView\"!");
}
},
child: Text("Send console.log message")),
onPressed: () async {
try {
await headlessWebView?.webViewController.evaluateJavascript(
source: """console.log('Here is the message!');""");
} on MissingPluginException {
print(
"HeadlessInAppWebView is not running. Click on \"Run HeadlessInAppWebView\"!");
}
},
child: Text("Send console.log message")),
),
Center(
child: ElevatedButton(
onPressed: () {
headlessWebView?.dispose();
},
child: Text("Dispose HeadlessInAppWebView")),
onPressed: () {
headlessWebView?.dispose();
},
child: Text("Dispose HeadlessInAppWebView")),
)
])
)
);
])));
}
}
45 changes: 23 additions & 22 deletions example/lib/in_app_browser_example.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'main.dart';

class MyInAppBrowser extends InAppBrowser {

MyInAppBrowser({int? windowId, UnmodifiableListView<UserScript>? initialUserScripts}) : super(windowId: windowId, initialUserScripts: initialUserScripts);
MyInAppBrowser(
{int? windowId, UnmodifiableListView<UserScript>? initialUserScripts})
: super(windowId: windowId, initialUserScripts: initialUserScripts);

@override
Future onBrowserCreated() async {
Expand Down Expand Up @@ -91,28 +92,28 @@ class _InAppBrowserExampleScreenState extends State<InAppBrowserExampleScreen> {
drawer: myDrawer(context: context),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
onPressed: () async {
await widget.browser.openUrlRequest(
urlRequest: URLRequest(url: Uri.parse("https://flutter.dev")),
options: InAppBrowserClassOptions(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
onPressed: () async {
await widget.browser.openUrlRequest(
urlRequest:
URLRequest(url: Uri.parse("https://flutter.dev")),
options: InAppBrowserClassOptions(
inAppWebViewGroupOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
useShouldOverrideUrlLoading: true,
useOnLoadResource: true,
)
)));
},
child: Text("Open In-App Browser")),
Container(height: 40),
ElevatedButton(
onPressed: () async {
await InAppBrowser.openWithSystemBrowser(
url: Uri.parse("https://flutter.dev/"));
},
child: Text("Open System Browser")),
useShouldOverrideUrlLoading: true,
useOnLoadResource: true,
))));
},
child: Text("Open In-App Browser")),
Container(height: 40),
ElevatedButton(
onPressed: () async {
await InAppBrowser.openWithSystemBrowser(
url: Uri.parse("https://flutter.dev/"));
},
child: Text("Open System Browser")),
])));
}
}
Loading

0 comments on commit a885802

Please sign in to comment.