Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added packages/share_plus/example/web/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions packages/share_plus/example/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.

The path provided below has to start and end with a slash "/" in order for
it to work correctly.

Fore more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
-->
<base href="/">

<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">

<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="example">
<link rel="apple-touch-icon" href="icons/Icon-192.png">

<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>

<title>example</title>
<link rel="manifest" href="manifest.json">
</head>
<body>
<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('flutter-first-frame', function () {
navigator.serviceWorker.register('flutter_service_worker.js');
});
}
</script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>
23 changes: 23 additions & 0 deletions packages/share_plus/example/web/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "example",
"short_name": "example",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "A new Flutter project.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
4 changes: 2 additions & 2 deletions packages/share_plus/lib/share_plus.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class Share {
// See https://github.com/flutter/flutter/issues/52267 for more details.
static SharePlatform get _platform {
if (__platform == null) {
if (!_disablePlatformOverride) {
if (!kIsWeb && Platform.isLinux) {
if (!_disablePlatformOverride && !kIsWeb) {
if (Platform.isLinux) {
__platform = ShareLinux();
} else if (Platform.isWindows) {
__platform = ShareWindows();
Expand Down
3 changes: 3 additions & 0 deletions packages/share_plus/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ flutter:
pluginClass: FLTSharePlugin
linux:
default_package: share_plus_linux
web:
default_package: share_plus_web
windows:
default_package: share_plus_windows

Expand All @@ -25,6 +27,7 @@ dependencies:
share_plus_platform_interface: ^1.1.0
share_plus_linux: ^1.1.0
share_plus_windows: ^0.1.0
share_plus_web: ^0.1.0

dev_dependencies:
test: ^1.3.0
Expand Down
2 changes: 1 addition & 1 deletion packages/share_plus_web/lib/share_plus_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:url_launcher/url_launcher.dart';
class SharePlugin extends SharePlatform {
/// Registers this class as the default instance of [SharePlatform].
static void registerWith(Registrar registrar) {
SharePlatform.instance = SharePlatform();
SharePlatform.instance = SharePlugin();
}

final _navigator;
Expand Down