diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac1cd90..7ddc1ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,10 +9,8 @@ jobs: with: channel: beta cache: true - + # Not needed for tests but pubspec.yaml requires it - name: Make envfile - uses: SpicyPizza/create-envfile@v2.0 - with: - envkey_API_URL: ${{ secrets.API_URL }} + run: echo "API_URL=${{ secrets.API_URL }}" > .env - run: flutter test \ No newline at end of file diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index 7caea45..24d4927 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -3,8 +3,6 @@ name: Github-Pages on: push: branches: [ "main" ] - pull_request: - branches: [ "main" ] workflow_dispatch: jobs: @@ -21,18 +19,18 @@ jobs: cache: true - name: Make envfile - uses: SpicyPizza/create-envfile@v2.0 - with: - envkey_API_URL: ${{ secrets.API_URL }} - - - name: Run Tests - run: flutter test + run: echo "API_URL=${{ secrets.API_URL }}" > .env - name: Install dependencies run: flutter pub get + + - name: Run Tests + run: flutter test + # 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: | diff --git a/.gitignore b/.gitignore index 01bf524..8b8fca1 100644 --- a/.gitignore +++ b/.gitignore @@ -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* diff --git a/assets/fonts/Roboto-Regular.ttf b/assets/fonts/Roboto-Regular.ttf new file mode 100644 index 0000000..ddf4bfa Binary files /dev/null and b/assets/fonts/Roboto-Regular.ttf differ diff --git a/pubspec.yaml b/pubspec.yaml index 7f52f15..6e3a839 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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. diff --git a/web/404.html b/web/404.html index 10aaa86..2196ad1 100644 --- a/web/404.html +++ b/web/404.html @@ -5,7 +5,7 @@ - + 404 - redirect diff --git a/web/flutter_bootstrap.js b/web/flutter_bootstrap.js index 37700a0..1391fa8 100644 --- a/web/flutter_bootstrap.js +++ b/web/flutter_bootstrap.js @@ -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((_) => {