Browse Source

feat(app): Add web flutter platform

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/372/head
jld3103 1 year ago
parent
commit
004e58b168
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. BIN
      packages/app/web/favicon.png
  2. BIN
      packages/app/web/icons/Icon-192.png
  3. BIN
      packages/app/web/icons/Icon-512.png
  4. 59
      packages/app/web/index.html
  5. 23
      packages/app/web/manifest.json
  6. 11
      tool/generate-assets.sh

BIN
packages/app/web/favicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

BIN
packages/app/web/icons/Icon-192.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
packages/app/web/icons/Icon-512.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

59
packages/app/web/index.html

@ -0,0 +1,59 @@
<!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.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="$FLUTTER_BASE_HREF">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A beautiful convergent cross-platform client for Nextcloud written in Flutter.">
<!-- 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="Neon">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<title>Neon</title>
<link rel="manifest" href="manifest.json">
<script>
// The value below is injected by flutter build, do not touch.
var serviceWorkerVersion = null;
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
</head>
<body>
<script>
window.addEventListener('load', function(ev) {
// Download main.dart.js
_flutter.loader.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
},
onEntrypointLoaded: function(engineInitializer) {
engineInitializer.initializeEngine().then(function(appRunner) {
appRunner.runApp();
});
}
});
});
</script>
</body>
</html>

23
packages/app/web/manifest.json

@ -0,0 +1,23 @@
{
"name": "Neon",
"short_name": "Neon",
"start_url": ".",
"display": "standalone",
"background_color": "#f37736",
"theme_color": "#f37736",
"description": "A beautiful convergent cross-platform client for Nextcloud written in Flutter.",
"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"
}
]
}

11
tool/generate-assets.sh

@ -41,6 +41,13 @@ function export_mipmap_icon_all() {
wait wait
} }
function export_favicon() {
source="$1"
size="$2"
destination="$3"
inkscape "$source" -o "$destination" -w "$size" -h "$size"
}
function precompile_assets() { function precompile_assets() {
fvm dart run vector_graphics_compiler --input-dir assets/ fvm dart run vector_graphics_compiler --input-dir assets/
find assets/ -name "*.svg" -exec rm {} \; find assets/ -name "*.svg" -exec rm {} \;
@ -91,6 +98,10 @@ copy_app_svg notifications external/nextcloud-notifications
done done
wait wait
export_favicon "assets/logo.svg" 192 "web/icons/Icon-192.png"
export_favicon "assets/logo.svg" 512 "web/icons/Icon-512.png"
export_favicon "assets/logo.svg" 16 "web/favicon.png"
fvm dart run flutter_native_splash:create fvm dart run flutter_native_splash:create
precompile_assets precompile_assets

Loading…
Cancel
Save