Skip to content

Commit

Permalink
Merge a940299 into 7329784
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorAguero authored May 8, 2024
2 parents 7329784 + a940299 commit 8a9f4c8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ jobs:
- name: Install dependencies
run: flutter pub get

# 404.html and flutter_bootstrap.js are mannually added to the web folder to
# fix the 404 error on GH Pages and fix PWA Padding issue
- name: Build web
run: flutter build web --wasm --base-href /batucadapp/
run: flutter build web --wasm --base-href /batucadapp/ --no-web-resources-cdn

- name: Commit changes
run: |
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,4 @@ app.*.map.json
/android/app/profile
/android/app/release

# Until I change the config for dev and release
web/flutter_bootstrap.js
.env*
Binary file added assets/fonts/Roboto-Regular.ttf
Binary file not shown.
6 changes: 6 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ dev_dependencies:
flutter:
uses-material-design: true
generate: true
# Flutter engine issue, always download roboto on
# web in the loadAssetFonts function https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/canvaskit/fonts.dart
fonts:
- family: Roboto
fonts:
- asset: assets/fonts/Roboto-Regular.ttf

assets:
# Add assets from the images directory to the application.
Expand Down
2 changes: 1 addition & 1 deletion web/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Redirecciona a index.html -->
<!-- Redirect to index.html, cant figure out how to use dynamic href here, so for is batucadapp-->
<meta http-equiv="refresh" content="0; URL='/batucadapp/'" />
<title>404 - redirect</title>
</head>
Expand Down
5 changes: 1 addition & 4 deletions web/flutter_bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ function leftInset() {
{{flutter_build_config}}
window.addEventListener("load", (_) => {
_flutter.loader.load({
config: {
// Use the local CanvasKit bundle instead of the CDN to reduce test flakiness.
canvasKitBaseUrl: '/batucadapp/canvaskit/',
},

onEntrypointLoaded: (engineInitializer) => {
engineInitializer.initializeEngine().then((appRunner) => {
appRunner.runApp().then((_) => {
Expand Down

0 comments on commit 8a9f4c8

Please sign in to comment.