From a7a8285a55795b3632429e510524d986026fac0a Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sat, 20 Jan 2024 11:23:48 +0100 Subject: [PATCH] build: Do not load emojis at initial start on web --- .github/workflows/main_deploy.yaml | 4 ++++ .github/workflows/release.yaml | 4 ++++ lib/config/themes.dart | 2 +- web/index.html | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main_deploy.yaml b/.github/workflows/main_deploy.yaml index cd737283..93a0b514 100644 --- a/.github/workflows/main_deploy.yaml +++ b/.github/workflows/main_deploy.yaml @@ -19,6 +19,10 @@ jobs: - uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} + - name: Remove Emoji Font + run: | + rm -rf fonts/NotoEmoji + yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml - run: flutter pub get - name: Prepare web run: ./scripts/prepare-web.sh diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2dd490c6..8cecfcb2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,6 +21,10 @@ jobs: cache: true - name: Install dependencies run: sudo apt-get update && sudo apt-get install nodejs -y + - name: Remove Emoji Font + run: | + rm -rf fonts/NotoEmoji + yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml - run: flutter pub get - name: Prepare web run: ./scripts/prepare-web.sh diff --git a/lib/config/themes.dart b/lib/config/themes.dart index f03c74d4..e8e7312b 100644 --- a/lib/config/themes.dart +++ b/lib/config/themes.dart @@ -72,7 +72,7 @@ abstract class FluffyThemes { useMaterial3: true, brightness: brightness, colorScheme: colorScheme, - textTheme: PlatformInfos.isDesktop || PlatformInfos.isWeb + textTheme: PlatformInfos.isDesktop ? brightness == Brightness.light ? Typography.material2018().black.merge(fallbackTextTheme) : Typography.material2018().white.merge(fallbackTextTheme) diff --git a/web/index.html b/web/index.html index 7ebfd612..3a3fdc77 100644 --- a/web/index.html +++ b/web/index.html @@ -52,7 +52,7 @@ serviceWorkerVersion: serviceWorkerVersion, }, onEntrypointLoaded: function (engineInitializer) { - engineInitializer.initializeEngine().then(function (appRunner) { + engineInitializer.initializeEngine({ useColorEmoji: true }).then(function (appRunner) { appRunner.runApp(); }); }