Skip to content

Commit

Permalink
Enable wasm build in our example app
Browse files Browse the repository at this point in the history
  • Loading branch information
imaNNeo committed Dec 19, 2024
1 parent c50e87d commit 301c090
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ jobs:
- uses: actions/checkout@v4
- name: Install Flutter
uses: subosito/flutter-action@v2

- name: Set fl_chart Version
run: |
VERSION=$(grep "version:" pubspec.yaml | awk '{ print $2 }')
echo "USING_FL_CHART_VERSION=$VERSION" >> $GITHUB_ENV
- uses: bluefireteam/flutter-gh-pages@v8
with:
workingDir: example
customArgs: --dart-define="USING_FL_CHART_VERSION=${{ env.USING_FL_CHART_VERSION }}"
- run: flutter config --enable-web
working-directory: example
- run: flutter build web --release --wasm --base-href=/ --dart-define="USING_FL_CHART_VERSION=${{ env.USING_FL_CHART_VERSION }}"
working-directory: example
- run: git config user.name github-actions
working-directory: example
- run: git config user.email github-actions@github.com
working-directory: example
- run: git --work-tree build/web add --all
working-directory: example
- run: git commit -m "Automatic deployment by github-actions"
working-directory: example
- run: git push origin HEAD:gh-pages --force
working-directory: example
11 changes: 2 additions & 9 deletions example/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<meta name="description" content="FL Chart App is an application to demonstrate samples of the fl_chart (A Flutter package to draw charts).">

<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="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="FL Chart App">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
Expand All @@ -31,15 +31,8 @@

<title>FL Chart App</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>

<script src="flutter_bootstrap.js" async></script>
<style>
.loading {
display: flex;
Expand Down

0 comments on commit 301c090

Please sign in to comment.