├── .github └── workflows │ ├── depoly_gh_pages.yml │ └── publish_pub.dev.yml ├── .gitignore ├── 20221124-183101.png ├── 20230111-172132.png ├── CHANGELOG.md ├── LICENSE ├── README.md ├── README.zh.md ├── analysis_options.yaml ├── bin └── flutter_web_optimizer.dart ├── example ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── assets │ ├── google_fonts │ │ ├── Inter-Black.ttf │ │ ├── Inter-Bold.ttf │ │ ├── Inter-ExtraBold.ttf │ │ ├── Inter-ExtraLight.ttf │ │ ├── Inter-Light.ttf │ │ ├── Inter-Medium.ttf │ │ ├── Inter-Regular.ttf │ │ ├── Inter-SemiBold.ttf │ │ └── Inter-Thin.ttf │ ├── images │ │ └── lufei.jpeg │ └── svg │ │ ├── dart.svg │ │ └── flutter_logo.svg ├── flutter_web_cos_upload_plugin.yaml ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── example.md │ ├── main.dart │ ├── main_page.dart │ ├── sub_page.dart │ └── widget │ │ ├── asset_image_widget.dart │ │ └── image_widget.dart ├── pubspec.lock ├── pubspec.yaml ├── scripts │ └── cos_upload_plugin.dart ├── test │ └── widget_test.dart └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png │ ├── index.html │ └── manifest.json ├── flutter_js ├── .gitignore ├── package.json ├── rollup.config.js └── src │ ├── browser_environment.js │ ├── canvaskit_loader.js │ ├── entrypoint_loader.js │ ├── flutter.js │ ├── instantiate_wasm.js │ ├── loader.js │ ├── service_worker_loader.js │ ├── skwasm_loader.js │ ├── trusted_types.js │ ├── types.d.ts │ └── utils.js ├── lib ├── executable.dart ├── flutter_web_optimizer.dart └── src │ ├── common │ ├── logger.dart │ └── model.dart │ ├── optimize │ ├── flutter.js.dart │ ├── flutter_service_worker.js.dart │ ├── flutter_web_optimizer.js.dart │ └── optimize_command.dart │ └── plugin │ ├── plugin_command.dart │ └── template_plugin.dart ├── pubspec.lock ├── pubspec.yaml ├── scripts └── publish.sh └── test └── flutter_web_optimizer_test.dart /.github/workflows/depoly_gh_pages.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Flutter Web Site to Pages 2 | 3 | on: 4 | # Runs on pushes targeting the default branch 5 | push: 6 | branches: 7 | - main 8 | pull_request: 9 | 10 | # Allows you to run this workflow manually from the Actions tab 11 | workflow_dispatch: 12 | 13 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 14 | permissions: 15 | contents: read 16 | pages: write 17 | id-token: write 18 | 19 | # Allow one concurrent deployment 20 | concurrency: 21 | group: "pages" 22 | cancel-in-progress: true 23 | 24 | jobs: 25 | build: 26 | name: Build Job 27 | runs-on: ubuntu-latest 28 | steps: 29 | - name: Checkout Code 30 | uses: actions/checkout@v3 31 | 32 | # - name: Setup Flutter 33 | # run: | 34 | # git clone https://github.com/flutter/flutter.git --depth 1 -b beta _flutter 35 | # echo "${GITHUB_WORKSPACE}/_flutter/bin" >> ${GITHUB_PATH} 36 | 37 | - name: Setup Flutter 38 | run: | 39 | git clone https://github.com/flutter/flutter.git --depth 1 -b stable ~/flutter 40 | echo "~/flutter/bin" >> ${GITHUB_PATH} 41 | 42 | - name: Cache dependencies 43 | uses: actions/cache@v3 44 | with: 45 | path: ~/.pub-cache 46 | key: ${{ runner.os }}-flutter-cache 47 | restore-keys: | 48 | ${{ runner.os }}-flutter-cache 49 | 50 | - name: Install Flutter Dependencies 51 | run: | 52 | cd example 53 | flutter config --enable-web 54 | flutter pub get 55 | 56 | - name: Build Flutter Web 57 | run: | 58 | cd example 59 | flutter build web --wasm --release --source-maps --base-href /flutter_web_optimizer/ 60 | flutter pub run flutter_web_optimizer optimize --asset-base https://tryimpossible.github.io/flutter-diy/flutter-web-optimizer-example-artifact/ --hash-filter-regexp google_fonts 61 | 62 | # - name: Replace Href Attribute 63 | # run: | 64 | # cd example/build/web 65 | # sed -i '//c ' index.html 66 | 67 | - name: Setup Pages 68 | uses: actions/configure-pages@v2 69 | 70 | - name: Upload artifact 71 | uses: actions/upload-pages-artifact@v1 72 | with: 73 | # Upload entire repository 74 | path: './example/build/web' 75 | 76 | - name: Deploy Flutter-Diy Repository 77 | uses: peaceiris/actions-gh-pages@v3 78 | if: ${{ github.ref == 'refs/heads/main' }} 79 | with: 80 | # github_token: ${{ secrets.GITHUB_TOKEN }} 81 | deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} 82 | publish_dir: ./example/build/web 83 | # publish_branch: flutter-web-optimizer-example-artifact # default: gh-pages 84 | publish_branch: gh-pages 85 | external_repository: TryImpossible/flutter-diy 86 | destination_dir: flutter-web-optimizer-example-artifact 87 | exclude_assets: '.github,index.html' 88 | 89 | deploy: 90 | name: Deployment job 91 | environment: 92 | name: github-pages 93 | url: ${{ steps.deployment.outputs.page_url }} 94 | runs-on: ubuntu-latest 95 | needs: build 96 | steps: 97 | - name: Deploy to GitHub Pages 98 | id: deployment 99 | uses: actions/deploy-pages@v1 -------------------------------------------------------------------------------- /.github/workflows/publish_pub.dev.yml: -------------------------------------------------------------------------------- 1 | name: Publish to Pub.dev 2 | 3 | on: 4 | # Runs on pushes targeting the default branch 5 | push: 6 | branches: 7 | - main 8 | pull_request: 9 | 10 | # Allows you to run this workflow manually from the Actions tab 11 | workflow_dispatch: 12 | 13 | jobs: 14 | publish_flutter_web_optimizer: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: 'checkout code' 18 | uses: actions/checkout@main # required! 19 | 20 | - name: '>> publish flutter_web_optimizer package to pub.dev <<' 21 | uses: k-paxian/dart-package-publisher@master 22 | with: 23 | accessToken: ${{ secrets.PUB_ACCESS_TOKEN }} 24 | refreshToken: ${{ secrets.PUB_REFRESH_TOKEN }} 25 | skipTests: true 26 | format: true 27 | 28 | # publish_flutter_web_cos_upload_plugin: 29 | # runs-on: ubuntu-latest 30 | # steps: 31 | # - name: 'checkout code' 32 | # uses: actions/checkout@main # required! 33 | # 34 | # - name: '>> publish flutter_web_cos_upload_plugin package to pub.dev <<' 35 | # uses: k-paxian/dart-package-publisher@master 36 | # with: 37 | # accessToken: ${{ secrets.PUB_ACCESS_TOKEN }} 38 | # refreshToken: ${{ secrets.PUB_REFRESH_TOKEN }} 39 | # skipTests: true 40 | # format: true 41 | # relativePath: packages/flutter_web_cos_upload_plugin -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Files and directories created by pub. 19 | .dart_tool/ 20 | .packages 21 | 22 | # Conventional directory for build output. 23 | build/ 24 | 25 | private/ -------------------------------------------------------------------------------- /20221124-183101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/20221124-183101.png -------------------------------------------------------------------------------- /20230111-172132.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/20230111-172132.png -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.5.1 2 | 3 | - update `README.md` 4 | 5 | ## 1.5.0 6 | 7 | - the plugin is compatible with Flutter version 3.24 and above 8 | - example project upgrade to flutter version 3.27.1 9 | - fix bug,[issue](https://github.com/TryImpossible/flutter_web_optimizer/issues/34) 10 | 11 | ## 1.4.2 12 | 13 | - example project upgrade to flutter version 3.22.1 14 | 15 | ## 1.4.1 16 | 17 | - fix bug 18 | 19 | ## 1.4.0 20 | 21 | - the plugin is compatible with Flutter 3.16 22 | - support canvaskit renderer 23 | - add `--enable-vconsole` args,support enable tencent vconsole tools 24 | 25 | ## 1.3.0 26 | 27 | - the plugin is compatible with Flutter 3.10.5 28 | 29 | ## 1.2.0 30 | 31 | - `flutter.js`compatible with flutter version 3.7 32 | - `index.html`compatible with flutter version 3.7 33 | 34 | ## 1.1.12 35 | 36 | - fix bug,[issue](https://github.com/TryImpossible/flutter_web_optimizer/issues/15) 37 | 38 | ## 1.1.11 39 | 40 | - fix bug,[issue](https://github.com/TryImpossible/flutter_web_optimizer/issues/11) 41 | 42 | ## 1.1.10 43 | 44 | - add `--hash-filter-regexp` args,support filtering file when hash file 45 | 46 | ## 1.1.9 47 | 48 | - add `--enable-pwa` args enable experimental feature:PWA service worker,default to true 49 | 50 | ## 1.1.8 51 | 52 | - insert `//@ sourceURL=main.dart.js` mark for debugging 53 | 54 | ## 1.1.7 55 | 56 | - fix bug 57 | 58 | ## 1.1.6 59 | 60 | - link external js and css files when using video_player、fluttertoast and other plugin,also support 61 | use hashed files 62 | - support flutter_svg plugin use hashed svg resources 63 | - `example` project introduce the supported features 64 | 65 | ## 1.1.5 66 | 67 | - command support windows platform 68 | 69 | ## 1.1.4 70 | 71 | - export window.hashFileManifest global variable 72 | - use hashed resources when creating html element dynamically 73 | 74 | ## 1.1.3 75 | 76 | - fix bug 77 | 78 | ## 1.1.2 79 | 80 | - fix bug 81 | - add english REMADME 82 | 83 | ## 1.1.1 84 | 85 | - fix bug 86 | 87 | ## 1.1.0 88 | 89 | - update `plugin` command,allow any plugin name 90 | - update `optimize` command 91 | - modify web optimize steps 92 | - `--plugin` args support file mode and plugin mode 93 | - update `example` project,test the usage of plugin mode 94 | 95 | ## 1.0.1 96 | 97 | - update README 98 | - add `example.md` 99 | 100 | ## 1.0.0 101 | 102 | - add `plugin` command,auto generate plugin template file 103 | - add `optimize` command,solve web page loading slow and browser cache problem 104 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2022, xiebin 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [中文文档](README.zh.md) 2 | 3 | ## Intro 4 | 5 | A optimization tools for flutter web,solved web page loading slow and browser cache problem. 6 | 7 | ## Importantance 8 | 9 | how to configure `index.html`, please refer to the following 10 | 11 | - [Flutter web app initialization](https://docs.flutter.dev/platform-integration/web/initialization) 12 | - [example/index.html](https://github.com/TryImpossible/flutter_web_optimizer/blob/main/example/web/index.html) 13 | 14 | ## Features 15 | 16 | [demo](https://tryimpossible.github.io/flutter_web_optimizer/) 17 | 18 | ![app_web_optimizer](https://github.com/TryImpossible/flutter_web_optimizer/raw/main/20230111-172132.png) 19 | 20 | - split large file and cdn resource file,optimize web page loading slow. 21 | - hashed resource file,solve browser cache problem. 22 | 23 | ## Getting started 24 | 25 | ```yaml 26 | dev_dependencies: 27 | flutter_web_optimizer: ^1.5.1 28 | ``` 29 | 30 | ## Usage 31 | 32 | ![app_web_optimizer](https://github.com/TryImpossible/flutter_web_optimizer/raw/main/20221124-183101.png) 33 | 34 | navigate to the root directory of the project,execute `plugin` and `optimize` command 35 | 36 | ### plugin command 37 | 38 | the `plugin` command support auto generate plugin template files,then upload resources files to file 39 | servers,such as such as Tencent COS and Alibaba OSS 40 | 41 | ```shell 42 | flutter pub run flutter_web_optimizer plugin --path scripts/test_plugin.dart 43 | ``` 44 | 45 | - `path` parameter required,refers to `plugin` file path. 46 | 47 | ### optimize command 48 | 49 | `optimize` command support split large file、hashing resource file and cdn resource file. 50 | 51 | ```shell 52 | flutter pub run flutter_web_optimizer optimize --asset-base http://192.168.101.93:9091/app/ --plugin scripts/test_plugin.dart 53 | ``` 54 | 55 | or 56 | 57 | ```shell 58 | flutter pub run flutter_web_optimizer optimize --asset-base http://192.168.101.93:9091/app/ --plugin flutter_web_cos_upload_plugin 59 | ``` 60 | 61 | - `asset-base` parameter required,refers to file server internet address,**it's must end with '/'** 62 | - `web-output` parameter not required,refers to `flutter web build` generated artifact path, default 63 | as `build/web`. 64 | - `plugin` parameter not required,if needs upload resource file to file server,it's must be 65 | required. it support file mode and plugin mode 66 | - file mode: it's refers to plugin file 67 | path. [cos_upload_plugin.dart](example/scripts/cos_upload_plugin.dart) provide a example 68 | upload resource file to tencent cos. 69 | - plugin mode: it's refers to plugin name. 70 | check [flutter_web_cos_upload_plugin](https://pub.flutter-io.cn/packages/flutter_web_cos_upload_plugin) 71 | for how to use it 72 | - `--enable-pwa`parameter not required,refers to PWA service worker,default to true 73 | - `--hash-filter-regexp`parameter not required,support filtering file when hash file 74 | - `--enable-vconsole` parameter not required,refers to enable tencent vconsole tools, default to false -------------------------------------------------------------------------------- /README.zh.md: -------------------------------------------------------------------------------- 1 | 一个命令行工具,针对`flutter web`加载慢和缓存问题提供了一套解决方案。 2 | 3 | ## 前置 4 | 5 | 关于index.html如何配置,请参考以下 6 | 7 | - [Flutter web app initialization](https://docs.flutter.dev/platform-integration/web/initialization) 8 | - [example/index.html](https://github.com/TryImpossible/flutter_web_optimizer/blob/main/example/web/index.html) 9 | 10 | ## 功能 11 | 12 | [demo](https://tryimpossible.github.io/flutter_web_optimizer/) 13 | 14 | ![app_web_optimizer](https://github.com/TryImpossible/flutter_web_optimizer/raw/main/20230111-172132.png) 15 | 16 | - 通过大文件分片和资源文件cdn化方式,优化`flutter web`页面加载慢问题。 17 | - 通过资源文件hash化,解决浏览器强缓存导致功能无法更新问题。 18 | 19 | ## 开始 20 | 21 | 在工程的`pubspec.yaml`文件中添加`flutter_web_optimizer`插件 22 | 23 | ```yaml 24 | dev_dependencies: 25 | flutter_web_optimizer: ^1.5.1 26 | ``` 27 | 28 | ## 用法 29 | 30 | ![app_web_optimizer](https://github.com/TryImpossible/flutter_web_optimizer/raw/main/20221124-183101.png) 31 | 32 | 在项目的根目录下执行`plugin`命令和`optimize`命令 33 | 34 | ### plugin 命令 35 | 36 | `plugin`命令实现自动生成插件模板文件,可以在插件里面实现将资源文件上传至文件服务器上,例如腾讯的cos、阿里的oss; 37 | 38 | ```shell 39 | flutter pub run flutter_web_optimizer plugin --path scripts/test_plugin.dart 40 | ``` 41 | 42 | - `path`参数必传,指自定义`plugin`文件的位置。 43 | 44 | ### optimize 命令 45 | 46 | `optimize`命令针对`flutter build web`的打包产物作了大文件分片下载、资源文件hash化和资源文件cdn化三个优化。 47 | 48 | ```shell 49 | flutter pub run flutter_web_optimizer optimize --asset-base http://192.168.101.93:9091/app/ --plugin scripts/test_plugin.dart 50 | ``` 51 | 52 | or 53 | 54 | ```shell 55 | flutter pub run flutter_web_optimizer optimize --asset-base http://192.168.101.93:9091/app/ --plugin flutter_web_cos_upload_plugin 56 | ``` 57 | 58 | - `asset-base`参数必传,一般是文件服务器上存储对应资源文件的地址,**地址必须是/结尾** 59 | - `web-output`参数非必传,指`flutter web build`的打包产物的文件夹位置,以当前命令行窗口为根路径,默认是`build/web`。 60 | - `plugin`参数非必传,若需要将资源文件上传至服务器,则必传。该参数支持文件模式和插件模式两种模式, 61 | - 文件模式:指插件的文件位置,以当前命令行窗口为根路径。[cos_upload_plugin.dart](example/scripts/cos_upload_plugin.dart) 62 | 文件已经实现了一套将资源文件上传至腾讯的cos的功能,可以参考。 63 | - 插件模式:指插件的名称,用法参考[flutter_web_cos_upload_plugin](https://pub.flutter-io.cn/packages/flutter_web_cos_upload_plugin) 插件 64 | - `--enable-pwa`参数非必传,指 PWA service worker,默认是`true` 65 | - `--hash-filter-regexp`参数非必传,当进行hash文件操作时提供正则过滤 66 | - `--enable-vconsole`参数非必传,指启用vconsole工具,默认是`false` -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the static analysis results for your project (errors, 2 | # warnings, and lints). 3 | # 4 | # This enables the 'recommended' set of lints from `package:lints`. 5 | # This set helps identify many issues that may lead to problems when running 6 | # or consuming Dart code, and enforces writing Dart using a single, idiomatic 7 | # style and format. 8 | # 9 | # If you want a smaller set of lints you can change this to specify 10 | # 'package:lints/core.yaml'. These are just the most critical lints 11 | # (the recommended set includes the core lints). 12 | # The core lints are also what is used by pub.dev for scoring packages. 13 | 14 | include: package:lints/recommended.yaml 15 | 16 | # Uncomment the following section to specify additional rules. 17 | 18 | # linter: 19 | # rules: 20 | # - camel_case_types 21 | 22 | # analyzer: 23 | # exclude: 24 | # - path/to/excluded/files/** 25 | 26 | # For more information about the core and recommended set of lints, see 27 | # https://dart.dev/go/core-lints 28 | 29 | # For additional information about configuring this file, see 30 | # https://dart.dev/guides/language/analysis-options 31 | -------------------------------------------------------------------------------- /bin/flutter_web_optimizer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_web_optimizer/executable.dart' as executable; 2 | 3 | void main(List arguments) { 4 | executable.main(arguments); 5 | } 6 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Web related 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 17 | base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 18 | - platform: android 19 | create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 20 | base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 21 | - platform: ios 22 | create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 23 | base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 24 | - platform: linux 25 | create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 26 | base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 27 | - platform: macos 28 | create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 29 | base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 30 | - platform: web 31 | create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 32 | base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 33 | - platform: windows 34 | create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 35 | base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | ### plugin 2 | ```shell 3 | flutter pub run flutter_web_optimizer plugin --path scripts/test_plugin.dart 4 | ``` 5 | 6 | ### optimize 7 | ```shell 8 | flutter pub run flutter_web_optimizer optimize --asset-base http://192.168.101.93:9091/app/ --plugin scripts/test_plugin.dart 9 | ``` -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | id "kotlin-android" 4 | id "dev.flutter.flutter-gradle-plugin" 5 | } 6 | 7 | android { 8 | namespace = "com.example.example" 9 | compileSdkVersion flutter.compileSdkVersion 10 | ndkVersion flutter.ndkVersion 11 | 12 | compileOptions { 13 | sourceCompatibility JavaVersion.VERSION_1_8 14 | targetCompatibility JavaVersion.VERSION_1_8 15 | } 16 | 17 | kotlinOptions { 18 | jvmTarget = JavaVersion.VERSION_1_8 19 | } 20 | 21 | sourceSets { 22 | main.java.srcDirs += 'src/main/kotlin' 23 | } 24 | 25 | defaultConfig { 26 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 27 | applicationId "com.example.example" 28 | // You can update the following values to match your application needs. 29 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. 30 | minSdkVersion flutter.minSdkVersion 31 | targetSdkVersion flutter.targetSdkVersion 32 | versionCode = flutter.versionCode 33 | versionName = flutter.versionName 34 | } 35 | 36 | buildTypes { 37 | release { 38 | // TODO: Add your own signing config for the release build. 39 | // Signing with the debug keys for now, so `flutter run --release` works. 40 | signingConfig signingConfigs.debug 41 | } 42 | } 43 | } 44 | 45 | flutter { 46 | source '../..' 47 | } 48 | 49 | dependencies { 50 | } 51 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | rootProject.buildDir = '../build' 9 | subprojects { 10 | project.buildDir = "${rootProject.buildDir}/${project.name}" 11 | } 12 | subprojects { 13 | project.evaluationDependsOn(':app') 14 | } 15 | 16 | tasks.register("clean", Delete) { 17 | delete rootProject.buildDir 18 | } 19 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip 6 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | }() 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 21 | id "com.android.application" version "8.2.1" apply false 22 | id "org.jetbrains.kotlin.android" version "1.8.22" apply false 23 | } 24 | 25 | include ":app" -------------------------------------------------------------------------------- /example/assets/google_fonts/Inter-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/assets/google_fonts/Inter-Black.ttf -------------------------------------------------------------------------------- /example/assets/google_fonts/Inter-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/assets/google_fonts/Inter-Bold.ttf -------------------------------------------------------------------------------- /example/assets/google_fonts/Inter-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/assets/google_fonts/Inter-ExtraBold.ttf -------------------------------------------------------------------------------- /example/assets/google_fonts/Inter-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/assets/google_fonts/Inter-ExtraLight.ttf -------------------------------------------------------------------------------- /example/assets/google_fonts/Inter-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/assets/google_fonts/Inter-Light.ttf -------------------------------------------------------------------------------- /example/assets/google_fonts/Inter-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/assets/google_fonts/Inter-Medium.ttf -------------------------------------------------------------------------------- /example/assets/google_fonts/Inter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/assets/google_fonts/Inter-Regular.ttf -------------------------------------------------------------------------------- /example/assets/google_fonts/Inter-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/assets/google_fonts/Inter-SemiBold.ttf -------------------------------------------------------------------------------- /example/assets/google_fonts/Inter-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/assets/google_fonts/Inter-Thin.ttf -------------------------------------------------------------------------------- /example/assets/images/lufei.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/assets/images/lufei.jpeg -------------------------------------------------------------------------------- /example/assets/svg/dart.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/assets/svg/flutter_logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /example/flutter_web_cos_upload_plugin.yaml: -------------------------------------------------------------------------------- 1 | cos: 2 | config: 3 | appId: 'xxx' 4 | secretId: 'xxx' 5 | secretKey: 'xxx' 6 | bucketName: 'xxx' 7 | region: 'xxx' -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '12.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - fluttertoast (0.0.2): 4 | - Flutter 5 | - Toast 6 | - package_info_plus (0.4.5): 7 | - Flutter 8 | - path_provider_foundation (0.0.1): 9 | - Flutter 10 | - FlutterMacOS 11 | - Toast (4.0.0) 12 | - video_player_avfoundation (0.0.1): 13 | - Flutter 14 | - FlutterMacOS 15 | - wakelock_plus (0.0.1): 16 | - Flutter 17 | 18 | DEPENDENCIES: 19 | - Flutter (from `Flutter`) 20 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) 21 | - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) 22 | - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) 23 | - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`) 24 | - wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`) 25 | 26 | SPEC REPOS: 27 | trunk: 28 | - Toast 29 | 30 | EXTERNAL SOURCES: 31 | Flutter: 32 | :path: Flutter 33 | fluttertoast: 34 | :path: ".symlinks/plugins/fluttertoast/ios" 35 | package_info_plus: 36 | :path: ".symlinks/plugins/package_info_plus/ios" 37 | path_provider_foundation: 38 | :path: ".symlinks/plugins/path_provider_foundation/darwin" 39 | video_player_avfoundation: 40 | :path: ".symlinks/plugins/video_player_avfoundation/darwin" 41 | wakelock_plus: 42 | :path: ".symlinks/plugins/wakelock_plus/ios" 43 | 44 | SPEC CHECKSUMS: 45 | Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 46 | fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c 47 | package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4 48 | path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 49 | Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 50 | video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3 51 | wakelock_plus: 373cfe59b235a6dd5837d0fb88791d2f13a90d56 52 | 53 | PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011 54 | 55 | COCOAPODS: 1.15.2 56 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 9625139C86EAF61692E21E73 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CB284792A0672205DA307EA /* Pods_Runner.framework */; }; 14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | ); 27 | name = "Embed Frameworks"; 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 34 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 35 | 2DC60B56D9919AA7E2D570D9 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 36 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 37 | 3CB284792A0672205DA307EA /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 722EFF34F9DDDE960C254ADB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 39 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 40 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 41 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 42 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 43 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 44 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | A75BE94831B6E86AEDE2A88B /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 9625139C86EAF61692E21E73 /* Pods_Runner.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 312255DF0888C57A86D9B300 /* Pods */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 722EFF34F9DDDE960C254ADB /* Pods-Runner.debug.xcconfig */, 68 | 2DC60B56D9919AA7E2D570D9 /* Pods-Runner.release.xcconfig */, 69 | A75BE94831B6E86AEDE2A88B /* Pods-Runner.profile.xcconfig */, 70 | ); 71 | name = Pods; 72 | path = Pods; 73 | sourceTree = ""; 74 | }; 75 | 5C960F600E8E4BCCA9211B16 /* Frameworks */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | 3CB284792A0672205DA307EA /* Pods_Runner.framework */, 79 | ); 80 | name = Frameworks; 81 | sourceTree = ""; 82 | }; 83 | 9740EEB11CF90186004384FC /* Flutter */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 87 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 88 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 89 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 90 | ); 91 | name = Flutter; 92 | sourceTree = ""; 93 | }; 94 | 97C146E51CF9000F007C117D = { 95 | isa = PBXGroup; 96 | children = ( 97 | 9740EEB11CF90186004384FC /* Flutter */, 98 | 97C146F01CF9000F007C117D /* Runner */, 99 | 97C146EF1CF9000F007C117D /* Products */, 100 | 312255DF0888C57A86D9B300 /* Pods */, 101 | 5C960F600E8E4BCCA9211B16 /* Frameworks */, 102 | ); 103 | sourceTree = ""; 104 | }; 105 | 97C146EF1CF9000F007C117D /* Products */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 97C146EE1CF9000F007C117D /* Runner.app */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | 97C146F01CF9000F007C117D /* Runner */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 117 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 118 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 119 | 97C147021CF9000F007C117D /* Info.plist */, 120 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 121 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 122 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 123 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 124 | ); 125 | path = Runner; 126 | sourceTree = ""; 127 | }; 128 | /* End PBXGroup section */ 129 | 130 | /* Begin PBXNativeTarget section */ 131 | 97C146ED1CF9000F007C117D /* Runner */ = { 132 | isa = PBXNativeTarget; 133 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 134 | buildPhases = ( 135 | 199D0DED2BEF74D61B1E5B60 /* [CP] Check Pods Manifest.lock */, 136 | 9740EEB61CF901F6004384FC /* Run Script */, 137 | 97C146EA1CF9000F007C117D /* Sources */, 138 | 97C146EB1CF9000F007C117D /* Frameworks */, 139 | 97C146EC1CF9000F007C117D /* Resources */, 140 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 141 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 142 | F8F63E0C1831C48E80106D53 /* [CP] Embed Pods Frameworks */, 143 | ); 144 | buildRules = ( 145 | ); 146 | dependencies = ( 147 | ); 148 | name = Runner; 149 | productName = Runner; 150 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 151 | productType = "com.apple.product-type.application"; 152 | }; 153 | /* End PBXNativeTarget section */ 154 | 155 | /* Begin PBXProject section */ 156 | 97C146E61CF9000F007C117D /* Project object */ = { 157 | isa = PBXProject; 158 | attributes = { 159 | LastUpgradeCheck = 1510; 160 | ORGANIZATIONNAME = ""; 161 | TargetAttributes = { 162 | 97C146ED1CF9000F007C117D = { 163 | CreatedOnToolsVersion = 7.3.1; 164 | LastSwiftMigration = 1100; 165 | }; 166 | }; 167 | }; 168 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 169 | compatibilityVersion = "Xcode 9.3"; 170 | developmentRegion = en; 171 | hasScannedForEncodings = 0; 172 | knownRegions = ( 173 | en, 174 | Base, 175 | ); 176 | mainGroup = 97C146E51CF9000F007C117D; 177 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 178 | projectDirPath = ""; 179 | projectRoot = ""; 180 | targets = ( 181 | 97C146ED1CF9000F007C117D /* Runner */, 182 | ); 183 | }; 184 | /* End PBXProject section */ 185 | 186 | /* Begin PBXResourcesBuildPhase section */ 187 | 97C146EC1CF9000F007C117D /* Resources */ = { 188 | isa = PBXResourcesBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 192 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 193 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 194 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | /* End PBXResourcesBuildPhase section */ 199 | 200 | /* Begin PBXShellScriptBuildPhase section */ 201 | 199D0DED2BEF74D61B1E5B60 /* [CP] Check Pods Manifest.lock */ = { 202 | isa = PBXShellScriptBuildPhase; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | ); 206 | inputFileListPaths = ( 207 | ); 208 | inputPaths = ( 209 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 210 | "${PODS_ROOT}/Manifest.lock", 211 | ); 212 | name = "[CP] Check Pods Manifest.lock"; 213 | outputFileListPaths = ( 214 | ); 215 | outputPaths = ( 216 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | shellPath = /bin/sh; 220 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 221 | showEnvVarsInLog = 0; 222 | }; 223 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 224 | isa = PBXShellScriptBuildPhase; 225 | alwaysOutOfDate = 1; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | ); 229 | inputPaths = ( 230 | "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", 231 | ); 232 | name = "Thin Binary"; 233 | outputPaths = ( 234 | ); 235 | runOnlyForDeploymentPostprocessing = 0; 236 | shellPath = /bin/sh; 237 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 238 | }; 239 | 9740EEB61CF901F6004384FC /* Run Script */ = { 240 | isa = PBXShellScriptBuildPhase; 241 | alwaysOutOfDate = 1; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | ); 245 | inputPaths = ( 246 | ); 247 | name = "Run Script"; 248 | outputPaths = ( 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | shellPath = /bin/sh; 252 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 253 | }; 254 | F8F63E0C1831C48E80106D53 /* [CP] Embed Pods Frameworks */ = { 255 | isa = PBXShellScriptBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ); 259 | inputFileListPaths = ( 260 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", 261 | ); 262 | name = "[CP] Embed Pods Frameworks"; 263 | outputFileListPaths = ( 264 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | shellPath = /bin/sh; 268 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 269 | showEnvVarsInLog = 0; 270 | }; 271 | /* End PBXShellScriptBuildPhase section */ 272 | 273 | /* Begin PBXSourcesBuildPhase section */ 274 | 97C146EA1CF9000F007C117D /* Sources */ = { 275 | isa = PBXSourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 279 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | /* End PBXSourcesBuildPhase section */ 284 | 285 | /* Begin PBXVariantGroup section */ 286 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 287 | isa = PBXVariantGroup; 288 | children = ( 289 | 97C146FB1CF9000F007C117D /* Base */, 290 | ); 291 | name = Main.storyboard; 292 | sourceTree = ""; 293 | }; 294 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 295 | isa = PBXVariantGroup; 296 | children = ( 297 | 97C147001CF9000F007C117D /* Base */, 298 | ); 299 | name = LaunchScreen.storyboard; 300 | sourceTree = ""; 301 | }; 302 | /* End PBXVariantGroup section */ 303 | 304 | /* Begin XCBuildConfiguration section */ 305 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | ALWAYS_SEARCH_USER_PATHS = NO; 309 | CLANG_ANALYZER_NONNULL = YES; 310 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 311 | CLANG_CXX_LIBRARY = "libc++"; 312 | CLANG_ENABLE_MODULES = YES; 313 | CLANG_ENABLE_OBJC_ARC = YES; 314 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 315 | CLANG_WARN_BOOL_CONVERSION = YES; 316 | CLANG_WARN_COMMA = YES; 317 | CLANG_WARN_CONSTANT_CONVERSION = YES; 318 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 319 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 320 | CLANG_WARN_EMPTY_BODY = YES; 321 | CLANG_WARN_ENUM_CONVERSION = YES; 322 | CLANG_WARN_INFINITE_RECURSION = YES; 323 | CLANG_WARN_INT_CONVERSION = YES; 324 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 325 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 326 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 327 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 328 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 329 | CLANG_WARN_STRICT_PROTOTYPES = YES; 330 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 331 | CLANG_WARN_UNREACHABLE_CODE = YES; 332 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 333 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 334 | COPY_PHASE_STRIP = NO; 335 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 336 | ENABLE_NS_ASSERTIONS = NO; 337 | ENABLE_STRICT_OBJC_MSGSEND = YES; 338 | GCC_C_LANGUAGE_STANDARD = gnu99; 339 | GCC_NO_COMMON_BLOCKS = YES; 340 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 341 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 342 | GCC_WARN_UNDECLARED_SELECTOR = YES; 343 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 344 | GCC_WARN_UNUSED_FUNCTION = YES; 345 | GCC_WARN_UNUSED_VARIABLE = YES; 346 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 347 | MTL_ENABLE_DEBUG_INFO = NO; 348 | SDKROOT = iphoneos; 349 | SUPPORTED_PLATFORMS = iphoneos; 350 | TARGETED_DEVICE_FAMILY = "1,2"; 351 | VALIDATE_PRODUCT = YES; 352 | }; 353 | name = Profile; 354 | }; 355 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 356 | isa = XCBuildConfiguration; 357 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 358 | buildSettings = { 359 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 360 | CLANG_ENABLE_MODULES = YES; 361 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 362 | DEVELOPMENT_TEAM = TK46468NT8; 363 | ENABLE_BITCODE = NO; 364 | INFOPLIST_FILE = Runner/Info.plist; 365 | LD_RUNPATH_SEARCH_PATHS = ( 366 | "$(inherited)", 367 | "@executable_path/Frameworks", 368 | ); 369 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 370 | PRODUCT_NAME = "$(TARGET_NAME)"; 371 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 372 | SWIFT_VERSION = 5.0; 373 | VERSIONING_SYSTEM = "apple-generic"; 374 | }; 375 | name = Profile; 376 | }; 377 | 97C147031CF9000F007C117D /* Debug */ = { 378 | isa = XCBuildConfiguration; 379 | buildSettings = { 380 | ALWAYS_SEARCH_USER_PATHS = NO; 381 | CLANG_ANALYZER_NONNULL = YES; 382 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 383 | CLANG_CXX_LIBRARY = "libc++"; 384 | CLANG_ENABLE_MODULES = YES; 385 | CLANG_ENABLE_OBJC_ARC = YES; 386 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 387 | CLANG_WARN_BOOL_CONVERSION = YES; 388 | CLANG_WARN_COMMA = YES; 389 | CLANG_WARN_CONSTANT_CONVERSION = YES; 390 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 391 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 392 | CLANG_WARN_EMPTY_BODY = YES; 393 | CLANG_WARN_ENUM_CONVERSION = YES; 394 | CLANG_WARN_INFINITE_RECURSION = YES; 395 | CLANG_WARN_INT_CONVERSION = YES; 396 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 397 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 398 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 399 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 400 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 401 | CLANG_WARN_STRICT_PROTOTYPES = YES; 402 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 403 | CLANG_WARN_UNREACHABLE_CODE = YES; 404 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 405 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 406 | COPY_PHASE_STRIP = NO; 407 | DEBUG_INFORMATION_FORMAT = dwarf; 408 | ENABLE_STRICT_OBJC_MSGSEND = YES; 409 | ENABLE_TESTABILITY = YES; 410 | GCC_C_LANGUAGE_STANDARD = gnu99; 411 | GCC_DYNAMIC_NO_PIC = NO; 412 | GCC_NO_COMMON_BLOCKS = YES; 413 | GCC_OPTIMIZATION_LEVEL = 0; 414 | GCC_PREPROCESSOR_DEFINITIONS = ( 415 | "DEBUG=1", 416 | "$(inherited)", 417 | ); 418 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 419 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 420 | GCC_WARN_UNDECLARED_SELECTOR = YES; 421 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 422 | GCC_WARN_UNUSED_FUNCTION = YES; 423 | GCC_WARN_UNUSED_VARIABLE = YES; 424 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 425 | MTL_ENABLE_DEBUG_INFO = YES; 426 | ONLY_ACTIVE_ARCH = YES; 427 | SDKROOT = iphoneos; 428 | TARGETED_DEVICE_FAMILY = "1,2"; 429 | }; 430 | name = Debug; 431 | }; 432 | 97C147041CF9000F007C117D /* Release */ = { 433 | isa = XCBuildConfiguration; 434 | buildSettings = { 435 | ALWAYS_SEARCH_USER_PATHS = NO; 436 | CLANG_ANALYZER_NONNULL = YES; 437 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 438 | CLANG_CXX_LIBRARY = "libc++"; 439 | CLANG_ENABLE_MODULES = YES; 440 | CLANG_ENABLE_OBJC_ARC = YES; 441 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 442 | CLANG_WARN_BOOL_CONVERSION = YES; 443 | CLANG_WARN_COMMA = YES; 444 | CLANG_WARN_CONSTANT_CONVERSION = YES; 445 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 446 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 447 | CLANG_WARN_EMPTY_BODY = YES; 448 | CLANG_WARN_ENUM_CONVERSION = YES; 449 | CLANG_WARN_INFINITE_RECURSION = YES; 450 | CLANG_WARN_INT_CONVERSION = YES; 451 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 452 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 453 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 454 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 455 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 456 | CLANG_WARN_STRICT_PROTOTYPES = YES; 457 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 458 | CLANG_WARN_UNREACHABLE_CODE = YES; 459 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 460 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 461 | COPY_PHASE_STRIP = NO; 462 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 463 | ENABLE_NS_ASSERTIONS = NO; 464 | ENABLE_STRICT_OBJC_MSGSEND = YES; 465 | GCC_C_LANGUAGE_STANDARD = gnu99; 466 | GCC_NO_COMMON_BLOCKS = YES; 467 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 468 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 469 | GCC_WARN_UNDECLARED_SELECTOR = YES; 470 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 471 | GCC_WARN_UNUSED_FUNCTION = YES; 472 | GCC_WARN_UNUSED_VARIABLE = YES; 473 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 474 | MTL_ENABLE_DEBUG_INFO = NO; 475 | SDKROOT = iphoneos; 476 | SUPPORTED_PLATFORMS = iphoneos; 477 | SWIFT_COMPILATION_MODE = wholemodule; 478 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 479 | TARGETED_DEVICE_FAMILY = "1,2"; 480 | VALIDATE_PRODUCT = YES; 481 | }; 482 | name = Release; 483 | }; 484 | 97C147061CF9000F007C117D /* Debug */ = { 485 | isa = XCBuildConfiguration; 486 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 487 | buildSettings = { 488 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 489 | CLANG_ENABLE_MODULES = YES; 490 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 491 | DEVELOPMENT_TEAM = TK46468NT8; 492 | ENABLE_BITCODE = NO; 493 | INFOPLIST_FILE = Runner/Info.plist; 494 | LD_RUNPATH_SEARCH_PATHS = ( 495 | "$(inherited)", 496 | "@executable_path/Frameworks", 497 | ); 498 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 499 | PRODUCT_NAME = "$(TARGET_NAME)"; 500 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 501 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 502 | SWIFT_VERSION = 5.0; 503 | VERSIONING_SYSTEM = "apple-generic"; 504 | }; 505 | name = Debug; 506 | }; 507 | 97C147071CF9000F007C117D /* Release */ = { 508 | isa = XCBuildConfiguration; 509 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 510 | buildSettings = { 511 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 512 | CLANG_ENABLE_MODULES = YES; 513 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 514 | DEVELOPMENT_TEAM = TK46468NT8; 515 | ENABLE_BITCODE = NO; 516 | INFOPLIST_FILE = Runner/Info.plist; 517 | LD_RUNPATH_SEARCH_PATHS = ( 518 | "$(inherited)", 519 | "@executable_path/Frameworks", 520 | ); 521 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 522 | PRODUCT_NAME = "$(TARGET_NAME)"; 523 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 524 | SWIFT_VERSION = 5.0; 525 | VERSIONING_SYSTEM = "apple-generic"; 526 | }; 527 | name = Release; 528 | }; 529 | /* End XCBuildConfiguration section */ 530 | 531 | /* Begin XCConfigurationList section */ 532 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 533 | isa = XCConfigurationList; 534 | buildConfigurations = ( 535 | 97C147031CF9000F007C117D /* Debug */, 536 | 97C147041CF9000F007C117D /* Release */, 537 | 249021D3217E4FDB00AE95B9 /* Profile */, 538 | ); 539 | defaultConfigurationIsVisible = 0; 540 | defaultConfigurationName = Release; 541 | }; 542 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 543 | isa = XCConfigurationList; 544 | buildConfigurations = ( 545 | 97C147061CF9000F007C117D /* Debug */, 546 | 97C147071CF9000F007C117D /* Release */, 547 | 249021D4217E4FDB00AE95B9 /* Profile */, 548 | ); 549 | defaultConfigurationIsVisible = 0; 550 | defaultConfigurationName = Release; 551 | }; 552 | /* End XCConfigurationList section */ 553 | }; 554 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 555 | } 556 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @main 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/example.md: -------------------------------------------------------------------------------- 1 | ### plugin 2 | ```shell 3 | flutter pub run flutter_web_optimizer plugin --path scripts/test_plugin.dart 4 | or 5 | flutter_web_optimizer plugin --path scripts/test_plugin.dart 6 | ``` 7 | 8 | ### optimize 9 | ```shell 10 | flutter pub run flutter_web_optimizer optimize --asset-base http://192.168.101.93:9091/app/ --plugin scripts/test_plugin.dart 11 | or 12 | flutter_web_optimizer optimize --asset-base http://192.168.101.93:9091/app/ --plugin scripts/test_plugin.dart 13 | ``` -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart' show CupertinoActivityIndicator; 2 | import 'package:flutter/material.dart'; 3 | 4 | import 'main_page.dart'; 5 | import 'sub_page.dart' deferred as sub_page; 6 | 7 | void main() { 8 | runApp(const App()); 9 | } 10 | 11 | class App extends StatelessWidget { 12 | const App({super.key}); 13 | 14 | // This widget is the root of your application. 15 | @override 16 | Widget build(BuildContext context) { 17 | return MaterialApp( 18 | title: 'Flutter Demo', 19 | theme: ThemeData( 20 | // This is the theme of your application. 21 | // 22 | // Try running your application with "flutter run". You'll see the 23 | // application has a blue toolbar. Then, without quitting the app, try 24 | // changing the primarySwatch below to Colors.green and then invoke 25 | // "hot reload" (press "r" in the console where you ran "flutter run", 26 | // or simply save your changes to "hot reload" in a Flutter IDE). 27 | // Notice that the counter didn't reset back to zero; the application 28 | // is not restarted. 29 | primarySwatch: Colors.blue, 30 | ), 31 | debugShowCheckedModeBanner: false, 32 | initialRoute: '/main', 33 | routes: { 34 | '/main': (_) => const MainPage(), 35 | '/sub': (_) { 36 | return FutureBuilder( 37 | future: sub_page.loadLibrary(), 38 | builder: (_, AsyncSnapshot snapshot) { 39 | if (snapshot.connectionState == ConnectionState.done) { 40 | return sub_page.SubPage(); 41 | } else { 42 | return const CupertinoActivityIndicator(); 43 | } 44 | }, 45 | ); 46 | }, 47 | }, 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /example/lib/main_page.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:chewie/chewie.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_svg/flutter_svg.dart'; 6 | import 'package:fluttertoast/fluttertoast.dart'; 7 | import 'package:google_fonts/google_fonts.dart'; 8 | import 'package:package_info_plus/package_info_plus.dart'; 9 | import 'package:video_player/video_player.dart'; 10 | 11 | class MainPage extends StatelessWidget { 12 | const MainPage({super.key}); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | appBar: AppBar( 18 | title: const Text('主页面'), 19 | actions: [ 20 | TextButton( 21 | onPressed: () => _goSubPage(context), 22 | child: const Text('进入子页面'), 23 | ), 24 | ], 25 | ), 26 | body: const SingleChildScrollView( 27 | child: Column( 28 | mainAxisAlignment: MainAxisAlignment.center, 29 | children: [ 30 | _SVG(), 31 | _Video(), 32 | _Toast(), 33 | _GoogleFonts(), 34 | _PackageInfo(), 35 | ], 36 | ), 37 | ), 38 | ); 39 | } 40 | 41 | void _goSubPage(BuildContext context) { 42 | Navigator.of(context).pushNamed('/sub'); 43 | } 44 | } 45 | 46 | class _Video extends StatefulWidget { 47 | const _Video({super.key}); 48 | 49 | @override 50 | State<_Video> createState() => _VideoState(); 51 | } 52 | 53 | class _VideoState extends State<_Video> { 54 | late VideoPlayerController _videoPlayerController; 55 | late ChewieController _chewieController; 56 | 57 | @override 58 | void initState() { 59 | super.initState(); 60 | _initVideo(); 61 | } 62 | 63 | @override 64 | void dispose() { 65 | _videoPlayerController.dispose(); 66 | _chewieController.dispose(); 67 | super.dispose(); 68 | } 69 | 70 | Future _initVideo() async { 71 | final Uri uri = Uri.parse( 72 | 'https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4'); 73 | _videoPlayerController = VideoPlayerController.networkUrl(uri); 74 | _chewieController = ChewieController( 75 | videoPlayerController: _videoPlayerController, 76 | autoInitialize: true, 77 | aspectRatio: 16 / 9, 78 | autoPlay: true, 79 | looping: true, 80 | ); 81 | } 82 | 83 | @override 84 | Widget build(BuildContext context) { 85 | return Theme( 86 | data: Theme.of(context).copyWith(platform: TargetPlatform.iOS), 87 | child: AspectRatio( 88 | aspectRatio: _chewieController.aspectRatio ?? (16 / 9), 89 | child: Chewie(controller: _chewieController), 90 | ), 91 | ); 92 | } 93 | } 94 | 95 | class _SVG extends StatelessWidget { 96 | const _SVG({super.key}); 97 | 98 | @override 99 | Widget build(BuildContext context) { 100 | return Column( 101 | mainAxisSize: MainAxisSize.min, 102 | children: [ 103 | Row( 104 | children: [ 105 | Expanded( 106 | child: SvgPicture.asset( 107 | 'assets/svg/dart.svg', 108 | placeholderBuilder: (BuildContext context) => Container( 109 | padding: const EdgeInsets.all(30.0), 110 | child: const CircularProgressIndicator(), 111 | ), 112 | ), 113 | ), 114 | Expanded( 115 | child: SvgPicture.asset( 116 | 'assets/svg/flutter_logo.svg', 117 | placeholderBuilder: (BuildContext context) => Container( 118 | padding: const EdgeInsets.all(30.0), 119 | child: const CircularProgressIndicator(), 120 | ), 121 | ), 122 | ), 123 | ], 124 | ), 125 | const Text( 126 | 'this is svg', 127 | style: TextStyle(color: Colors.redAccent), 128 | ), 129 | ], 130 | ); 131 | } 132 | } 133 | 134 | class _Toast extends StatelessWidget { 135 | const _Toast({super.key}); 136 | 137 | @override 138 | Widget build(BuildContext context) { 139 | return Padding( 140 | padding: const EdgeInsets.symmetric(vertical: 16), 141 | child: ElevatedButton( 142 | onPressed: _showToast, 143 | child: const Text('Fluttertoast'), 144 | ), 145 | ); 146 | } 147 | 148 | void _showToast() { 149 | Fluttertoast.showToast( 150 | msg: "This is Center Short Toast", 151 | toastLength: Toast.LENGTH_SHORT, 152 | gravity: ToastGravity.CENTER, 153 | timeInSecForIosWeb: 1, 154 | backgroundColor: Colors.red, 155 | textColor: Colors.white, 156 | fontSize: 16.0, 157 | webPosition: 'center', 158 | ); 159 | } 160 | } 161 | 162 | class _GoogleFonts extends StatelessWidget { 163 | const _GoogleFonts({super.key}); 164 | 165 | @override 166 | Widget build(BuildContext context) { 167 | return Row( 168 | mainAxisAlignment: MainAxisAlignment.center, 169 | children: [ 170 | // const Text('', style: TextStyle(color: Colors.black)), 171 | Text( 172 | 'This is Google Fonts', 173 | style: GoogleFonts.acme( 174 | textStyle: Theme.of(context).textTheme.headlineMedium, 175 | fontSize: 24, 176 | fontWeight: FontWeight.w700, 177 | fontStyle: FontStyle.italic, 178 | ), 179 | ), 180 | ], 181 | ); 182 | } 183 | } 184 | 185 | class _PackageInfo extends StatelessWidget { 186 | const _PackageInfo({super.key}); 187 | 188 | @override 189 | Widget build(BuildContext context) { 190 | return FutureBuilder( 191 | future: PackageInfo.fromPlatform(), 192 | builder: (BuildContext context, AsyncSnapshot snapshot) { 193 | final Map info = 194 | snapshot.data?.data ?? {}; 195 | final String value = JsonEncoder.withIndent(' ').convert(info); 196 | return Padding( 197 | padding: EdgeInsets.all(10), 198 | child: Column( 199 | children: [ 200 | Text('PackageInfo'), 201 | Text(value), 202 | ], 203 | ), 204 | ); 205 | }, 206 | ); 207 | } 208 | } 209 | -------------------------------------------------------------------------------- /example/lib/sub_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'widget/image_widget.dart'; 3 | 4 | class SubPage extends StatelessWidget { 5 | const SubPage({super.key}); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar(title: const Text('子页面')), 11 | body: Center( 12 | child: SizedBox( 13 | width: 200, 14 | height: 200, 15 | child: ImageWidget.lufei(), 16 | ), 17 | ), 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /example/lib/widget/asset_image_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AssetImageWidget extends StatelessWidget { 4 | const AssetImageWidget(this.name, {super.key}); 5 | final String name; 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Image.asset(name); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /example/lib/widget/image_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'asset_image_widget.dart' deferred as image_widget; 3 | 4 | class ImageWidget extends StatelessWidget { 5 | const ImageWidget.lufei({super.key}) : name = 'assets/images/lufei.jpeg'; 6 | final String name; 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return FutureBuilder( 11 | future: image_widget.loadLibrary(), 12 | builder: (_, AsyncSnapshot snapshot) { 13 | if (snapshot.connectionState == ConnectionState.done) { 14 | return image_widget.AssetImageWidget(name); 15 | } else { 16 | return const CircularProgressIndicator(); 17 | } 18 | }, 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | args: 5 | dependency: transitive 6 | description: 7 | name: args 8 | sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 9 | url: "https://pub.flutter-io.cn" 10 | source: hosted 11 | version: "2.6.0" 12 | async: 13 | dependency: transitive 14 | description: 15 | name: async 16 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 17 | url: "https://pub.flutter-io.cn" 18 | source: hosted 19 | version: "2.11.0" 20 | boolean_selector: 21 | dependency: transitive 22 | description: 23 | name: boolean_selector 24 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 25 | url: "https://pub.flutter-io.cn" 26 | source: hosted 27 | version: "2.1.1" 28 | characters: 29 | dependency: transitive 30 | description: 31 | name: characters 32 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" 33 | url: "https://pub.flutter-io.cn" 34 | source: hosted 35 | version: "1.3.0" 36 | chewie: 37 | dependency: "direct main" 38 | description: 39 | name: chewie 40 | sha256: "6386fcc7ad7a8f7b25709ce988cd089cdde894bf335c7a0024a1bfcf8788a452" 41 | url: "https://pub.flutter-io.cn" 42 | source: hosted 43 | version: "1.9.2" 44 | clock: 45 | dependency: transitive 46 | description: 47 | name: clock 48 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 49 | url: "https://pub.flutter-io.cn" 50 | source: hosted 51 | version: "1.1.1" 52 | collection: 53 | dependency: transitive 54 | description: 55 | name: collection 56 | sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "1.19.0" 60 | crypto: 61 | dependency: transitive 62 | description: 63 | name: crypto 64 | sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" 65 | url: "https://pub.flutter-io.cn" 66 | source: hosted 67 | version: "3.0.6" 68 | csslib: 69 | dependency: transitive 70 | description: 71 | name: csslib 72 | sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" 73 | url: "https://pub.flutter-io.cn" 74 | source: hosted 75 | version: "1.0.2" 76 | cupertino_icons: 77 | dependency: "direct main" 78 | description: 79 | name: cupertino_icons 80 | sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 81 | url: "https://pub.flutter-io.cn" 82 | source: hosted 83 | version: "1.0.8" 84 | dbus: 85 | dependency: transitive 86 | description: 87 | name: dbus 88 | sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" 89 | url: "https://pub.flutter-io.cn" 90 | source: hosted 91 | version: "0.7.10" 92 | fake_async: 93 | dependency: transitive 94 | description: 95 | name: fake_async 96 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 97 | url: "https://pub.flutter-io.cn" 98 | source: hosted 99 | version: "1.3.1" 100 | ffi: 101 | dependency: transitive 102 | description: 103 | name: ffi 104 | sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" 105 | url: "https://pub.flutter-io.cn" 106 | source: hosted 107 | version: "2.1.3" 108 | flutter: 109 | dependency: "direct main" 110 | description: flutter 111 | source: sdk 112 | version: "0.0.0" 113 | flutter_lints: 114 | dependency: "direct dev" 115 | description: 116 | name: flutter_lints 117 | sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" 118 | url: "https://pub.flutter-io.cn" 119 | source: hosted 120 | version: "5.0.0" 121 | flutter_svg: 122 | dependency: "direct main" 123 | description: 124 | name: flutter_svg 125 | sha256: c200fd79c918a40c5cd50ea0877fa13f81bdaf6f0a5d3dbcc2a13e3285d6aa1b 126 | url: "https://pub.flutter-io.cn" 127 | source: hosted 128 | version: "2.0.17" 129 | flutter_test: 130 | dependency: "direct dev" 131 | description: flutter 132 | source: sdk 133 | version: "0.0.0" 134 | flutter_web_cos_upload_plugin: 135 | dependency: "direct dev" 136 | description: 137 | name: flutter_web_cos_upload_plugin 138 | sha256: f48bf42c6d328bebd9293e8f2c9bc43966041133423f23d80c0bf44a4915f0d0 139 | url: "https://pub.flutter-io.cn" 140 | source: hosted 141 | version: "1.0.2" 142 | flutter_web_optimizer: 143 | dependency: "direct dev" 144 | description: 145 | name: flutter_web_optimizer 146 | sha256: a83dd4cd52c6effceef769e5694164839f4c2cb4664f12b8bf57371b7d0dab8e 147 | url: "https://pub.flutter-io.cn" 148 | source: hosted 149 | version: "1.4.2" 150 | flutter_web_plugins: 151 | dependency: transitive 152 | description: flutter 153 | source: sdk 154 | version: "0.0.0" 155 | fluttertoast: 156 | dependency: "direct main" 157 | description: 158 | name: fluttertoast 159 | sha256: "24467dc20bbe49fd63e57d8e190798c4d22cbbdac30e54209d153a15273721d1" 160 | url: "https://pub.flutter-io.cn" 161 | source: hosted 162 | version: "8.2.10" 163 | google_fonts: 164 | dependency: "direct main" 165 | description: 166 | name: google_fonts 167 | sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82 168 | url: "https://pub.flutter-io.cn" 169 | source: hosted 170 | version: "6.2.1" 171 | html: 172 | dependency: transitive 173 | description: 174 | name: html 175 | sha256: "1fc58edeaec4307368c60d59b7e15b9d658b57d7f3125098b6294153c75337ec" 176 | url: "https://pub.flutter-io.cn" 177 | source: hosted 178 | version: "0.15.5" 179 | http: 180 | dependency: transitive 181 | description: 182 | name: http 183 | sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 184 | url: "https://pub.flutter-io.cn" 185 | source: hosted 186 | version: "1.2.2" 187 | http_parser: 188 | dependency: transitive 189 | description: 190 | name: http_parser 191 | sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" 192 | url: "https://pub.flutter-io.cn" 193 | source: hosted 194 | version: "4.1.2" 195 | leak_tracker: 196 | dependency: transitive 197 | description: 198 | name: leak_tracker 199 | sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" 200 | url: "https://pub.flutter-io.cn" 201 | source: hosted 202 | version: "10.0.7" 203 | leak_tracker_flutter_testing: 204 | dependency: transitive 205 | description: 206 | name: leak_tracker_flutter_testing 207 | sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" 208 | url: "https://pub.flutter-io.cn" 209 | source: hosted 210 | version: "3.0.8" 211 | leak_tracker_testing: 212 | dependency: transitive 213 | description: 214 | name: leak_tracker_testing 215 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" 216 | url: "https://pub.flutter-io.cn" 217 | source: hosted 218 | version: "3.0.1" 219 | lints: 220 | dependency: transitive 221 | description: 222 | name: lints 223 | sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 224 | url: "https://pub.flutter-io.cn" 225 | source: hosted 226 | version: "5.1.1" 227 | matcher: 228 | dependency: transitive 229 | description: 230 | name: matcher 231 | sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb 232 | url: "https://pub.flutter-io.cn" 233 | source: hosted 234 | version: "0.12.16+1" 235 | material_color_utilities: 236 | dependency: transitive 237 | description: 238 | name: material_color_utilities 239 | sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec 240 | url: "https://pub.flutter-io.cn" 241 | source: hosted 242 | version: "0.11.1" 243 | meta: 244 | dependency: transitive 245 | description: 246 | name: meta 247 | sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 248 | url: "https://pub.flutter-io.cn" 249 | source: hosted 250 | version: "1.15.0" 251 | mime: 252 | dependency: transitive 253 | description: 254 | name: mime 255 | sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a" 256 | url: "https://pub.flutter-io.cn" 257 | source: hosted 258 | version: "1.0.6" 259 | nested: 260 | dependency: transitive 261 | description: 262 | name: nested 263 | sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" 264 | url: "https://pub.flutter-io.cn" 265 | source: hosted 266 | version: "1.0.0" 267 | package_config: 268 | dependency: transitive 269 | description: 270 | name: package_config 271 | sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67" 272 | url: "https://pub.flutter-io.cn" 273 | source: hosted 274 | version: "2.1.1" 275 | package_info_plus: 276 | dependency: "direct main" 277 | description: 278 | name: package_info_plus 279 | sha256: "739e0a5c3c4055152520fa321d0645ee98e932718b4c8efeeb51451968fe0790" 280 | url: "https://pub.flutter-io.cn" 281 | source: hosted 282 | version: "8.1.3" 283 | package_info_plus_platform_interface: 284 | dependency: transitive 285 | description: 286 | name: package_info_plus_platform_interface 287 | sha256: a5ef9986efc7bf772f2696183a3992615baa76c1ffb1189318dd8803778fb05b 288 | url: "https://pub.flutter-io.cn" 289 | source: hosted 290 | version: "3.0.2" 291 | path: 292 | dependency: "direct dev" 293 | description: 294 | name: path 295 | sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" 296 | url: "https://pub.flutter-io.cn" 297 | source: hosted 298 | version: "1.9.1" 299 | path_parsing: 300 | dependency: transitive 301 | description: 302 | name: path_parsing 303 | sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" 304 | url: "https://pub.flutter-io.cn" 305 | source: hosted 306 | version: "1.1.0" 307 | path_provider: 308 | dependency: transitive 309 | description: 310 | name: path_provider 311 | sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" 312 | url: "https://pub.flutter-io.cn" 313 | source: hosted 314 | version: "2.1.5" 315 | path_provider_android: 316 | dependency: transitive 317 | description: 318 | name: path_provider_android 319 | sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2" 320 | url: "https://pub.flutter-io.cn" 321 | source: hosted 322 | version: "2.2.15" 323 | path_provider_foundation: 324 | dependency: transitive 325 | description: 326 | name: path_provider_foundation 327 | sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" 328 | url: "https://pub.flutter-io.cn" 329 | source: hosted 330 | version: "2.4.1" 331 | path_provider_linux: 332 | dependency: transitive 333 | description: 334 | name: path_provider_linux 335 | sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 336 | url: "https://pub.flutter-io.cn" 337 | source: hosted 338 | version: "2.2.1" 339 | path_provider_platform_interface: 340 | dependency: transitive 341 | description: 342 | name: path_provider_platform_interface 343 | sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" 344 | url: "https://pub.flutter-io.cn" 345 | source: hosted 346 | version: "2.1.2" 347 | path_provider_windows: 348 | dependency: transitive 349 | description: 350 | name: path_provider_windows 351 | sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 352 | url: "https://pub.flutter-io.cn" 353 | source: hosted 354 | version: "2.3.0" 355 | petitparser: 356 | dependency: transitive 357 | description: 358 | name: petitparser 359 | sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 360 | url: "https://pub.flutter-io.cn" 361 | source: hosted 362 | version: "6.0.2" 363 | platform: 364 | dependency: transitive 365 | description: 366 | name: platform 367 | sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" 368 | url: "https://pub.flutter-io.cn" 369 | source: hosted 370 | version: "3.1.6" 371 | plugin_platform_interface: 372 | dependency: transitive 373 | description: 374 | name: plugin_platform_interface 375 | sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" 376 | url: "https://pub.flutter-io.cn" 377 | source: hosted 378 | version: "2.1.8" 379 | provider: 380 | dependency: transitive 381 | description: 382 | name: provider 383 | sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c 384 | url: "https://pub.flutter-io.cn" 385 | source: hosted 386 | version: "6.1.2" 387 | sky_engine: 388 | dependency: transitive 389 | description: flutter 390 | source: sdk 391 | version: "0.0.0" 392 | source_span: 393 | dependency: transitive 394 | description: 395 | name: source_span 396 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 397 | url: "https://pub.flutter-io.cn" 398 | source: hosted 399 | version: "1.10.0" 400 | stack_trace: 401 | dependency: transitive 402 | description: 403 | name: stack_trace 404 | sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" 405 | url: "https://pub.flutter-io.cn" 406 | source: hosted 407 | version: "1.12.0" 408 | standard_message_codec: 409 | dependency: transitive 410 | description: 411 | name: standard_message_codec 412 | sha256: fc7dd712d191b7e33196a0ecf354c4573492bb95995e7166cb6f73b047f9cae0 413 | url: "https://pub.flutter-io.cn" 414 | source: hosted 415 | version: "0.0.1+4" 416 | stream_channel: 417 | dependency: transitive 418 | description: 419 | name: stream_channel 420 | sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 421 | url: "https://pub.flutter-io.cn" 422 | source: hosted 423 | version: "2.1.2" 424 | string_scanner: 425 | dependency: transitive 426 | description: 427 | name: string_scanner 428 | sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" 429 | url: "https://pub.flutter-io.cn" 430 | source: hosted 431 | version: "1.3.0" 432 | tencent_cos_plus: 433 | dependency: "direct dev" 434 | description: 435 | name: tencent_cos_plus 436 | sha256: "78dac59a291528427cafa07d94001de695daa43a7497f67a41617da306d3de9d" 437 | url: "https://pub.flutter-io.cn" 438 | source: hosted 439 | version: "1.2.2" 440 | term_glyph: 441 | dependency: transitive 442 | description: 443 | name: term_glyph 444 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 445 | url: "https://pub.flutter-io.cn" 446 | source: hosted 447 | version: "1.2.1" 448 | test_api: 449 | dependency: transitive 450 | description: 451 | name: test_api 452 | sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" 453 | url: "https://pub.flutter-io.cn" 454 | source: hosted 455 | version: "0.7.3" 456 | typed_data: 457 | dependency: transitive 458 | description: 459 | name: typed_data 460 | sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 461 | url: "https://pub.flutter-io.cn" 462 | source: hosted 463 | version: "1.4.0" 464 | vector_graphics: 465 | dependency: transitive 466 | description: 467 | name: vector_graphics 468 | sha256: "27d5fefe86fb9aace4a9f8375b56b3c292b64d8c04510df230f849850d912cb7" 469 | url: "https://pub.flutter-io.cn" 470 | source: hosted 471 | version: "1.1.15" 472 | vector_graphics_codec: 473 | dependency: transitive 474 | description: 475 | name: vector_graphics_codec 476 | sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" 477 | url: "https://pub.flutter-io.cn" 478 | source: hosted 479 | version: "1.1.13" 480 | vector_graphics_compiler: 481 | dependency: transitive 482 | description: 483 | name: vector_graphics_compiler 484 | sha256: "1b4b9e706a10294258727674a340ae0d6e64a7231980f9f9a3d12e4b42407aad" 485 | url: "https://pub.flutter-io.cn" 486 | source: hosted 487 | version: "1.1.16" 488 | vector_math: 489 | dependency: transitive 490 | description: 491 | name: vector_math 492 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 493 | url: "https://pub.flutter-io.cn" 494 | source: hosted 495 | version: "2.1.4" 496 | video_player: 497 | dependency: "direct main" 498 | description: 499 | name: video_player 500 | sha256: "4a8c3492d734f7c39c2588a3206707a05ee80cef52e8c7f3b2078d430c84bc17" 501 | url: "https://pub.flutter-io.cn" 502 | source: hosted 503 | version: "2.9.2" 504 | video_player_android: 505 | dependency: transitive 506 | description: 507 | name: video_player_android 508 | sha256: "7018dbcb395e2bca0b9a898e73989e67c0c4a5db269528e1b036ca38bcca0d0b" 509 | url: "https://pub.flutter-io.cn" 510 | source: hosted 511 | version: "2.7.17" 512 | video_player_avfoundation: 513 | dependency: transitive 514 | description: 515 | name: video_player_avfoundation 516 | sha256: "33224c19775fd244be2d6e3dbd8e1826ab162877bd61123bf71890772119a2b7" 517 | url: "https://pub.flutter-io.cn" 518 | source: hosted 519 | version: "2.6.5" 520 | video_player_platform_interface: 521 | dependency: transitive 522 | description: 523 | name: video_player_platform_interface 524 | sha256: "229d7642ccd9f3dc4aba169609dd6b5f3f443bb4cc15b82f7785fcada5af9bbb" 525 | url: "https://pub.flutter-io.cn" 526 | source: hosted 527 | version: "6.2.3" 528 | video_player_web: 529 | dependency: transitive 530 | description: 531 | name: video_player_web 532 | sha256: "881b375a934d8ebf868c7fb1423b2bfaa393a0a265fa3f733079a86536064a10" 533 | url: "https://pub.flutter-io.cn" 534 | source: hosted 535 | version: "2.3.3" 536 | vm_service: 537 | dependency: transitive 538 | description: 539 | name: vm_service 540 | sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b 541 | url: "https://pub.flutter-io.cn" 542 | source: hosted 543 | version: "14.3.0" 544 | wakelock_plus: 545 | dependency: transitive 546 | description: 547 | name: wakelock_plus 548 | sha256: "36c88af0b930121941345306d259ec4cc4ecca3b151c02e3a9e71aede83c615e" 549 | url: "https://pub.flutter-io.cn" 550 | source: hosted 551 | version: "1.2.10" 552 | wakelock_plus_platform_interface: 553 | dependency: transitive 554 | description: 555 | name: wakelock_plus_platform_interface 556 | sha256: "70e780bc99796e1db82fe764b1e7dcb89a86f1e5b3afb1db354de50f2e41eb7a" 557 | url: "https://pub.flutter-io.cn" 558 | source: hosted 559 | version: "1.2.2" 560 | web: 561 | dependency: transitive 562 | description: 563 | name: web 564 | sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb 565 | url: "https://pub.flutter-io.cn" 566 | source: hosted 567 | version: "1.1.0" 568 | win32: 569 | dependency: transitive 570 | description: 571 | name: win32 572 | sha256: "154360849a56b7b67331c21f09a386562d88903f90a1099c5987afc1912e1f29" 573 | url: "https://pub.flutter-io.cn" 574 | source: hosted 575 | version: "5.10.0" 576 | xdg_directories: 577 | dependency: transitive 578 | description: 579 | name: xdg_directories 580 | sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" 581 | url: "https://pub.flutter-io.cn" 582 | source: hosted 583 | version: "1.1.0" 584 | xml: 585 | dependency: transitive 586 | description: 587 | name: xml 588 | sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 589 | url: "https://pub.flutter-io.cn" 590 | source: hosted 591 | version: "6.5.0" 592 | yaml: 593 | dependency: transitive 594 | description: 595 | name: yaml 596 | sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce 597 | url: "https://pub.flutter-io.cn" 598 | source: hosted 599 | version: "3.1.3" 600 | sdks: 601 | dart: ">=3.6.1 <4.0.0" 602 | flutter: ">=3.27.0" 603 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ^3.6.1 22 | 23 | # Dependencies specify other packages that your package needs in order to work. 24 | # To automatically upgrade your package dependencies to the latest versions 25 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 26 | # dependencies can be manually updated by changing the version numbers below to 27 | # the latest version available on pub.dev. To see which dependencies have newer 28 | # versions available, run `flutter pub outdated`. 29 | dependencies: 30 | flutter: 31 | sdk: flutter 32 | 33 | # The following adds the Cupertino Icons font to your application. 34 | # Use with the CupertinoIcons class for iOS style icons. 35 | cupertino_icons: ^1.0.8 36 | fluttertoast: ^8.2.10 37 | video_player: ^2.9.2 38 | chewie: ^1.9.2 39 | flutter_svg: ^2.0.17 40 | google_fonts: ^6.2.1 41 | package_info_plus: ^8.1.3 42 | 43 | dev_dependencies: 44 | flutter_test: 45 | sdk: flutter 46 | 47 | # The "flutter_lints" package below contains a set of recommended lints to 48 | # encourage good coding practices. The lint set provided by the package is 49 | # activated in the `analysis_options.yaml` file located at the root of your 50 | # package. See that file for information about deactivating specific lint 51 | # rules and activating additional ones. 52 | flutter_lints: ^5.0.0 53 | 54 | # https://pub.dev/packages/path 55 | path: ^1.9.0 56 | # https://pub.dev/packages/tencent_cos_plus 57 | tencent_cos_plus: ^1.2.0 58 | 59 | flutter_web_optimizer: 60 | flutter_web_cos_upload_plugin: 61 | 62 | dependency_overrides: 63 | path: ^1.9.0 64 | 65 | # For information on the generic Dart part of this file, see the 66 | # following page: https://dart.dev/tools/pub/pubspec 67 | 68 | # The following section is specific to Flutter packages. 69 | flutter: 70 | 71 | # The following line ensures that the Material Icons font is 72 | # included with your application, so that you can use the icons in 73 | # the material Icons class. 74 | uses-material-design: true 75 | 76 | # To add assets to your application, add an assets section, like this: 77 | # assets: 78 | # - images/a_dot_burr.jpeg 79 | # - images/a_dot_ham.jpeg 80 | 81 | # An image asset can refer to one or more resolution-specific "variants", see 82 | # https://flutter.dev/assets-and-images/#resolution-aware 83 | 84 | # For details regarding adding assets from package dependencies, see 85 | # https://flutter.dev/assets-and-images/#from-packages 86 | 87 | # To add custom fonts to your application, add a fonts section here, 88 | # in this "flutter" section. Each entry in this list should have a 89 | # "family" key with the font family name, and a "fonts" key with a 90 | # list giving the asset and other descriptors for the font. For 91 | # example: 92 | # fonts: 93 | # - family: Schyler 94 | # fonts: 95 | # - asset: fonts/Schyler-Regular.ttf 96 | # - asset: fonts/Schyler-Italic.ttf 97 | # style: italic 98 | # - family: Trajan Pro 99 | # fonts: 100 | # - asset: fonts/TrajanPro.ttf 101 | # - asset: fonts/TrajanPro_Bold.ttf 102 | # weight: 700 103 | # 104 | # For details regarding fonts from package dependencies, 105 | # see https://flutter.dev/custom-fonts/#from-packages 106 | assets: 107 | - assets/images/ 108 | - assets/svg/ 109 | - assets/google_fonts/ -------------------------------------------------------------------------------- /example/scripts/cos_upload_plugin.dart: -------------------------------------------------------------------------------- 1 | import 'dart:isolate'; 2 | 3 | import 'package:flutter_web_optimizer/flutter_web_optimizer.dart'; 4 | import 'package:path/path.dart' as path; 5 | import 'package:tencent_cos_plus/tencent_cos_plus.dart'; 6 | 7 | /// [arguments] shell args from flutter pub run flutter_web_optimizer optimize 8 | /// eq: flutter pub run flutter_web_optimizer optimize --asset-base http://192.168.101.93:9091/app/ --plugin scripts/cos_upload_plugin.dart 9 | /// 10 | /// The template code is generate by flutter web optimizer 11 | Future main(List arguments, SendPort sendPort) async { 12 | // create a new [ReceivePort] instance 13 | ReceivePort receivePort = ReceivePort(); 14 | // send [receivePort.sendPort] to server for exchnage message 15 | sendPort.send(receivePort.sendPort); 16 | // [receivePort] listen for message 17 | receivePort.listen((dynamic message) { 18 | print('client isolate get message: $message'); 19 | if (message is Map) { 20 | final IsolateMessageProtocol protocol = 21 | IsolateMessageProtocol.fromMap(message); 22 | // you can write you business code here 23 | if (protocol.action == IsolateMessageAction.cdnAssets) { 24 | _uploadCOS( 25 | arguments: arguments, 26 | sendPort: sendPort, 27 | uploadFiles: protocol.data as List, 28 | ); 29 | } 30 | } 31 | }); 32 | } 33 | 34 | /// 上传cos 35 | Future _uploadCOS({ 36 | required List arguments, 37 | required SendPort sendPort, 38 | required List uploadFiles, 39 | }) async { 40 | COSApiFactory.initialize( 41 | config: COSConfig( 42 | appId: 'xxx', 43 | secretId: 'xxx', 44 | secretKey: 'xxx', 45 | ), 46 | bucketName: 'xxx', 47 | region: 'xxx', 48 | ); 49 | 50 | // asset-base 51 | final String assetBase = arguments[1]; 52 | 53 | /// web-output 54 | final String webOutput = path.join(path.current, 'build', 'web'); 55 | 56 | // cdn的前缀路径 57 | final Uri uri = Uri.parse(assetBase); 58 | // 去掉末尾的 / 59 | final String cdnPrefixPath = uri.path.substring(1); 60 | 61 | // 查询历史版本 62 | final COSListBucketResult buckets = await COSApiFactory.objectApi.listObjects( 63 | listObjectHeader: COSListObjectHeader()..prefix = cdnPrefixPath, 64 | ); 65 | 66 | if (buckets.contents?.isNotEmpty ?? false) { 67 | // 删除历史版本 68 | final List objects = 69 | buckets.contents!.map((COSContents content) { 70 | print('to delete file: ${content.key}'); 71 | return COSObject(key: content.key ?? ''); 72 | }).toList(); 73 | final COSDelete delete = COSDelete(quiet: false, objects: objects); 74 | await COSApiFactory.objectApi.deleteMultipleObjects(delete: delete); 75 | } 76 | 77 | // 上传当前版本至cos 78 | final List> tasks = 79 | uploadFiles.map>((String filePath) { 80 | String objectKey = path.relative(filePath, from: webOutput); 81 | objectKey = '$cdnPrefixPath$objectKey'; 82 | objectKey = path.toUri(objectKey).toString(); 83 | print('to upload file: $objectKey'); 84 | return COSApiFactory.objectApi.putFileObject( 85 | objectKey: objectKey, 86 | filePath: filePath, 87 | ); 88 | }).toList(); 89 | await Future.wait(tasks); 90 | 91 | final IsolateMessageProtocol response = 92 | IsolateMessageProtocol.response(IsolateMessageAction.cdnAssets); 93 | sendPort.send(response.toMap()); 94 | } 95 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:example/main.dart'; 9 | import 'package:flutter/material.dart'; 10 | import 'package:flutter_test/flutter_test.dart'; 11 | 12 | void main() { 13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(const App()); 16 | 17 | // Verify that our counter starts at 0. 18 | expect(find.text('0'), findsOneWidget); 19 | expect(find.text('1'), findsNothing); 20 | 21 | // Tap the '+' icon and trigger a frame. 22 | await tester.tap(find.byIcon(Icons.add)); 23 | await tester.pump(); 24 | 25 | // Verify that our counter has incremented. 26 | expect(find.text('0'), findsNothing); 27 | expect(find.text('1'), findsOneWidget); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TryImpossible/flutter_web_optimizer/fab0de55a8b2b7ca4ae2a5d81ac59621fb1778bd/example/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | example 33 | 34 | 35 | 36 | 37 | 38 | 39 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /flutter_js/.gitignore: -------------------------------------------------------------------------------- 1 | # Node.js 依赖 2 | node_modules/ 3 | package-lock.json 4 | yarn.lock 5 | pnpm-lock.yaml 6 | 7 | # 构建输出 8 | dist/ 9 | build/ 10 | out/ 11 | 12 | # 临时文件 13 | *.log 14 | *.tmp 15 | *.temp 16 | *.cache 17 | 18 | # IDE 和编辑器 19 | .vscode/ 20 | .idea/ 21 | *.iml 22 | 23 | # 系统文件 24 | .DS_Store 25 | Thumbs.db 26 | 27 | # 测试相关 28 | coverage/ 29 | .nyc_output/ 30 | test-results/ 31 | 32 | # 环境配置 33 | .env 34 | .env.*.local 35 | 36 | # TypeScript 临时文件 37 | *.tsbuildinfo 38 | 39 | # 静态分析工具 40 | eslintcache 41 | .stylelintcache 42 | .prettierignore 43 | prettier.cache 44 | 45 | # 本地配置文件 46 | *.local 47 | *.env.local 48 | -------------------------------------------------------------------------------- /flutter_js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_js", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "flutter.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "build": "npm install && npx rollup -c" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "rollup": "^2.79.2", 14 | "rollup-plugin-terser": "^7.0.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /flutter_js/rollup.config.js: -------------------------------------------------------------------------------- 1 | import { terser } from "rollup-plugin-terser"; 2 | 3 | export default { 4 | input: "src/flutter.js", // 项目入口文件 5 | output: { 6 | file: "dist/flutter.js", // 输出文件 7 | format: "iife", // 立即执行函数形式,适合浏览器 8 | sourcemap: true, // 启用 Source Map 9 | }, 10 | plugins: [terser()], // 使用 Terser 压缩混淆代码 11 | }; 12 | -------------------------------------------------------------------------------- /flutter_js/src/browser_environment.js: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | const isBlink = () => { 6 | return (navigator.vendor === 'Google Inc.') || 7 | (navigator.agent === 'Edg/'); 8 | } 9 | 10 | const hasImageCodecs = () => { 11 | if (typeof ImageDecoder === 'undefined') { 12 | return false; 13 | } 14 | // TODO(yjbanov): https://github.com/flutter/flutter/issues/122761 15 | // Frequently, when a browser launches an API that other browsers already 16 | // support, there are subtle incompatibilities that may cause apps to crash if, 17 | // we blindly adopt the new implementation. This check prevents us from picking 18 | // up potentially incompatible implementations of ImagdeDecoder API. Instead, 19 | // when a new browser engine launches the API, we'll evaluate it and enable it 20 | // explicitly. 21 | return isBlink(); 22 | } 23 | 24 | const hasChromiumBreakIterators = () => { 25 | return (typeof Intl.v8BreakIterator !== "undefined") && 26 | (typeof Intl.Segmenter !== "undefined"); 27 | } 28 | 29 | const supportsWasmGC = () => { 30 | // This attempts to instantiate a wasm module that only will validate if the 31 | // final WasmGC spec is implemented in the browser. 32 | // 33 | // Copied from https://github.com/GoogleChromeLabs/wasm-feature-detect/blob/main/src/detectors/gc/index.js 34 | const bytes = [0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 95, 1, 120, 0]; 35 | return WebAssembly.validate(new Uint8Array(bytes)); 36 | } 37 | 38 | /** 39 | * @returns {import("./types").BrowserEnvironment} 40 | */ 41 | export const browserEnvironment = { 42 | hasImageCodecs: hasImageCodecs(), 43 | hasChromiumBreakIterators: hasChromiumBreakIterators(), 44 | supportsWasmGC: supportsWasmGC(), 45 | crossOriginIsolated: window.crossOriginIsolated, 46 | }; 47 | -------------------------------------------------------------------------------- /flutter_js/src/canvaskit_loader.js: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import { createWasmInstantiator } from "./instantiate_wasm.js"; 6 | import { resolveUrlWithSegments } from "./utils.js"; 7 | 8 | export const loadCanvasKit = (deps, config, browserEnvironment, canvasKitBaseUrl) => { 9 | window.flutterCanvasKitLoaded = (async () => { 10 | if (window.flutterCanvasKit) { 11 | // The user has set this global variable ahead of time, so we just return that. 12 | return window.flutterCanvasKit; 13 | } 14 | const supportsChromiumCanvasKit = browserEnvironment.hasChromiumBreakIterators && browserEnvironment.hasImageCodecs; 15 | if (!supportsChromiumCanvasKit && config.canvasKitVariant == "chromium") { 16 | throw "Chromium CanvasKit variant specifically requested, but unsupported in this browser"; 17 | } 18 | const useChromiumCanvasKit = supportsChromiumCanvasKit && (config.canvasKitVariant !== "full"); 19 | let baseUrl = canvasKitBaseUrl; 20 | if (useChromiumCanvasKit) { 21 | baseUrl = resolveUrlWithSegments(baseUrl, "chromium"); 22 | } 23 | let canvasKitUrl = resolveUrlWithSegments(baseUrl, "canvaskit.js"); 24 | if (deps.flutterTT.policy) { 25 | canvasKitUrl = deps.flutterTT.policy.createScriptURL(canvasKitUrl); 26 | } 27 | const wasmInstantiator = createWasmInstantiator(resolveUrlWithSegments(baseUrl, "canvaskit.wasm")); 28 | const canvasKitModule = await import(canvasKitUrl); 29 | window.flutterCanvasKit = await canvasKitModule.default({ 30 | instantiateWasm: wasmInstantiator, 31 | }); 32 | return window.flutterCanvasKit; 33 | })(); 34 | return window.flutterCanvasKitLoaded; 35 | } 36 | -------------------------------------------------------------------------------- /flutter_js/src/entrypoint_loader.js: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import { resolveUrlWithSegments } from "./utils.js"; 6 | 7 | /** 8 | * Handles injecting the main Flutter web entrypoint (main.dart.js), and notifying 9 | * the user when Flutter is ready, through `didCreateEngineInitializer`. 10 | * 11 | * @see https://docs.flutter.dev/development/platform-integration/web/initialization 12 | */ 13 | export class FlutterEntrypointLoader { 14 | /** 15 | * Creates a FlutterEntrypointLoader. 16 | */ 17 | constructor() { 18 | // Watchdog to prevent injecting the main entrypoint multiple times. 19 | this._scriptLoaded = false; 20 | 21 | // when load main.dart.js error, retry 22 | this._retryCount = 0; 23 | } 24 | /** 25 | * Injects a TrustedTypesPolicy (or undefined if the feature is not supported). 26 | * @param {TrustedTypesPolicy | undefined} policy 27 | */ 28 | setTrustedTypesPolicy(policy) { 29 | this._ttPolicy = policy; 30 | } 31 | /** 32 | * @deprecated 33 | * Loads flutter main entrypoint, specified by `entrypointUrl`, and calls a 34 | * user-specified `onEntrypointLoaded` callback with an EngineInitializer 35 | * object when it's done. 36 | * 37 | * @param {*} options 38 | * @returns {Promise | undefined} that will eventually resolve with an 39 | * EngineInitializer, or will be rejected with the error caused by the loader. 40 | * Returns undefined when an `onEntrypointLoaded` callback is supplied in `options`. 41 | */ 42 | async loadEntrypoint(options) { 43 | const { entrypointUrl = resolveUrlWithSegments("main.dart.js"), onEntrypointLoaded, nonce } = 44 | options || {}; 45 | return this._loadJSEntrypoint(entrypointUrl, onEntrypointLoaded, nonce); 46 | } 47 | 48 | /** 49 | * Loads the entry point for a flutter application. 50 | * @param {import("./types").ApplicationBuild} build 51 | * Information about the specific build that is to be loaded 52 | * @param {*} deps 53 | * External dependencies that may be needed to load the app. 54 | * @param {import("./types").FlutterConfiguration} config 55 | * The application configuration. If no callback is specified, this will be 56 | * passed along to engine when initializing it. 57 | * @param {string} nonce 58 | * A nonce to apply to the main application script tag, if necessary. 59 | * @param {import("./types").OnEntrypointLoadedCallback?} onEntrypointLoaded 60 | * An optional callback to invoke when the entrypoint is loaded. If no 61 | * callback is supplied, the engine initializer and app runner will be 62 | * automatically invoked on load, passing along the supplied flutter 63 | * configuration. 64 | */ 65 | async load(build, deps, config, nonce, onEntrypointLoaded) { 66 | onEntrypointLoaded ??= (engineInitializer) => { 67 | engineInitializer.initializeEngine(config).then((appRunner) => appRunner.runApp()) 68 | }; 69 | const { entryPointBaseUrl } = config; 70 | if (build.compileTarget === "dart2wasm") { 71 | return this._loadWasmEntrypoint(build, deps, entryPointBaseUrl, onEntrypointLoaded); 72 | } else { 73 | const mainPath = build.mainJsPath ?? "main.dart.js"; 74 | const entrypointUrl = resolveUrlWithSegments(entryPointBaseUrl, mainPath); 75 | return this._loadJSEntrypoint(entrypointUrl, onEntrypointLoaded, nonce); 76 | } 77 | } 78 | 79 | /** 80 | * Resolves the promise created by loadEntrypoint, and calls the `onEntrypointLoaded` 81 | * function supplied by the user (if needed). 82 | * 83 | * Called by Flutter through `_flutter.loader.didCreateEngineInitializer` method, 84 | * which is bound to the correct instance of the FlutterEntrypointLoader by 85 | * the FlutterLoader object. 86 | * 87 | * @param {Function} engineInitializer @see https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/js_interop/js_loader.dart#L42 88 | */ 89 | didCreateEngineInitializer(engineInitializer) { 90 | // hook initializeEngine function,set assetBase and canvasKitBaseUrl 91 | const originalInitializeEngine = engineInitializer.initializeEngine; 92 | engineInitializer.initializeEngine = function(args) { 93 | const _args = { assetBase, canvasKitBaseUrl: `${assetBase}canvaskit/` }; 94 | if (Object.prototype.toString.call(args).slice(8, -1) === 'Object') { 95 | Object.assign(_args, args); 96 | } 97 | return originalInitializeEngine.call(this, _args); 98 | } 99 | 100 | if (typeof this._didCreateEngineInitializerResolve === "function") { 101 | this._didCreateEngineInitializerResolve(engineInitializer); 102 | // Remove the resolver after the first time, so Flutter Web can hot restart. 103 | this._didCreateEngineInitializerResolve = null; 104 | // Make the engine revert to "auto" initialization on hot restart. 105 | delete _flutter.loader.didCreateEngineInitializer; 106 | } 107 | if (typeof this._onEntrypointLoaded === "function") { 108 | this._onEntrypointLoaded(engineInitializer); 109 | } 110 | } 111 | /** 112 | * Injects a script tag into the DOM, and configures this loader to be able to 113 | * handle the "entrypoint loaded" notifications received from Flutter web. 114 | * 115 | * @param {string} entrypointUrl the URL of the script that will initialize 116 | * Flutter. 117 | * @param {Function} onEntrypointLoaded a callback that will be called when 118 | * Flutter web notifies this object that the entrypoint is 119 | * loaded. 120 | * @returns {Promise | undefined} a Promise that resolves when the entrypoint 121 | * is loaded, or undefined if `onEntrypointLoaded` 122 | * is a function. 123 | */ 124 | async _loadJSEntrypoint(entrypointUrl, onEntrypointLoaded, nonce) { 125 | const useCallback = typeof onEntrypointLoaded === "function"; 126 | if (!this._scriptLoaded) { 127 | this._scriptLoaded = true; 128 | const scriptTag = await this._createScriptTag(entrypointUrl, nonce); 129 | if (useCallback) { 130 | // Just inject the script tag, and return nothing; Flutter will call 131 | // `didCreateEngineInitializer` when it's done. 132 | console.debug("Injecting