├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yaml │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yaml └── workflows │ └── main.yaml ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── assets ├── performance_report.png └── vgv_logo.png ├── build.yaml ├── coverage_badge.svg ├── 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 ├── e2e │ ├── counter_test.dart │ ├── e2e.dart │ └── performance │ │ └── reports │ │ ├── counter_performance.timeline.json │ │ └── counter_performance.timeline_summary.json ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── 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 │ └── main.dart ├── linux │ ├── .gitignore │ ├── CMakeLists.txt │ ├── flutter │ │ ├── CMakeLists.txt │ │ ├── generated_plugin_registrant.cc │ │ ├── generated_plugin_registrant.h │ │ └── generated_plugins.cmake │ ├── main.cc │ ├── my_application.cc │ └── my_application.h ├── macos │ ├── .gitignore │ ├── Flutter │ │ ├── Flutter-Debug.xcconfig │ │ ├── Flutter-Release.xcconfig │ │ └── GeneratedPluginRegistrant.swift │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ └── app_icon_64.png │ │ ├── Base.lproj │ │ └── MainMenu.xib │ │ ├── Configs │ │ ├── AppInfo.xcconfig │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── Warnings.xcconfig │ │ ├── DebugProfile.entitlements │ │ ├── Info.plist │ │ ├── MainFlutterWindow.swift │ │ └── Release.entitlements ├── pubspec.lock ├── pubspec.yaml ├── very_good_performance.yaml ├── web │ ├── favicon.png │ ├── icons │ │ ├── Icon-192.png │ │ └── Icon-512.png │ ├── index.html │ └── manifest.json └── windows │ ├── .gitignore │ ├── CMakeLists.txt │ ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake │ └── runner │ ├── CMakeLists.txt │ ├── Runner.rc │ ├── flutter_window.cpp │ ├── flutter_window.h │ ├── main.cpp │ ├── resource.h │ ├── resources │ └── app_icon.ico │ ├── run_loop.cpp │ ├── run_loop.h │ ├── runner.exe.manifest │ ├── utils.cpp │ ├── utils.h │ ├── win32_window.cpp │ └── win32_window.h ├── lib ├── src │ ├── models │ │ ├── configuration.dart │ │ ├── configuration.g.dart │ │ ├── models.dart │ │ ├── performance_exception.dart │ │ ├── report.dart │ │ ├── report.g.dart │ │ └── score.dart │ ├── printer.dart │ ├── scorer.dart │ └── very_good_performance.dart └── very_good_performance.dart ├── pubspec.yaml └── test ├── fixtures ├── fixtures.dart ├── timeline │ ├── error_report.dart │ ├── success_report.dart │ └── warning_report.dart └── very_good_performance.yaml └── very_good_performance_test.dart /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Every request must be reviewed and accepted by: 2 | 3 | * @felangel @renancaraujo @wolfenrain -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | --- 5 | 6 | **Describe the bug** 7 | A clear and concise description of what the bug is. 8 | 9 | **To Reproduce** 10 | Steps to reproduce the behavior: 11 | 12 | 1. Go to '...' 13 | 2. Click on '....' 14 | 3. Scroll down to '....' 15 | 4. See error 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **Additional context** 24 | Add any other context about the problem here. 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yaml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | --- 5 | 6 | **Is your feature request related to a problem? Please describe.** 7 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 8 | 9 | **Describe the solution you'd like** 10 | A clear and concise description of what you want to happen. 11 | 12 | **Describe alternatives you've considered** 13 | A clear and concise description of any alternative solutions or features you've considered. 14 | 15 | **Additional context** 16 | Add any other context or screenshots about the feature request here. 17 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ## Description 8 | 9 | 10 | 11 | ## Type of Change 12 | 13 | 14 | 15 | - [ ] ✨ New feature (non-breaking change which adds functionality) 16 | - [ ] 🛠️ Bug fix (non-breaking change which fixes an issue) 17 | - [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change) 18 | - [ ] 🧹 Code refactor 19 | - [ ] ✅ Build configuration change 20 | - [ ] 📝 Documentation 21 | - [ ] 🗑️ Chore 22 | -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | - package-ecosystem: "pub" 8 | directory: "/example" 9 | schedule: 10 | interval: "daily" 11 | - package-ecosystem: "pub" 12 | directory: "/" 13 | schedule: 14 | interval: "daily" 15 | -------------------------------------------------------------------------------- /.github/workflows/main.yaml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | semantic-pull-request: 7 | uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1 8 | 9 | build: 10 | uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 11 | with: 12 | flutter_channel: stable 13 | flutter_version: 3.3.5 14 | 15 | pana: 16 | uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v1 17 | -------------------------------------------------------------------------------- /.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 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | coverage/ 32 | build/ 33 | pubspec.lock 34 | 35 | # Android related 36 | **/android/**/gradle-wrapper.jar 37 | **/android/.gradle 38 | **/android/captures/ 39 | **/android/gradlew 40 | **/android/gradlew.bat 41 | **/android/local.properties 42 | **/android/**/GeneratedPluginRegistrant.java 43 | 44 | # iOS/XCode related 45 | **/ios/**/*.mode1v3 46 | **/ios/**/*.mode2v3 47 | **/ios/**/*.moved-aside 48 | **/ios/**/*.pbxuser 49 | **/ios/**/*.perspectivev3 50 | **/ios/**/*sync/ 51 | **/ios/**/.sconsign.dblite 52 | **/ios/**/.tags* 53 | **/ios/**/.vagrant/ 54 | **/ios/**/DerivedData/ 55 | **/ios/**/Icon? 56 | **/ios/**/Pods/ 57 | **/ios/**/.symlinks/ 58 | **/ios/**/profile 59 | **/ios/**/xcuserdata 60 | **/ios/.generated/ 61 | **/ios/Flutter/App.framework 62 | **/ios/Flutter/Flutter.framework 63 | **/ios/Flutter/Flutter.podspec 64 | **/ios/Flutter/Generated.xcconfig 65 | **/ios/Flutter/ephemeral 66 | **/ios/Flutter/app.flx 67 | **/ios/Flutter/app.zip 68 | **/ios/Flutter/flutter_assets/ 69 | **/ios/Flutter/flutter_export_environment.sh 70 | **/ios/ServiceDefinitions.json 71 | **/ios/Runner/GeneratedPluginRegistrant.* 72 | 73 | # Exceptions to above rules. 74 | !**/ios/**/default.mode1v3 75 | !**/ios/**/default.mode2v3 76 | !**/ios/**/default.pbxuser 77 | !**/ios/**/default.perspectivev3 78 | -------------------------------------------------------------------------------- /.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: 06e2fd63574bad2edafbe4653104ed76871ee0b1 8 | channel: beta 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.4 2 | 3 | - Upgrade to `very_good_analysis: ^2.1.0` 4 | 5 | ## 0.0.3 6 | 7 | - Improve documentation 8 | 9 | ## 0.0.2 10 | 11 | - Added `capturePerformanceReport` as an extension of `FlutterDriver` 12 | - Added `example` project 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Very Good Ventures 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

⚠️ Attention: This repository has been archived and is now read-only!

2 | 3 | # Very Good Performance 4 | 5 | [![Very Good Ventures][logo_white]][very_good_ventures_link_dark] 6 | [![Very Good Ventures][logo_black]][very_good_ventures_link_light] 7 | 8 | Developed with 💙 by [Very Good Ventures][very_good_ventures_link] 🦄 9 | 10 | [![ci][ci_badge]][ci_link] 11 | [![coverage][coverage_badge]][ci_link] 12 | [![pub package][pub_badge]][pub_link] 13 | [![License: MIT][license_badge]][license_link] 14 | [![style: very good analysis][very_good_analysis_badge]][very_good_analysis_badge_link] 15 | 16 | --- 17 | 18 | Utility on top of the [Flutter Driver API](https://api.flutter.dev/flutter/flutter_driver/flutter_driver-library.html) that facilitates measuring the performance of your app in an automated way 19 | 20 | ## Usage 21 | 22 | #### `very_good_performance.yaml` 23 | 24 | Add a new file at root of your project named `very_good_performance.yaml` with the following fields. 25 | 26 | You can modify these values to match your own performance expectations. 27 | 28 | ```yaml 29 | performance_report: 30 | directory: performance/reports 31 | integration_test_expectations: 32 | should_fail_build_on_warning: true 33 | should_fail_build_on_error: true 34 | performance_metrics: 35 | missed_frames_threshold: 36 | warning: 5 37 | error: 10 38 | average_frame_build_rate_threshold: 39 | warning_time_in_milliseconds: 14.0 40 | error_time_in_milliseconds: 16.0 41 | worst_frame_build_rate_threshold: 42 | warning_time_in_milliseconds: 14.0 43 | error_time_in_milliseconds: 16.0 44 | ``` 45 | 46 | #### Running tests with `FlutterDriver` 47 | 48 | Simply wrap your `FlutterDriver` tests with the method `capturePerformanceReport` to start collecting performance information 49 | 50 | ```dart 51 | test('tapping on the Increment button updates the counter', () async { 52 | await driver.capturePerformanceReport( 53 | reportName: 'counter_performance', 54 | action: () async { 55 | await driver.tap(find.byType(FloatingActionButton)); 56 | expect(await driver.getText(find.text('1')), '1'); 57 | await driver.tap(find.byType(FloatingActionButton)); 58 | expect(await driver.getText(find.text('2')), '2'); 59 | }, 60 | ); 61 | }); 62 | ``` 63 | 64 | At the end of the execution, you will see a similar report to this one: 65 | 66 | ![Performance Report](https://github.com/VeryGoodOpenSource/very_good_performance/raw/main/assets/performance_report.png) 67 | 68 | #### Running the example project 69 | 70 | You can find an `example` project that showcases how to use this library. 71 | 72 | ```bash 73 | $> cd example 74 | $> flutter drive --target=e2e/e2e.dart --driver=e2e/counter_test.dart -d macos --profile 75 | ``` 76 | 77 | You should see the Counter app running and, at the end of the execution, it will print the performance overview in the console, and will generate the performance reports under `e2e/performance/reports`. 78 | 79 | [ci_badge]: https://github.com/VeryGoodOpenSource/very_good_performance/workflows/ci/badge.svg 80 | [ci_link]: https://github.com/VeryGoodOpenSource/very_good_performance/actions 81 | [coverage_badge]: https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/main/coverage_badge.svg 82 | [license_badge]: https://img.shields.io/badge/license-MIT-blue.svg 83 | [license_link]: https://opensource.org/licenses/MIT 84 | [logo_black]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_black.png#gh-light-mode-only 85 | [logo_white]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_white.png#gh-dark-mode-only 86 | [pub_badge]: https://img.shields.io/pub/v/very_good_performance.svg 87 | [pub_link]: https://pub.dartlang.org/packages/very_good_performance 88 | [very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg 89 | [very_good_analysis_badge_link]: https://pub.dev/packages/very_good_analysis 90 | [very_good_ventures_link]: https://verygood.ventures 91 | [very_good_ventures_link_dark]: https://verygood.ventures#gh-dark-mode-only 92 | [very_good_ventures_link_light]: https://verygood.ventures#gh-light-mode-only 93 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:very_good_analysis/analysis_options.3.1.0.yaml 2 | 3 | linter: 4 | rules: 5 | public_member_api_docs: false 6 | -------------------------------------------------------------------------------- /assets/performance_report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/assets/performance_report.png -------------------------------------------------------------------------------- /assets/vgv_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/assets/vgv_logo.png -------------------------------------------------------------------------------- /build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | builders: 4 | source_gen|combining_builder: 5 | options: 6 | ignore_for_file: 7 | - implicit_dynamic_parameter 8 | - require_trailing_commas -------------------------------------------------------------------------------- /coverage_badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | coverage 16 | coverage 17 | 100% 18 | 100% 19 | 20 | -------------------------------------------------------------------------------- /example/.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 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 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: 06e2fd63574bad2edafbe4653104ed76871ee0b1 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:very_good_analysis/analysis_options.3.1.0.yaml 2 | 3 | linter: 4 | rules: 5 | public_member_api_docs: false 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 30 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | defaultConfig { 36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 37 | applicationId "com.example.example" 38 | minSdkVersion 16 39 | targetSdkVersion 30 40 | versionCode flutterVersionCode.toInteger() 41 | versionName flutterVersionName 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 59 | } 60 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /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 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/e2e/counter_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_driver/flutter_driver.dart'; 2 | import 'package:test/test.dart'; 3 | import 'package:very_good_performance/very_good_performance.dart'; 4 | 5 | void main() { 6 | late FlutterDriver driver; 7 | 8 | setUpAll(() async { 9 | driver = await FlutterDriver.connect(); 10 | }); 11 | 12 | tearDownAll(() { 13 | driver.close(); 14 | }); 15 | 16 | test('tapping on the Increment button updates the counter', () async { 17 | await driver.capturePerformanceReport( 18 | reportName: 'counter_performance', 19 | action: () async { 20 | await driver.tap(find.byType('FloatingActionButton')); 21 | expect(await driver.getText(find.text('1')), '1'); 22 | await driver.tap(find.byType('FloatingActionButton')); 23 | expect(await driver.getText(find.text('2')), '2'); 24 | await driver.tap(find.byType('FloatingActionButton')); 25 | expect(await driver.getText(find.text('3')), '3'); 26 | await driver.tap(find.byType('FloatingActionButton')); 27 | expect(await driver.getText(find.text('4')), '4'); 28 | await driver.tap(find.byType('FloatingActionButton')); 29 | expect(await driver.getText(find.text('5')), '5'); 30 | await driver.tap(find.byType('FloatingActionButton')); 31 | expect(await driver.getText(find.text('6')), '6'); 32 | await driver.tap(find.byType('FloatingActionButton')); 33 | expect(await driver.getText(find.text('7')), '7'); 34 | await driver.tap(find.byType('FloatingActionButton')); 35 | expect(await driver.getText(find.text('8')), '8'); 36 | await driver.tap(find.byType('FloatingActionButton')); 37 | expect(await driver.getText(find.text('9')), '9'); 38 | await driver.tap(find.byType('FloatingActionButton')); 39 | expect(await driver.getText(find.text('10')), '10'); 40 | }, 41 | ); 42 | }); 43 | } 44 | -------------------------------------------------------------------------------- /example/e2e/e2e.dart: -------------------------------------------------------------------------------- 1 | import 'package:example/main.dart' as app; 2 | import 'package:flutter_driver/driver_extension.dart'; 3 | 4 | void main() { 5 | enableFlutterDriverExtension(); 6 | app.main(); 7 | } 8 | -------------------------------------------------------------------------------- /example/e2e/performance/reports/counter_performance.timeline_summary.json: -------------------------------------------------------------------------------- 1 | { 2 | "average_frame_build_time_millis": 0.5012785714285712, 3 | "90th_percentile_frame_build_time_millis": 0.663, 4 | "99th_percentile_frame_build_time_millis": 1.214, 5 | "worst_frame_build_time_millis": 1.377, 6 | "missed_frame_build_budget_count": 0, 7 | "average_frame_rasterizer_time_millis": 1.084271428571428, 8 | "90th_percentile_frame_rasterizer_time_millis": 1.405, 9 | "99th_percentile_frame_rasterizer_time_millis": 2.053, 10 | "worst_frame_rasterizer_time_millis": 2.168, 11 | "missed_frame_rasterizer_budget_count": 0, 12 | "frame_count": 140, 13 | "frame_rasterizer_count": 140, 14 | "frame_build_times": [ 15 | 704, 16 | 599, 17 | 423, 18 | 450, 19 | 607, 20 | 591, 21 | 408, 22 | 372, 23 | 321, 24 | 553, 25 | 393, 26 | 362, 27 | 542, 28 | 342, 29 | 648, 30 | 248, 31 | 269, 32 | 250, 33 | 288, 34 | 189, 35 | 335, 36 | 300, 37 | 494, 38 | 231, 39 | 435, 40 | 488, 41 | 430, 42 | 387, 43 | 845, 44 | 319, 45 | 216, 46 | 410, 47 | 389, 48 | 726, 49 | 383, 50 | 328, 51 | 510, 52 | 337, 53 | 331, 54 | 332, 55 | 398, 56 | 534, 57 | 830, 58 | 289, 59 | 557, 60 | 357, 61 | 599, 62 | 377, 63 | 301, 64 | 484, 65 | 369, 66 | 380, 67 | 264, 68 | 330, 69 | 597, 70 | 555, 71 | 1214, 72 | 582, 73 | 380, 74 | 610, 75 | 398, 76 | 406, 77 | 566, 78 | 570, 79 | 486, 80 | 581, 81 | 612, 82 | 592, 83 | 392, 84 | 291, 85 | 1377, 86 | 630, 87 | 418, 88 | 644, 89 | 618, 90 | 755, 91 | 412, 92 | 402, 93 | 610, 94 | 436, 95 | 380, 96 | 232, 97 | 232, 98 | 575, 99 | 897, 100 | 424, 101 | 629, 102 | 663, 103 | 439, 104 | 403, 105 | 632, 106 | 726, 107 | 616, 108 | 423, 109 | 626, 110 | 614, 111 | 602, 112 | 390, 113 | 857, 114 | 628, 115 | 619, 116 | 492, 117 | 608, 118 | 687, 119 | 396, 120 | 619, 121 | 604, 122 | 667, 123 | 585, 124 | 422, 125 | 585, 126 | 581, 127 | 818, 128 | 397, 129 | 393, 130 | 404, 131 | 348, 132 | 344, 133 | 402, 134 | 366, 135 | 596, 136 | 554, 137 | 580, 138 | 581, 139 | 338, 140 | 551, 141 | 963, 142 | 557, 143 | 598, 144 | 598, 145 | 389, 146 | 551, 147 | 399, 148 | 578, 149 | 373, 150 | 567, 151 | 595, 152 | 553, 153 | 382, 154 | 563 155 | ], 156 | "frame_rasterizer_times": [ 157 | 1139, 158 | 2168, 159 | 2053, 160 | 1457, 161 | 1034, 162 | 1414, 163 | 1030, 164 | 902, 165 | 973, 166 | 1330, 167 | 1489, 168 | 947, 169 | 976, 170 | 853, 171 | 650, 172 | 697, 173 | 641, 174 | 618, 175 | 900, 176 | 709, 177 | 815, 178 | 539, 179 | 998, 180 | 576, 181 | 1142, 182 | 1017, 183 | 809, 184 | 918, 185 | 703, 186 | 711, 187 | 526, 188 | 965, 189 | 1006, 190 | 1182, 191 | 1143, 192 | 993, 193 | 1012, 194 | 1026, 195 | 840, 196 | 946, 197 | 917, 198 | 934, 199 | 859, 200 | 647, 201 | 1305, 202 | 989, 203 | 1448, 204 | 964, 205 | 817, 206 | 1192, 207 | 1109, 208 | 1223, 209 | 655, 210 | 982, 211 | 1351, 212 | 1166, 213 | 1113, 214 | 1353, 215 | 1172, 216 | 1189, 217 | 950, 218 | 1155, 219 | 1162, 220 | 1181, 221 | 1096, 222 | 1459, 223 | 1419, 224 | 1211, 225 | 881, 226 | 717, 227 | 1098, 228 | 1173, 229 | 1028, 230 | 1373, 231 | 1276, 232 | 1175, 233 | 1103, 234 | 1204, 235 | 1352, 236 | 1180, 237 | 664, 238 | 645, 239 | 573, 240 | 1015, 241 | 799, 242 | 1009, 243 | 1414, 244 | 1150, 245 | 1045, 246 | 1186, 247 | 1335, 248 | 1113, 249 | 1168, 250 | 1172, 251 | 1206, 252 | 1451, 253 | 1174, 254 | 1020, 255 | 832, 256 | 1341, 257 | 1156, 258 | 1106, 259 | 1333, 260 | 1256, 261 | 1141, 262 | 1169, 263 | 1311, 264 | 1305, 265 | 1403, 266 | 983, 267 | 991, 268 | 1076, 269 | 872, 270 | 865, 271 | 1015, 272 | 1091, 273 | 913, 274 | 932, 275 | 1123, 276 | 1154, 277 | 1068, 278 | 1471, 279 | 1047, 280 | 1384, 281 | 792, 282 | 1191, 283 | 975, 284 | 1373, 285 | 1176, 286 | 1479, 287 | 1113, 288 | 1405, 289 | 1081, 290 | 1450, 291 | 1114, 292 | 1223, 293 | 1100, 294 | 1450, 295 | 903, 296 | 1071 297 | ], 298 | "frame_begin_times": [ 299 | 0, 300 | 19154, 301 | 33530, 302 | 52811, 303 | 67705, 304 | 83697, 305 | 103784, 306 | 116896, 307 | 136740, 308 | 152474, 309 | 166838, 310 | 186613, 311 | 202709, 312 | 217019, 313 | 233842, 314 | 250499, 315 | 266722, 316 | 285275, 317 | 303595, 318 | 319370, 319 | 336527, 320 | 350104, 321 | 367935, 322 | 383379, 323 | 400387, 324 | 416830, 325 | 433649, 326 | 450106, 327 | 466965, 328 | 484452, 329 | 499993, 330 | 519022, 331 | 533771, 332 | 551988, 333 | 566821, 334 | 584088, 335 | 601403, 336 | 617896, 337 | 634568, 338 | 650935, 339 | 669441, 340 | 686644, 341 | 700685, 342 | 717241, 343 | 737406, 344 | 751845, 345 | 769907, 346 | 785263, 347 | 800119, 348 | 819975, 349 | 835088, 350 | 850274, 351 | 866787, 352 | 884819, 353 | 903417, 354 | 917392, 355 | 934940, 356 | 953614, 357 | 968708, 358 | 983861, 359 | 1000202, 360 | 1019170, 361 | 1036920, 362 | 1051431, 363 | 1066788, 364 | 1083735, 365 | 1104100, 366 | 1118491, 367 | 1133702, 368 | 1150448, 369 | 1168548, 370 | 1184976, 371 | 1200358, 372 | 1219517, 373 | 1236788, 374 | 1252541, 375 | 1266839, 376 | 1285325, 377 | 1303719, 378 | 1319457, 379 | 1333467, 380 | 1353377, 381 | 1367514, 382 | 1386171, 383 | 1400834, 384 | 1417732, 385 | 1435382, 386 | 1452998, 387 | 1468466, 388 | 1486978, 389 | 1503309, 390 | 1519168, 391 | 1533996, 392 | 1550367, 393 | 1570847, 394 | 1586374, 395 | 1600997, 396 | 1618025, 397 | 1634788, 398 | 1653738, 399 | 1668018, 400 | 1683848, 401 | 1701719, 402 | 1720396, 403 | 1735022, 404 | 1753690, 405 | 1769694, 406 | 1785408, 407 | 1801616, 408 | 1817710, 409 | 1834721, 410 | 1852918, 411 | 1866848, 412 | 1884891, 413 | 1900923, 414 | 1919496, 415 | 1935891, 416 | 1950127, 417 | 1969075, 418 | 1987011, 419 | 2000249, 420 | 2019319, 421 | 2034609, 422 | 2053847, 423 | 2069692, 424 | 2083605, 425 | 2101003, 426 | 2117406, 427 | 2133751, 428 | 2150246, 429 | 2167092, 430 | 2186270, 431 | 2200504, 432 | 2217059, 433 | 2234653, 434 | 2251232, 435 | 2266900, 436 | 2285486, 437 | 2300186, 438 | 2320068 439 | ], 440 | "frame_rasterizer_begin_times": [ 441 | 0, 442 | 19096, 443 | 33269, 444 | 52585, 445 | 67656, 446 | 83586, 447 | 103536, 448 | 116602, 449 | 136347, 450 | 152393, 451 | 166578, 452 | 186320, 453 | 202622, 454 | 216707, 455 | 233791, 456 | 250076, 457 | 266290, 458 | 284833, 459 | 303181, 460 | 318915, 461 | 336161, 462 | 349703, 463 | 367753, 464 | 382908, 465 | 400174, 466 | 416610, 467 | 433351, 468 | 449842, 469 | 467108, 470 | 484065, 471 | 499509, 472 | 518730, 473 | 533504, 474 | 551976, 475 | 566528, 476 | 583764, 477 | 601211, 478 | 617531, 479 | 634243, 480 | 650585, 481 | 669132, 482 | 686543, 483 | 700815, 484 | 716835, 485 | 737334, 486 | 751552, 487 | 769873, 488 | 784955, 489 | 799739, 490 | 819828, 491 | 834761, 492 | 850002, 493 | 866352, 494 | 884451, 495 | 903380, 496 | 917315, 497 | 935473, 498 | 953562, 499 | 968437, 500 | 983836, 501 | 999951, 502 | 1018924, 503 | 1036885, 504 | 1051365, 505 | 1066602, 506 | 1083686, 507 | 1104084, 508 | 1118448, 509 | 1133439, 510 | 1150039, 511 | 1169274, 512 | 1184925, 513 | 1200151, 514 | 1219533, 515 | 1236771, 516 | 1252605, 517 | 1266631, 518 | 1285069, 519 | 1303700, 520 | 1319242, 521 | 1333143, 522 | 1352908, 523 | 1367085, 524 | 1386107, 525 | 1401072, 526 | 1417507, 527 | 1435382, 528 | 1453030, 529 | 1468256, 530 | 1486726, 531 | 1503312, 532 | 1519314, 533 | 1533986, 534 | 1550156, 535 | 1570830, 536 | 1586352, 537 | 1600926, 538 | 1617765, 539 | 1634943, 540 | 1653728, 541 | 1668006, 542 | 1683663, 543 | 1701716, 544 | 1720327, 545 | 1734759, 546 | 1753653, 547 | 1769664, 548 | 1785373, 549 | 1801575, 550 | 1817477, 551 | 1834654, 552 | 1852876, 553 | 1867002, 554 | 1884637, 555 | 1900605, 556 | 1919207, 557 | 1935601, 558 | 1949820, 559 | 1968823, 560 | 1986737, 561 | 2000205, 562 | 2019256, 563 | 2034532, 564 | 2053791, 565 | 2069367, 566 | 2083530, 567 | 2101324, 568 | 2117329, 569 | 2133733, 570 | 2150212, 571 | 2166831, 572 | 2186188, 573 | 2200253, 574 | 2217003, 575 | 2234377, 576 | 2251162, 577 | 2266837, 578 | 2285376, 579 | 2299881, 580 | 2320006 581 | ], 582 | "average_vsync_transitions_missed": 0.0, 583 | "90th_percentile_vsync_transitions_missed": 0.0, 584 | "99th_percentile_vsync_transitions_missed": 0.0, 585 | "average_vsync_frame_lag": 15515.728571428572, 586 | "90th_percentile_vsync_frame_lag": 18420.0, 587 | "99th_percentile_vsync_frame_lag": 19691.0 588 | } -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/ephemeral/ 22 | Flutter/app.flx 23 | Flutter/app.zip 24 | Flutter/flutter_assets/ 25 | Flutter/flutter_export_environment.sh 26 | ServiceDefinitions.json 27 | Runner/GeneratedPluginRegistrant.* 28 | 29 | # Exceptions to above rules. 30 | !default.mode1v3 31 | !default.mode2v3 32 | !default.pbxuser 33 | !default.perspectivev3 34 | -------------------------------------------------------------------------------- /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 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 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 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | INFOPLIST_FILE = Runner/Info.plist; 293 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 294 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 295 | PRODUCT_NAME = "$(TARGET_NAME)"; 296 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 297 | SWIFT_VERSION = 5.0; 298 | VERSIONING_SYSTEM = "apple-generic"; 299 | }; 300 | name = Profile; 301 | }; 302 | 97C147031CF9000F007C117D /* Debug */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ALWAYS_SEARCH_USER_PATHS = NO; 306 | CLANG_ANALYZER_NONNULL = YES; 307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 308 | CLANG_CXX_LIBRARY = "libc++"; 309 | CLANG_ENABLE_MODULES = YES; 310 | CLANG_ENABLE_OBJC_ARC = YES; 311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_COMMA = YES; 314 | CLANG_WARN_CONSTANT_CONVERSION = YES; 315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 317 | CLANG_WARN_EMPTY_BODY = YES; 318 | CLANG_WARN_ENUM_CONVERSION = YES; 319 | CLANG_WARN_INFINITE_RECURSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 322 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 323 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 326 | CLANG_WARN_STRICT_PROTOTYPES = YES; 327 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 328 | CLANG_WARN_UNREACHABLE_CODE = YES; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | DEBUG_INFORMATION_FORMAT = dwarf; 333 | ENABLE_STRICT_OBJC_MSGSEND = YES; 334 | ENABLE_TESTABILITY = YES; 335 | GCC_C_LANGUAGE_STANDARD = gnu99; 336 | GCC_DYNAMIC_NO_PIC = NO; 337 | GCC_NO_COMMON_BLOCKS = YES; 338 | GCC_OPTIMIZATION_LEVEL = 0; 339 | GCC_PREPROCESSOR_DEFINITIONS = ( 340 | "DEBUG=1", 341 | "$(inherited)", 342 | ); 343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 345 | GCC_WARN_UNDECLARED_SELECTOR = YES; 346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 347 | GCC_WARN_UNUSED_FUNCTION = YES; 348 | GCC_WARN_UNUSED_VARIABLE = YES; 349 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 350 | MTL_ENABLE_DEBUG_INFO = YES; 351 | ONLY_ACTIVE_ARCH = YES; 352 | SDKROOT = iphoneos; 353 | TARGETED_DEVICE_FAMILY = "1,2"; 354 | }; 355 | name = Debug; 356 | }; 357 | 97C147041CF9000F007C117D /* Release */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | ALWAYS_SEARCH_USER_PATHS = NO; 361 | CLANG_ANALYZER_NONNULL = YES; 362 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 363 | CLANG_CXX_LIBRARY = "libc++"; 364 | CLANG_ENABLE_MODULES = YES; 365 | CLANG_ENABLE_OBJC_ARC = YES; 366 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 367 | CLANG_WARN_BOOL_CONVERSION = YES; 368 | CLANG_WARN_COMMA = YES; 369 | CLANG_WARN_CONSTANT_CONVERSION = YES; 370 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 372 | CLANG_WARN_EMPTY_BODY = YES; 373 | CLANG_WARN_ENUM_CONVERSION = YES; 374 | CLANG_WARN_INFINITE_RECURSION = YES; 375 | CLANG_WARN_INT_CONVERSION = YES; 376 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 377 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 378 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 379 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 380 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 381 | CLANG_WARN_STRICT_PROTOTYPES = YES; 382 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 383 | CLANG_WARN_UNREACHABLE_CODE = YES; 384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 385 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 386 | COPY_PHASE_STRIP = NO; 387 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 388 | ENABLE_NS_ASSERTIONS = NO; 389 | ENABLE_STRICT_OBJC_MSGSEND = YES; 390 | GCC_C_LANGUAGE_STANDARD = gnu99; 391 | GCC_NO_COMMON_BLOCKS = YES; 392 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 393 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 394 | GCC_WARN_UNDECLARED_SELECTOR = YES; 395 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 396 | GCC_WARN_UNUSED_FUNCTION = YES; 397 | GCC_WARN_UNUSED_VARIABLE = YES; 398 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 399 | MTL_ENABLE_DEBUG_INFO = NO; 400 | SDKROOT = iphoneos; 401 | SUPPORTED_PLATFORMS = iphoneos; 402 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 403 | TARGETED_DEVICE_FAMILY = "1,2"; 404 | VALIDATE_PRODUCT = YES; 405 | }; 406 | name = Release; 407 | }; 408 | 97C147061CF9000F007C117D /* Debug */ = { 409 | isa = XCBuildConfiguration; 410 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 411 | buildSettings = { 412 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 413 | CLANG_ENABLE_MODULES = YES; 414 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 415 | ENABLE_BITCODE = NO; 416 | INFOPLIST_FILE = Runner/Info.plist; 417 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 418 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 419 | PRODUCT_NAME = "$(TARGET_NAME)"; 420 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 421 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 422 | SWIFT_VERSION = 5.0; 423 | VERSIONING_SYSTEM = "apple-generic"; 424 | }; 425 | name = Debug; 426 | }; 427 | 97C147071CF9000F007C117D /* Release */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 430 | buildSettings = { 431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 432 | CLANG_ENABLE_MODULES = YES; 433 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 434 | ENABLE_BITCODE = NO; 435 | INFOPLIST_FILE = Runner/Info.plist; 436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 437 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 438 | PRODUCT_NAME = "$(TARGET_NAME)"; 439 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 440 | SWIFT_VERSION = 5.0; 441 | VERSIONING_SYSTEM = "apple-generic"; 442 | }; 443 | name = Release; 444 | }; 445 | /* End XCBuildConfiguration section */ 446 | 447 | /* Begin XCConfigurationList section */ 448 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 449 | isa = XCConfigurationList; 450 | buildConfigurations = ( 451 | 97C147031CF9000F007C117D /* Debug */, 452 | 97C147041CF9000F007C117D /* Release */, 453 | 249021D3217E4FDB00AE95B9 /* Profile */, 454 | ); 455 | defaultConfigurationIsVisible = 0; 456 | defaultConfigurationName = Release; 457 | }; 458 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | 97C147061CF9000F007C117D /* Debug */, 462 | 97C147071CF9000F007C117D /* Release */, 463 | 249021D4217E4FDB00AE95B9 /* Profile */, 464 | ); 465 | defaultConfigurationIsVisible = 0; 466 | defaultConfigurationName = Release; 467 | }; 468 | /* End XCConfigurationList section */ 469 | }; 470 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 471 | } 472 | -------------------------------------------------------------------------------- /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 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | @UIApplicationMain 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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/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 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void main() { 4 | runApp(const MyApp()); 5 | } 6 | 7 | class MyApp extends StatelessWidget { 8 | const MyApp({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return MaterialApp( 13 | title: 'Flutter Demo', 14 | theme: ThemeData( 15 | primarySwatch: Colors.blue, 16 | ), 17 | home: const MyHomePage(title: 'Flutter Demo Home Page'), 18 | ); 19 | } 20 | } 21 | 22 | class MyHomePage extends StatefulWidget { 23 | const MyHomePage({super.key, required this.title}); 24 | 25 | final String title; 26 | 27 | @override 28 | State createState() => _MyHomePageState(); 29 | } 30 | 31 | class _MyHomePageState extends State { 32 | int _counter = 0; 33 | 34 | void _incrementCounter() { 35 | setState(() { 36 | _counter++; 37 | }); 38 | } 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return Scaffold( 43 | appBar: AppBar( 44 | title: Text(widget.title), 45 | ), 46 | body: Center( 47 | child: Column( 48 | mainAxisAlignment: MainAxisAlignment.center, 49 | children: [ 50 | const Text('You have pushed the button this many times:'), 51 | Text('$_counter', style: Theme.of(context).textTheme.headline4), 52 | ], 53 | ), 54 | ), 55 | floatingActionButton: FloatingActionButton( 56 | onPressed: _incrementCounter, 57 | tooltip: 'Increment', 58 | child: const Icon(Icons.add), 59 | ), 60 | ); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /example/linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /example/linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(runner LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "example") 5 | set(APPLICATION_ID "com.example.example") 6 | 7 | cmake_policy(SET CMP0063 NEW) 8 | 9 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 10 | 11 | # Root filesystem for cross-building. 12 | if(FLUTTER_TARGET_PLATFORM_SYSROOT) 13 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) 14 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) 15 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 16 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 17 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 18 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 19 | endif() 20 | 21 | # Configure build options. 22 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 23 | set(CMAKE_BUILD_TYPE "Debug" CACHE 24 | STRING "Flutter build mode" FORCE) 25 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 26 | "Debug" "Profile" "Release") 27 | endif() 28 | 29 | # Compilation settings that should be applied to most targets. 30 | function(APPLY_STANDARD_SETTINGS TARGET) 31 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 32 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 33 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 34 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 35 | endfunction() 36 | 37 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 38 | 39 | # Flutter library and tool build rules. 40 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 41 | 42 | # System-level dependencies. 43 | find_package(PkgConfig REQUIRED) 44 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 45 | 46 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 47 | 48 | # Application build 49 | add_executable(${BINARY_NAME} 50 | "main.cc" 51 | "my_application.cc" 52 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 53 | ) 54 | apply_standard_settings(${BINARY_NAME}) 55 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 56 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 57 | add_dependencies(${BINARY_NAME} flutter_assemble) 58 | # Only the install-generated bundle's copy of the executable will launch 59 | # correctly, since the resources must in the right relative locations. To avoid 60 | # people trying to run the unbundled copy, put it in a subdirectory instead of 61 | # the default top-level location. 62 | set_target_properties(${BINARY_NAME} 63 | PROPERTIES 64 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" 65 | ) 66 | 67 | # Generated plugin build rules, which manage building the plugins and adding 68 | # them to the application. 69 | include(flutter/generated_plugins.cmake) 70 | 71 | 72 | # === Installation === 73 | # By default, "installing" just makes a relocatable bundle in the build 74 | # directory. 75 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 76 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 77 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 78 | endif() 79 | 80 | # Start with a clean build bundle directory every time. 81 | install(CODE " 82 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 83 | " COMPONENT Runtime) 84 | 85 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 86 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 87 | 88 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 89 | COMPONENT Runtime) 90 | 91 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 92 | COMPONENT Runtime) 93 | 94 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 95 | COMPONENT Runtime) 96 | 97 | if(PLUGIN_BUNDLED_LIBRARIES) 98 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 99 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 100 | COMPONENT Runtime) 101 | endif() 102 | 103 | # Fully re-copy the assets directory on each build to avoid having stale files 104 | # from a previous install. 105 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 106 | install(CODE " 107 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 108 | " COMPONENT Runtime) 109 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 110 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 111 | 112 | # Install the AOT library on non-Debug builds only. 113 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 114 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 115 | COMPONENT Runtime) 116 | endif() 117 | -------------------------------------------------------------------------------- /example/linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | 11 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 12 | # which isn't available in 3.10. 13 | function(list_prepend LIST_NAME PREFIX) 14 | set(NEW_LIST "") 15 | foreach(element ${${LIST_NAME}}) 16 | list(APPEND NEW_LIST "${PREFIX}${element}") 17 | endforeach(element) 18 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 19 | endfunction() 20 | 21 | # === Flutter Library === 22 | # System-level dependencies. 23 | find_package(PkgConfig REQUIRED) 24 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 25 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 26 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 27 | 28 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 29 | 30 | # Published to parent scope for install step. 31 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 32 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 33 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 34 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 35 | 36 | list(APPEND FLUTTER_LIBRARY_HEADERS 37 | "fl_basic_message_channel.h" 38 | "fl_binary_codec.h" 39 | "fl_binary_messenger.h" 40 | "fl_dart_project.h" 41 | "fl_engine.h" 42 | "fl_json_message_codec.h" 43 | "fl_json_method_codec.h" 44 | "fl_message_codec.h" 45 | "fl_method_call.h" 46 | "fl_method_channel.h" 47 | "fl_method_codec.h" 48 | "fl_method_response.h" 49 | "fl_plugin_registrar.h" 50 | "fl_plugin_registry.h" 51 | "fl_standard_message_codec.h" 52 | "fl_standard_method_codec.h" 53 | "fl_string_codec.h" 54 | "fl_value.h" 55 | "fl_view.h" 56 | "flutter_linux.h" 57 | ) 58 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 59 | add_library(flutter INTERFACE) 60 | target_include_directories(flutter INTERFACE 61 | "${EPHEMERAL_DIR}" 62 | ) 63 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 64 | target_link_libraries(flutter INTERFACE 65 | PkgConfig::GTK 66 | PkgConfig::GLIB 67 | PkgConfig::GIO 68 | ) 69 | add_dependencies(flutter flutter_assemble) 70 | 71 | # === Flutter tool backend === 72 | # _phony_ is a non-existent file to force this command to run every time, 73 | # since currently there's no way to get a full input/output list from the 74 | # flutter tool. 75 | add_custom_command( 76 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 77 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 78 | COMMAND ${CMAKE_COMMAND} -E env 79 | ${FLUTTER_TOOL_ENVIRONMENT} 80 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 81 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 82 | VERBATIM 83 | ) 84 | add_custom_target(flutter_assemble DEPENDS 85 | "${FLUTTER_LIBRARY}" 86 | ${FLUTTER_LIBRARY_HEADERS} 87 | ) 88 | -------------------------------------------------------------------------------- /example/linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /example/linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /example/linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /example/linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /example/linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen *screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "example"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } 47 | else { 48 | gtk_window_set_title(window, "example"); 49 | } 50 | 51 | gtk_window_set_default_size(window, 1280, 720); 52 | gtk_widget_show(GTK_WIDGET(window)); 53 | 54 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 55 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 56 | 57 | FlView* view = fl_view_new(project); 58 | gtk_widget_show(GTK_WIDGET(view)); 59 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 60 | 61 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 62 | 63 | gtk_widget_grab_focus(GTK_WIDGET(view)); 64 | } 65 | 66 | // Implements GApplication::local_command_line. 67 | static gboolean my_application_local_command_line(GApplication* application, gchar ***arguments, int *exit_status) { 68 | MyApplication* self = MY_APPLICATION(application); 69 | // Strip out the first argument as it is the binary name. 70 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 71 | 72 | g_autoptr(GError) error = nullptr; 73 | if (!g_application_register(application, nullptr, &error)) { 74 | g_warning("Failed to register: %s", error->message); 75 | *exit_status = 1; 76 | return TRUE; 77 | } 78 | 79 | g_application_activate(application); 80 | *exit_status = 0; 81 | 82 | return TRUE; 83 | } 84 | 85 | // Implements GObject::dispose. 86 | static void my_application_dispose(GObject *object) { 87 | MyApplication* self = MY_APPLICATION(object); 88 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 89 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 90 | } 91 | 92 | static void my_application_class_init(MyApplicationClass* klass) { 93 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 94 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 95 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 96 | } 97 | 98 | static void my_application_init(MyApplication* self) {} 99 | 100 | MyApplication* my_application_new() { 101 | return MY_APPLICATION(g_object_new(my_application_get_type(), 102 | "application-id", APPLICATION_ID, 103 | "flags", G_APPLICATION_NON_UNIQUE, 104 | nullptr)); 105 | } 106 | -------------------------------------------------------------------------------- /example/linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/xcuserdata/ 7 | -------------------------------------------------------------------------------- /example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | 9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 10 | } 11 | -------------------------------------------------------------------------------- /example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/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 | 64 | 65 | 71 | 73 | 79 | 80 | 81 | 82 | 84 | 85 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2021 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "47.0.0" 11 | analyzer: 12 | dependency: transitive 13 | description: 14 | name: analyzer 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "4.7.0" 18 | ansicolor: 19 | dependency: transitive 20 | description: 21 | name: ansicolor 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.0.1" 25 | archive: 26 | dependency: transitive 27 | description: 28 | name: archive 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "3.3.0" 32 | args: 33 | dependency: transitive 34 | description: 35 | name: args 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "2.1.0" 39 | async: 40 | dependency: transitive 41 | description: 42 | name: async 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "2.9.0" 46 | barbecue: 47 | dependency: transitive 48 | description: 49 | name: barbecue 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "0.4.0" 53 | boolean_selector: 54 | dependency: transitive 55 | description: 56 | name: boolean_selector 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.0" 60 | characters: 61 | dependency: transitive 62 | description: 63 | name: characters 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.2.1" 67 | charcode: 68 | dependency: transitive 69 | description: 70 | name: charcode 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.3.1" 74 | checked_yaml: 75 | dependency: transitive 76 | description: 77 | name: checked_yaml 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "2.0.1" 81 | clock: 82 | dependency: transitive 83 | description: 84 | name: clock 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "1.1.1" 88 | collection: 89 | dependency: transitive 90 | description: 91 | name: collection 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "1.16.0" 95 | convert: 96 | dependency: transitive 97 | description: 98 | name: convert 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "3.0.0" 102 | coverage: 103 | dependency: transitive 104 | description: 105 | name: coverage 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "1.5.0" 109 | crypto: 110 | dependency: transitive 111 | description: 112 | name: crypto 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "3.0.2" 116 | fake_async: 117 | dependency: transitive 118 | description: 119 | name: fake_async 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "1.3.1" 123 | file: 124 | dependency: transitive 125 | description: 126 | name: file 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "6.1.2" 130 | flutter: 131 | dependency: "direct main" 132 | description: flutter 133 | source: sdk 134 | version: "0.0.0" 135 | flutter_driver: 136 | dependency: "direct dev" 137 | description: flutter 138 | source: sdk 139 | version: "0.0.0" 140 | flutter_test: 141 | dependency: "direct dev" 142 | description: flutter 143 | source: sdk 144 | version: "0.0.0" 145 | frontend_server_client: 146 | dependency: transitive 147 | description: 148 | name: frontend_server_client 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "2.1.2" 152 | fuchsia_remote_debug_protocol: 153 | dependency: transitive 154 | description: flutter 155 | source: sdk 156 | version: "0.0.0" 157 | glob: 158 | dependency: transitive 159 | description: 160 | name: glob 161 | url: "https://pub.dartlang.org" 162 | source: hosted 163 | version: "2.0.1" 164 | http_multi_server: 165 | dependency: transitive 166 | description: 167 | name: http_multi_server 168 | url: "https://pub.dartlang.org" 169 | source: hosted 170 | version: "3.0.1" 171 | http_parser: 172 | dependency: transitive 173 | description: 174 | name: http_parser 175 | url: "https://pub.dartlang.org" 176 | source: hosted 177 | version: "4.0.0" 178 | io: 179 | dependency: transitive 180 | description: 181 | name: io 182 | url: "https://pub.dartlang.org" 183 | source: hosted 184 | version: "1.0.0" 185 | js: 186 | dependency: transitive 187 | description: 188 | name: js 189 | url: "https://pub.dartlang.org" 190 | source: hosted 191 | version: "0.6.3" 192 | json_annotation: 193 | dependency: transitive 194 | description: 195 | name: json_annotation 196 | url: "https://pub.dartlang.org" 197 | source: hosted 198 | version: "4.7.0" 199 | logging: 200 | dependency: transitive 201 | description: 202 | name: logging 203 | url: "https://pub.dartlang.org" 204 | source: hosted 205 | version: "1.0.1" 206 | matcher: 207 | dependency: transitive 208 | description: 209 | name: matcher 210 | url: "https://pub.dartlang.org" 211 | source: hosted 212 | version: "0.12.12" 213 | material_color_utilities: 214 | dependency: transitive 215 | description: 216 | name: material_color_utilities 217 | url: "https://pub.dartlang.org" 218 | source: hosted 219 | version: "0.1.5" 220 | meta: 221 | dependency: transitive 222 | description: 223 | name: meta 224 | url: "https://pub.dartlang.org" 225 | source: hosted 226 | version: "1.8.0" 227 | mime: 228 | dependency: transitive 229 | description: 230 | name: mime 231 | url: "https://pub.dartlang.org" 232 | source: hosted 233 | version: "1.0.0" 234 | node_preamble: 235 | dependency: transitive 236 | description: 237 | name: node_preamble 238 | url: "https://pub.dartlang.org" 239 | source: hosted 240 | version: "2.0.0" 241 | package_config: 242 | dependency: transitive 243 | description: 244 | name: package_config 245 | url: "https://pub.dartlang.org" 246 | source: hosted 247 | version: "2.0.0" 248 | path: 249 | dependency: transitive 250 | description: 251 | name: path 252 | url: "https://pub.dartlang.org" 253 | source: hosted 254 | version: "1.8.2" 255 | pedantic: 256 | dependency: transitive 257 | description: 258 | name: pedantic 259 | url: "https://pub.dartlang.org" 260 | source: hosted 261 | version: "1.11.0" 262 | platform: 263 | dependency: transitive 264 | description: 265 | name: platform 266 | url: "https://pub.dartlang.org" 267 | source: hosted 268 | version: "3.1.0" 269 | pool: 270 | dependency: transitive 271 | description: 272 | name: pool 273 | url: "https://pub.dartlang.org" 274 | source: hosted 275 | version: "1.5.0" 276 | process: 277 | dependency: transitive 278 | description: 279 | name: process 280 | url: "https://pub.dartlang.org" 281 | source: hosted 282 | version: "4.2.4" 283 | pub_semver: 284 | dependency: transitive 285 | description: 286 | name: pub_semver 287 | url: "https://pub.dartlang.org" 288 | source: hosted 289 | version: "2.0.0" 290 | shelf: 291 | dependency: transitive 292 | description: 293 | name: shelf 294 | url: "https://pub.dartlang.org" 295 | source: hosted 296 | version: "1.1.4" 297 | shelf_packages_handler: 298 | dependency: transitive 299 | description: 300 | name: shelf_packages_handler 301 | url: "https://pub.dartlang.org" 302 | source: hosted 303 | version: "3.0.0" 304 | shelf_static: 305 | dependency: transitive 306 | description: 307 | name: shelf_static 308 | url: "https://pub.dartlang.org" 309 | source: hosted 310 | version: "1.0.0" 311 | shelf_web_socket: 312 | dependency: transitive 313 | description: 314 | name: shelf_web_socket 315 | url: "https://pub.dartlang.org" 316 | source: hosted 317 | version: "1.0.1" 318 | sky_engine: 319 | dependency: transitive 320 | description: flutter 321 | source: sdk 322 | version: "0.0.99" 323 | source_map_stack_trace: 324 | dependency: transitive 325 | description: 326 | name: source_map_stack_trace 327 | url: "https://pub.dartlang.org" 328 | source: hosted 329 | version: "2.1.0" 330 | source_maps: 331 | dependency: transitive 332 | description: 333 | name: source_maps 334 | url: "https://pub.dartlang.org" 335 | source: hosted 336 | version: "0.10.10" 337 | source_span: 338 | dependency: transitive 339 | description: 340 | name: source_span 341 | url: "https://pub.dartlang.org" 342 | source: hosted 343 | version: "1.9.0" 344 | stack_trace: 345 | dependency: transitive 346 | description: 347 | name: stack_trace 348 | url: "https://pub.dartlang.org" 349 | source: hosted 350 | version: "1.10.0" 351 | stream_channel: 352 | dependency: transitive 353 | description: 354 | name: stream_channel 355 | url: "https://pub.dartlang.org" 356 | source: hosted 357 | version: "2.1.0" 358 | string_scanner: 359 | dependency: transitive 360 | description: 361 | name: string_scanner 362 | url: "https://pub.dartlang.org" 363 | source: hosted 364 | version: "1.1.1" 365 | string_validator: 366 | dependency: transitive 367 | description: 368 | name: string_validator 369 | url: "https://pub.dartlang.org" 370 | source: hosted 371 | version: "0.3.0" 372 | sync_http: 373 | dependency: transitive 374 | description: 375 | name: sync_http 376 | url: "https://pub.dartlang.org" 377 | source: hosted 378 | version: "0.3.1" 379 | term_glyph: 380 | dependency: transitive 381 | description: 382 | name: term_glyph 383 | url: "https://pub.dartlang.org" 384 | source: hosted 385 | version: "1.2.1" 386 | test: 387 | dependency: "direct dev" 388 | description: 389 | name: test 390 | url: "https://pub.dartlang.org" 391 | source: hosted 392 | version: "1.21.4" 393 | test_api: 394 | dependency: transitive 395 | description: 396 | name: test_api 397 | url: "https://pub.dartlang.org" 398 | source: hosted 399 | version: "0.4.12" 400 | test_core: 401 | dependency: transitive 402 | description: 403 | name: test_core 404 | url: "https://pub.dartlang.org" 405 | source: hosted 406 | version: "0.4.16" 407 | typed_data: 408 | dependency: transitive 409 | description: 410 | name: typed_data 411 | url: "https://pub.dartlang.org" 412 | source: hosted 413 | version: "1.3.1" 414 | vector_math: 415 | dependency: transitive 416 | description: 417 | name: vector_math 418 | url: "https://pub.dartlang.org" 419 | source: hosted 420 | version: "2.1.2" 421 | very_good_analysis: 422 | dependency: "direct dev" 423 | description: 424 | name: very_good_analysis 425 | url: "https://pub.dartlang.org" 426 | source: hosted 427 | version: "3.1.0" 428 | very_good_performance: 429 | dependency: "direct dev" 430 | description: 431 | path: ".." 432 | relative: true 433 | source: path 434 | version: "0.0.4" 435 | vm_service: 436 | dependency: transitive 437 | description: 438 | name: vm_service 439 | url: "https://pub.dartlang.org" 440 | source: hosted 441 | version: "9.0.0" 442 | watcher: 443 | dependency: transitive 444 | description: 445 | name: watcher 446 | url: "https://pub.dartlang.org" 447 | source: hosted 448 | version: "1.0.0" 449 | web_socket_channel: 450 | dependency: transitive 451 | description: 452 | name: web_socket_channel 453 | url: "https://pub.dartlang.org" 454 | source: hosted 455 | version: "2.1.0" 456 | webdriver: 457 | dependency: transitive 458 | description: 459 | name: webdriver 460 | url: "https://pub.dartlang.org" 461 | source: hosted 462 | version: "3.0.0" 463 | webkit_inspection_protocol: 464 | dependency: transitive 465 | description: 466 | name: webkit_inspection_protocol 467 | url: "https://pub.dartlang.org" 468 | source: hosted 469 | version: "1.0.0" 470 | yaml: 471 | dependency: transitive 472 | description: 473 | name: yaml 474 | url: "https://pub.dartlang.org" 475 | source: hosted 476 | version: "3.1.1" 477 | sdks: 478 | dart: ">=2.18.0 <3.0.0" 479 | flutter: ">=3.3.0" 480 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: Sample project for Very Good Performance 3 | version: 1.0.0 4 | 5 | environment: 6 | sdk: ">=2.18.0 <3.0.0" 7 | 8 | dependencies: 9 | flutter: 10 | sdk: flutter 11 | 12 | dev_dependencies: 13 | flutter_driver: 14 | sdk: flutter 15 | flutter_test: 16 | sdk: flutter 17 | test: 18 | very_good_analysis: ^3.1.0 19 | very_good_performance: 20 | path: ../ 21 | 22 | flutter: 23 | uses-material-design: true 24 | -------------------------------------------------------------------------------- /example/very_good_performance.yaml: -------------------------------------------------------------------------------- 1 | performance_report: 2 | directory: e2e/performance/reports 3 | integration_test_expectations: 4 | should_fail_build_on_warning: false 5 | should_fail_build_on_error: true 6 | performance_metrics: 7 | missed_frames_threshold: 8 | warning: 5 9 | error: 10 10 | average_frame_build_rate_threshold: 11 | warning_time_in_milliseconds: 14.0 12 | error_time_in_milliseconds: 16.0 13 | worst_frame_build_rate_threshold: 14 | warning_time_in_milliseconds: 14.0 15 | error_time_in_milliseconds: 16.0 16 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | example 27 | 28 | 29 | 30 | 33 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /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 | } 24 | -------------------------------------------------------------------------------- /example/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /example/windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(example LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "example") 5 | 6 | cmake_policy(SET CMP0063 NEW) 7 | 8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 9 | 10 | # Configure build options. 11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 12 | if(IS_MULTICONFIG) 13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 14 | CACHE STRING "" FORCE) 15 | else() 16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 17 | set(CMAKE_BUILD_TYPE "Debug" CACHE 18 | STRING "Flutter build mode" FORCE) 19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 20 | "Debug" "Profile" "Release") 21 | endif() 22 | endif() 23 | 24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 28 | 29 | # Use Unicode for all projects. 30 | add_definitions(-DUNICODE -D_UNICODE) 31 | 32 | # Compilation settings that should be applied to most targets. 33 | function(APPLY_STANDARD_SETTINGS TARGET) 34 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 36 | target_compile_options(${TARGET} PRIVATE /EHsc) 37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 39 | endfunction() 40 | 41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 42 | 43 | # Flutter library and tool build rules. 44 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 45 | 46 | # Application build 47 | add_subdirectory("runner") 48 | 49 | # Generated plugin build rules, which manage building the plugins and adding 50 | # them to the application. 51 | include(flutter/generated_plugins.cmake) 52 | 53 | 54 | # === Installation === 55 | # Support files are copied into place next to the executable, so that it can 56 | # run in place. This is done instead of making a separate bundle (as on Linux) 57 | # so that building and running from within Visual Studio will work. 58 | set(BUILD_BUNDLE_DIR "$") 59 | # Make the "install" step default, as it's required to run. 60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 63 | endif() 64 | 65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 67 | 68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 69 | COMPONENT Runtime) 70 | 71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 72 | COMPONENT Runtime) 73 | 74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 75 | COMPONENT Runtime) 76 | 77 | if(PLUGIN_BUNDLED_LIBRARIES) 78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 80 | COMPONENT Runtime) 81 | endif() 82 | 83 | # Fully re-copy the assets directory on each build to avoid having stale files 84 | # from a previous install. 85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 86 | install(CODE " 87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 88 | " COMPONENT Runtime) 89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 91 | 92 | # Install the AOT library on non-Debug builds only. 93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 94 | CONFIGURATIONS Profile;Release 95 | COMPONENT Runtime) 96 | -------------------------------------------------------------------------------- /example/windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 11 | 12 | # === Flutter Library === 13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 14 | 15 | # Published to parent scope for install step. 16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 20 | 21 | list(APPEND FLUTTER_LIBRARY_HEADERS 22 | "flutter_export.h" 23 | "flutter_windows.h" 24 | "flutter_messenger.h" 25 | "flutter_plugin_registrar.h" 26 | "flutter_texture_registrar.h" 27 | ) 28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 29 | add_library(flutter INTERFACE) 30 | target_include_directories(flutter INTERFACE 31 | "${EPHEMERAL_DIR}" 32 | ) 33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 34 | add_dependencies(flutter flutter_assemble) 35 | 36 | # === Wrapper === 37 | list(APPEND CPP_WRAPPER_SOURCES_CORE 38 | "core_implementations.cc" 39 | "standard_codec.cc" 40 | ) 41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 43 | "plugin_registrar.cc" 44 | ) 45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 46 | list(APPEND CPP_WRAPPER_SOURCES_APP 47 | "flutter_engine.cc" 48 | "flutter_view_controller.cc" 49 | ) 50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 51 | 52 | # Wrapper sources needed for a plugin. 53 | add_library(flutter_wrapper_plugin STATIC 54 | ${CPP_WRAPPER_SOURCES_CORE} 55 | ${CPP_WRAPPER_SOURCES_PLUGIN} 56 | ) 57 | apply_standard_settings(flutter_wrapper_plugin) 58 | set_target_properties(flutter_wrapper_plugin PROPERTIES 59 | POSITION_INDEPENDENT_CODE ON) 60 | set_target_properties(flutter_wrapper_plugin PROPERTIES 61 | CXX_VISIBILITY_PRESET hidden) 62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 63 | target_include_directories(flutter_wrapper_plugin PUBLIC 64 | "${WRAPPER_ROOT}/include" 65 | ) 66 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 67 | 68 | # Wrapper sources needed for the runner. 69 | add_library(flutter_wrapper_app STATIC 70 | ${CPP_WRAPPER_SOURCES_CORE} 71 | ${CPP_WRAPPER_SOURCES_APP} 72 | ) 73 | apply_standard_settings(flutter_wrapper_app) 74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 75 | target_include_directories(flutter_wrapper_app PUBLIC 76 | "${WRAPPER_ROOT}/include" 77 | ) 78 | add_dependencies(flutter_wrapper_app flutter_assemble) 79 | 80 | # === Flutter tool backend === 81 | # _phony_ is a non-existent file to force this command to run every time, 82 | # since currently there's no way to get a full input/output list from the 83 | # flutter tool. 84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 86 | add_custom_command( 87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 89 | ${CPP_WRAPPER_SOURCES_APP} 90 | ${PHONY_OUTPUT} 91 | COMMAND ${CMAKE_COMMAND} -E env 92 | ${FLUTTER_TOOL_ENVIRONMENT} 93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 94 | windows-x64 $ 95 | VERBATIM 96 | ) 97 | add_custom_target(flutter_assemble DEPENDS 98 | "${FLUTTER_LIBRARY}" 99 | ${FLUTTER_LIBRARY_HEADERS} 100 | ${CPP_WRAPPER_SOURCES_CORE} 101 | ${CPP_WRAPPER_SOURCES_PLUGIN} 102 | ${CPP_WRAPPER_SOURCES_APP} 103 | ) 104 | -------------------------------------------------------------------------------- /example/windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /example/windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /example/windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /example/windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "run_loop.cpp" 8 | "utils.cpp" 9 | "win32_window.cpp" 10 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 11 | "Runner.rc" 12 | "runner.exe.manifest" 13 | ) 14 | apply_standard_settings(${BINARY_NAME}) 15 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 16 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 17 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 18 | add_dependencies(${BINARY_NAME} flutter_assemble) 19 | -------------------------------------------------------------------------------- /example/windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #ifdef FLUTTER_BUILD_NUMBER 64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0 67 | #endif 68 | 69 | #ifdef FLUTTER_BUILD_NAME 70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "A new Flutter project." "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "example" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2021 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "example.exe" "\0" 98 | VALUE "ProductName", "example" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /example/windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(RunLoop* run_loop, 8 | const flutter::DartProject& project) 9 | : run_loop_(run_loop), project_(project) {} 10 | 11 | FlutterWindow::~FlutterWindow() {} 12 | 13 | bool FlutterWindow::OnCreate() { 14 | if (!Win32Window::OnCreate()) { 15 | return false; 16 | } 17 | 18 | RECT frame = GetClientArea(); 19 | 20 | // The size here must match the window dimensions to avoid unnecessary surface 21 | // creation / destruction in the startup path. 22 | flutter_controller_ = std::make_unique( 23 | frame.right - frame.left, frame.bottom - frame.top, project_); 24 | // Ensure that basic setup of the controller was successful. 25 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 26 | return false; 27 | } 28 | RegisterPlugins(flutter_controller_->engine()); 29 | run_loop_->RegisterFlutterInstance(flutter_controller_->engine()); 30 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 31 | return true; 32 | } 33 | 34 | void FlutterWindow::OnDestroy() { 35 | if (flutter_controller_) { 36 | run_loop_->UnregisterFlutterInstance(flutter_controller_->engine()); 37 | flutter_controller_ = nullptr; 38 | } 39 | 40 | Win32Window::OnDestroy(); 41 | } 42 | 43 | LRESULT 44 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 45 | WPARAM const wparam, 46 | LPARAM const lparam) noexcept { 47 | // Give Flutter, including plugins, an opportunity to handle window messages. 48 | if (flutter_controller_) { 49 | std::optional result = 50 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 51 | lparam); 52 | if (result) { 53 | return *result; 54 | } 55 | } 56 | 57 | switch (message) { 58 | case WM_FONTCHANGE: 59 | flutter_controller_->engine()->ReloadSystemFonts(); 60 | break; 61 | } 62 | 63 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 64 | } 65 | -------------------------------------------------------------------------------- /example/windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "run_loop.h" 10 | #include "win32_window.h" 11 | 12 | // A window that does nothing but host a Flutter view. 13 | class FlutterWindow : public Win32Window { 14 | public: 15 | // Creates a new FlutterWindow driven by the |run_loop|, hosting a 16 | // Flutter view running |project|. 17 | explicit FlutterWindow(RunLoop* run_loop, 18 | const flutter::DartProject& project); 19 | virtual ~FlutterWindow(); 20 | 21 | protected: 22 | // Win32Window: 23 | bool OnCreate() override; 24 | void OnDestroy() override; 25 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 26 | LPARAM const lparam) noexcept override; 27 | 28 | private: 29 | // The run loop driving events for this window. 30 | RunLoop* run_loop_; 31 | 32 | // The project to run. 33 | flutter::DartProject project_; 34 | 35 | // The Flutter instance hosted by this window. 36 | std::unique_ptr flutter_controller_; 37 | }; 38 | 39 | #endif // RUNNER_FLUTTER_WINDOW_H_ 40 | -------------------------------------------------------------------------------- /example/windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "run_loop.h" 7 | #include "utils.h" 8 | 9 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 10 | _In_ wchar_t *command_line, _In_ int show_command) { 11 | // Attach to console when present (e.g., 'flutter run') or create a 12 | // new console when running with a debugger. 13 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 14 | CreateAndAttachConsole(); 15 | } 16 | 17 | // Initialize COM, so that it is available for use in the library and/or 18 | // plugins. 19 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 20 | 21 | RunLoop run_loop; 22 | 23 | flutter::DartProject project(L"data"); 24 | 25 | std::vector command_line_arguments = 26 | GetCommandLineArguments(); 27 | 28 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 29 | 30 | FlutterWindow window(&run_loop, project); 31 | Win32Window::Point origin(10, 10); 32 | Win32Window::Size size(1280, 720); 33 | if (!window.CreateAndShow(L"example", origin, size)) { 34 | return EXIT_FAILURE; 35 | } 36 | window.SetQuitOnClose(true); 37 | 38 | run_loop.Run(); 39 | 40 | ::CoUninitialize(); 41 | return EXIT_SUCCESS; 42 | } 43 | -------------------------------------------------------------------------------- /example/windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /example/windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VeryGoodOpenSource/very_good_performance/079151b0164fa14fea3aabe4bc872bcdb63be0b7/example/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /example/windows/runner/run_loop.cpp: -------------------------------------------------------------------------------- 1 | #include "run_loop.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | RunLoop::RunLoop() {} 8 | 9 | RunLoop::~RunLoop() {} 10 | 11 | void RunLoop::Run() { 12 | bool keep_running = true; 13 | TimePoint next_flutter_event_time = TimePoint::clock::now(); 14 | while (keep_running) { 15 | std::chrono::nanoseconds wait_duration = 16 | std::max(std::chrono::nanoseconds(0), 17 | next_flutter_event_time - TimePoint::clock::now()); 18 | ::MsgWaitForMultipleObjects( 19 | 0, nullptr, FALSE, static_cast(wait_duration.count() / 1000), 20 | QS_ALLINPUT); 21 | bool processed_events = false; 22 | MSG message; 23 | // All pending Windows messages must be processed; MsgWaitForMultipleObjects 24 | // won't return again for items left in the queue after PeekMessage. 25 | while (::PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) { 26 | processed_events = true; 27 | if (message.message == WM_QUIT) { 28 | keep_running = false; 29 | break; 30 | } 31 | ::TranslateMessage(&message); 32 | ::DispatchMessage(&message); 33 | // Allow Flutter to process messages each time a Windows message is 34 | // processed, to prevent starvation. 35 | next_flutter_event_time = 36 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 37 | } 38 | // If the PeekMessage loop didn't run, process Flutter messages. 39 | if (!processed_events) { 40 | next_flutter_event_time = 41 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 42 | } 43 | } 44 | } 45 | 46 | void RunLoop::RegisterFlutterInstance( 47 | flutter::FlutterEngine* flutter_instance) { 48 | flutter_instances_.insert(flutter_instance); 49 | } 50 | 51 | void RunLoop::UnregisterFlutterInstance( 52 | flutter::FlutterEngine* flutter_instance) { 53 | flutter_instances_.erase(flutter_instance); 54 | } 55 | 56 | RunLoop::TimePoint RunLoop::ProcessFlutterMessages() { 57 | TimePoint next_event_time = TimePoint::max(); 58 | for (auto instance : flutter_instances_) { 59 | std::chrono::nanoseconds wait_duration = instance->ProcessMessages(); 60 | if (wait_duration != std::chrono::nanoseconds::max()) { 61 | next_event_time = 62 | std::min(next_event_time, TimePoint::clock::now() + wait_duration); 63 | } 64 | } 65 | return next_event_time; 66 | } 67 | -------------------------------------------------------------------------------- /example/windows/runner/run_loop.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_RUN_LOOP_H_ 2 | #define RUNNER_RUN_LOOP_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | // A runloop that will service events for Flutter instances as well 10 | // as native messages. 11 | class RunLoop { 12 | public: 13 | RunLoop(); 14 | ~RunLoop(); 15 | 16 | // Prevent copying 17 | RunLoop(RunLoop const&) = delete; 18 | RunLoop& operator=(RunLoop const&) = delete; 19 | 20 | // Runs the run loop until the application quits. 21 | void Run(); 22 | 23 | // Registers the given Flutter instance for event servicing. 24 | void RegisterFlutterInstance( 25 | flutter::FlutterEngine* flutter_instance); 26 | 27 | // Unregisters the given Flutter instance from event servicing. 28 | void UnregisterFlutterInstance( 29 | flutter::FlutterEngine* flutter_instance); 30 | 31 | private: 32 | using TimePoint = std::chrono::steady_clock::time_point; 33 | 34 | // Processes all currently pending messages for registered Flutter instances. 35 | TimePoint ProcessFlutterMessages(); 36 | 37 | std::set flutter_instances_; 38 | }; 39 | 40 | #endif // RUNNER_RUN_LOOP_H_ 41 | -------------------------------------------------------------------------------- /example/windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /example/windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /example/windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /example/windows/runner/win32_window.cpp: -------------------------------------------------------------------------------- 1 | #include "win32_window.h" 2 | 3 | #include 4 | 5 | #include "resource.h" 6 | 7 | namespace { 8 | 9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; 10 | 11 | // The number of Win32Window objects that currently exist. 12 | static int g_active_window_count = 0; 13 | 14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); 15 | 16 | // Scale helper to convert logical scaler values to physical using passed in 17 | // scale factor 18 | int Scale(int source, double scale_factor) { 19 | return static_cast(source * scale_factor); 20 | } 21 | 22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. 23 | // This API is only needed for PerMonitor V1 awareness mode. 24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) { 25 | HMODULE user32_module = LoadLibraryA("User32.dll"); 26 | if (!user32_module) { 27 | return; 28 | } 29 | auto enable_non_client_dpi_scaling = 30 | reinterpret_cast( 31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling")); 32 | if (enable_non_client_dpi_scaling != nullptr) { 33 | enable_non_client_dpi_scaling(hwnd); 34 | FreeLibrary(user32_module); 35 | } 36 | } 37 | 38 | } // namespace 39 | 40 | // Manages the Win32Window's window class registration. 41 | class WindowClassRegistrar { 42 | public: 43 | ~WindowClassRegistrar() = default; 44 | 45 | // Returns the singleton registar instance. 46 | static WindowClassRegistrar* GetInstance() { 47 | if (!instance_) { 48 | instance_ = new WindowClassRegistrar(); 49 | } 50 | return instance_; 51 | } 52 | 53 | // Returns the name of the window class, registering the class if it hasn't 54 | // previously been registered. 55 | const wchar_t* GetWindowClass(); 56 | 57 | // Unregisters the window class. Should only be called if there are no 58 | // instances of the window. 59 | void UnregisterWindowClass(); 60 | 61 | private: 62 | WindowClassRegistrar() = default; 63 | 64 | static WindowClassRegistrar* instance_; 65 | 66 | bool class_registered_ = false; 67 | }; 68 | 69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; 70 | 71 | const wchar_t* WindowClassRegistrar::GetWindowClass() { 72 | if (!class_registered_) { 73 | WNDCLASS window_class{}; 74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); 75 | window_class.lpszClassName = kWindowClassName; 76 | window_class.style = CS_HREDRAW | CS_VREDRAW; 77 | window_class.cbClsExtra = 0; 78 | window_class.cbWndExtra = 0; 79 | window_class.hInstance = GetModuleHandle(nullptr); 80 | window_class.hIcon = 81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); 82 | window_class.hbrBackground = 0; 83 | window_class.lpszMenuName = nullptr; 84 | window_class.lpfnWndProc = Win32Window::WndProc; 85 | RegisterClass(&window_class); 86 | class_registered_ = true; 87 | } 88 | return kWindowClassName; 89 | } 90 | 91 | void WindowClassRegistrar::UnregisterWindowClass() { 92 | UnregisterClass(kWindowClassName, nullptr); 93 | class_registered_ = false; 94 | } 95 | 96 | Win32Window::Win32Window() { 97 | ++g_active_window_count; 98 | } 99 | 100 | Win32Window::~Win32Window() { 101 | --g_active_window_count; 102 | Destroy(); 103 | } 104 | 105 | bool Win32Window::CreateAndShow(const std::wstring& title, 106 | const Point& origin, 107 | const Size& size) { 108 | Destroy(); 109 | 110 | const wchar_t* window_class = 111 | WindowClassRegistrar::GetInstance()->GetWindowClass(); 112 | 113 | const POINT target_point = {static_cast(origin.x), 114 | static_cast(origin.y)}; 115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); 116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); 117 | double scale_factor = dpi / 96.0; 118 | 119 | HWND window = CreateWindow( 120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, 121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), 122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor), 123 | nullptr, nullptr, GetModuleHandle(nullptr), this); 124 | 125 | if (!window) { 126 | return false; 127 | } 128 | 129 | return OnCreate(); 130 | } 131 | 132 | // static 133 | LRESULT CALLBACK Win32Window::WndProc(HWND const window, 134 | UINT const message, 135 | WPARAM const wparam, 136 | LPARAM const lparam) noexcept { 137 | if (message == WM_NCCREATE) { 138 | auto window_struct = reinterpret_cast(lparam); 139 | SetWindowLongPtr(window, GWLP_USERDATA, 140 | reinterpret_cast(window_struct->lpCreateParams)); 141 | 142 | auto that = static_cast(window_struct->lpCreateParams); 143 | EnableFullDpiSupportIfAvailable(window); 144 | that->window_handle_ = window; 145 | } else if (Win32Window* that = GetThisFromHandle(window)) { 146 | return that->MessageHandler(window, message, wparam, lparam); 147 | } 148 | 149 | return DefWindowProc(window, message, wparam, lparam); 150 | } 151 | 152 | LRESULT 153 | Win32Window::MessageHandler(HWND hwnd, 154 | UINT const message, 155 | WPARAM const wparam, 156 | LPARAM const lparam) noexcept { 157 | switch (message) { 158 | case WM_DESTROY: 159 | window_handle_ = nullptr; 160 | Destroy(); 161 | if (quit_on_close_) { 162 | PostQuitMessage(0); 163 | } 164 | return 0; 165 | 166 | case WM_DPICHANGED: { 167 | auto newRectSize = reinterpret_cast(lparam); 168 | LONG newWidth = newRectSize->right - newRectSize->left; 169 | LONG newHeight = newRectSize->bottom - newRectSize->top; 170 | 171 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, 172 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE); 173 | 174 | return 0; 175 | } 176 | case WM_SIZE: { 177 | RECT rect = GetClientArea(); 178 | if (child_content_ != nullptr) { 179 | // Size and position the child window. 180 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, 181 | rect.bottom - rect.top, TRUE); 182 | } 183 | return 0; 184 | } 185 | 186 | case WM_ACTIVATE: 187 | if (child_content_ != nullptr) { 188 | SetFocus(child_content_); 189 | } 190 | return 0; 191 | } 192 | 193 | return DefWindowProc(window_handle_, message, wparam, lparam); 194 | } 195 | 196 | void Win32Window::Destroy() { 197 | OnDestroy(); 198 | 199 | if (window_handle_) { 200 | DestroyWindow(window_handle_); 201 | window_handle_ = nullptr; 202 | } 203 | if (g_active_window_count == 0) { 204 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); 205 | } 206 | } 207 | 208 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { 209 | return reinterpret_cast( 210 | GetWindowLongPtr(window, GWLP_USERDATA)); 211 | } 212 | 213 | void Win32Window::SetChildContent(HWND content) { 214 | child_content_ = content; 215 | SetParent(content, window_handle_); 216 | RECT frame = GetClientArea(); 217 | 218 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left, 219 | frame.bottom - frame.top, true); 220 | 221 | SetFocus(child_content_); 222 | } 223 | 224 | RECT Win32Window::GetClientArea() { 225 | RECT frame; 226 | GetClientRect(window_handle_, &frame); 227 | return frame; 228 | } 229 | 230 | HWND Win32Window::GetHandle() { 231 | return window_handle_; 232 | } 233 | 234 | void Win32Window::SetQuitOnClose(bool quit_on_close) { 235 | quit_on_close_ = quit_on_close; 236 | } 237 | 238 | bool Win32Window::OnCreate() { 239 | // No-op; provided for subclasses. 240 | return true; 241 | } 242 | 243 | void Win32Window::OnDestroy() { 244 | // No-op; provided for subclasses. 245 | } 246 | -------------------------------------------------------------------------------- /example/windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | -------------------------------------------------------------------------------- /lib/src/models/configuration.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | import 'package:yaml/yaml.dart'; 3 | 4 | part 'configuration.g.dart'; 5 | 6 | @JsonSerializable( 7 | checked: true, 8 | anyMap: true, 9 | createFactory: true, 10 | createToJson: false, 11 | ) 12 | class Configuration { 13 | const Configuration( 14 | this.performaceReport, 15 | this.integrationTestExpectations, 16 | this.performanceMetrics, 17 | ); 18 | 19 | factory Configuration.fromJson(Map json) => 20 | _$ConfigurationFromJson(json); 21 | 22 | factory Configuration.fromString(String stringYaml) { 23 | final yaml = loadYaml(stringYaml) as YamlMap; 24 | return Configuration.fromJson(yaml); 25 | } 26 | 27 | @JsonKey(name: 'performance_report', required: true) 28 | final PerformanceReport performaceReport; 29 | @JsonKey(name: 'integration_test_expectations', required: true) 30 | final IntegrationTestExpectations integrationTestExpectations; 31 | @JsonKey(name: 'performance_metrics', required: true) 32 | final PerformanceMetrics performanceMetrics; 33 | } 34 | 35 | @JsonSerializable( 36 | checked: true, 37 | anyMap: true, 38 | createFactory: true, 39 | createToJson: false, 40 | ) 41 | class PerformanceReport { 42 | const PerformanceReport(this.directory); 43 | 44 | factory PerformanceReport.fromJson(Map json) => 45 | _$PerformanceReportFromJson(json); 46 | 47 | @JsonKey(name: 'directory') 48 | final String directory; 49 | } 50 | 51 | @JsonSerializable( 52 | checked: true, 53 | anyMap: true, 54 | createFactory: true, 55 | createToJson: false, 56 | ) 57 | class IntegrationTestExpectations { 58 | const IntegrationTestExpectations({ 59 | required this.shouldFailBuildOnWarning, 60 | required this.shouldFailBuildOnError, 61 | }); 62 | 63 | factory IntegrationTestExpectations.fromJson(Map json) => 64 | _$IntegrationTestExpectationsFromJson(json); 65 | 66 | @JsonKey(name: 'should_fail_build_on_warning', required: true) 67 | final bool shouldFailBuildOnWarning; 68 | @JsonKey(name: 'should_fail_build_on_error', required: true) 69 | final bool shouldFailBuildOnError; 70 | } 71 | 72 | @JsonSerializable( 73 | checked: true, 74 | anyMap: true, 75 | createFactory: true, 76 | createToJson: false, 77 | ) 78 | class PerformanceMetrics { 79 | const PerformanceMetrics( 80 | this.missedFramesThreshold, 81 | this.averageFrameBuildRateThreshold, 82 | this.worstFrameBuildRateThreshold, 83 | ); 84 | 85 | factory PerformanceMetrics.fromJson(Map json) => 86 | _$PerformanceMetricsFromJson(json); 87 | 88 | @JsonKey(name: 'missed_frames_threshold', required: true) 89 | final MissedFramesThreshold missedFramesThreshold; 90 | @JsonKey(name: 'average_frame_build_rate_threshold', required: true) 91 | final FrameBuildRateThreshold averageFrameBuildRateThreshold; 92 | @JsonKey(name: 'worst_frame_build_rate_threshold', required: true) 93 | final FrameBuildRateThreshold worstFrameBuildRateThreshold; 94 | } 95 | 96 | @JsonSerializable( 97 | checked: true, 98 | anyMap: true, 99 | createFactory: true, 100 | createToJson: false, 101 | ) 102 | class MissedFramesThreshold { 103 | const MissedFramesThreshold({ 104 | required this.warning, 105 | required this.error, 106 | }); 107 | 108 | factory MissedFramesThreshold.fromJson(Map json) => 109 | _$MissedFramesThresholdFromJson(json); 110 | 111 | @JsonKey(name: 'warning', required: true) 112 | final int warning; 113 | @JsonKey(name: 'error', required: true) 114 | final int error; 115 | } 116 | 117 | @JsonSerializable( 118 | checked: true, 119 | anyMap: true, 120 | createFactory: true, 121 | createToJson: false, 122 | ) 123 | class FrameBuildRateThreshold { 124 | const FrameBuildRateThreshold({ 125 | required this.warningTimeInMilliseconds, 126 | required this.errorTimeInMilliseconds, 127 | }); 128 | 129 | factory FrameBuildRateThreshold.fromJson(Map json) => 130 | _$FrameBuildRateThresholdFromJson(json); 131 | 132 | @JsonKey(name: 'warning_time_in_milliseconds', required: true) 133 | final double warningTimeInMilliseconds; 134 | @JsonKey(name: 'error_time_in_milliseconds', required: true) 135 | final double errorTimeInMilliseconds; 136 | } 137 | -------------------------------------------------------------------------------- /lib/src/models/configuration.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ignore_for_file: implicit_dynamic_parameter, require_trailing_commas 4 | 5 | part of 'configuration.dart'; 6 | 7 | // ************************************************************************** 8 | // JsonSerializableGenerator 9 | // ************************************************************************** 10 | 11 | Configuration _$ConfigurationFromJson(Map json) { 12 | return $checkedNew('Configuration', json, () { 13 | $checkKeys(json, requiredKeys: const [ 14 | 'performance_report', 15 | 'integration_test_expectations', 16 | 'performance_metrics' 17 | ]); 18 | final val = Configuration( 19 | $checkedConvert(json, 'performance_report', 20 | (v) => PerformanceReport.fromJson(v as Map)), 21 | $checkedConvert(json, 'integration_test_expectations', 22 | (v) => IntegrationTestExpectations.fromJson(v as Map)), 23 | $checkedConvert(json, 'performance_metrics', 24 | (v) => PerformanceMetrics.fromJson(v as Map)), 25 | ); 26 | return val; 27 | }, fieldKeyMap: const { 28 | 'performaceReport': 'performance_report', 29 | 'integrationTestExpectations': 'integration_test_expectations', 30 | 'performanceMetrics': 'performance_metrics' 31 | }); 32 | } 33 | 34 | PerformanceReport _$PerformanceReportFromJson(Map json) { 35 | return $checkedNew('PerformanceReport', json, () { 36 | final val = PerformanceReport( 37 | $checkedConvert(json, 'directory', (v) => v as String), 38 | ); 39 | return val; 40 | }); 41 | } 42 | 43 | IntegrationTestExpectations _$IntegrationTestExpectationsFromJson( 44 | Map json, 45 | ) { 46 | return $checkedNew('IntegrationTestExpectations', json, () { 47 | $checkKeys(json, requiredKeys: const [ 48 | 'should_fail_build_on_warning', 49 | 'should_fail_build_on_error' 50 | ]); 51 | final val = IntegrationTestExpectations( 52 | shouldFailBuildOnWarning: $checkedConvert( 53 | json, 'should_fail_build_on_warning', (v) => v as bool), 54 | shouldFailBuildOnError: 55 | $checkedConvert(json, 'should_fail_build_on_error', (v) => v as bool), 56 | ); 57 | return val; 58 | }, fieldKeyMap: const { 59 | 'shouldFailBuildOnWarning': 'should_fail_build_on_warning', 60 | 'shouldFailBuildOnError': 'should_fail_build_on_error' 61 | }); 62 | } 63 | 64 | PerformanceMetrics _$PerformanceMetricsFromJson(Map json) { 65 | return $checkedNew('PerformanceMetrics', json, () { 66 | $checkKeys(json, requiredKeys: const [ 67 | 'missed_frames_threshold', 68 | 'average_frame_build_rate_threshold', 69 | 'worst_frame_build_rate_threshold' 70 | ]); 71 | final val = PerformanceMetrics( 72 | $checkedConvert(json, 'missed_frames_threshold', 73 | (v) => MissedFramesThreshold.fromJson(v as Map)), 74 | $checkedConvert(json, 'average_frame_build_rate_threshold', 75 | (v) => FrameBuildRateThreshold.fromJson(v as Map)), 76 | $checkedConvert(json, 'worst_frame_build_rate_threshold', 77 | (v) => FrameBuildRateThreshold.fromJson(v as Map)), 78 | ); 79 | return val; 80 | }, fieldKeyMap: const { 81 | 'missedFramesThreshold': 'missed_frames_threshold', 82 | 'averageFrameBuildRateThreshold': 'average_frame_build_rate_threshold', 83 | 'worstFrameBuildRateThreshold': 'worst_frame_build_rate_threshold' 84 | }); 85 | } 86 | 87 | MissedFramesThreshold _$MissedFramesThresholdFromJson( 88 | Map json, 89 | ) { 90 | return $checkedNew('MissedFramesThreshold', json, () { 91 | $checkKeys(json, requiredKeys: const ['warning', 'error']); 92 | final val = MissedFramesThreshold( 93 | warning: $checkedConvert(json, 'warning', (v) => v as int), 94 | error: $checkedConvert(json, 'error', (v) => v as int), 95 | ); 96 | return val; 97 | }); 98 | } 99 | 100 | FrameBuildRateThreshold _$FrameBuildRateThresholdFromJson( 101 | Map json, 102 | ) { 103 | return $checkedNew('FrameBuildRateThreshold', json, () { 104 | $checkKeys(json, requiredKeys: const [ 105 | 'warning_time_in_milliseconds', 106 | 'error_time_in_milliseconds' 107 | ]); 108 | final val = FrameBuildRateThreshold( 109 | warningTimeInMilliseconds: $checkedConvert( 110 | json, 'warning_time_in_milliseconds', (v) => (v as num).toDouble()), 111 | errorTimeInMilliseconds: $checkedConvert( 112 | json, 'error_time_in_milliseconds', (v) => (v as num).toDouble()), 113 | ); 114 | return val; 115 | }, fieldKeyMap: const { 116 | 'warningTimeInMilliseconds': 'warning_time_in_milliseconds', 117 | 'errorTimeInMilliseconds': 'error_time_in_milliseconds' 118 | }); 119 | } 120 | -------------------------------------------------------------------------------- /lib/src/models/models.dart: -------------------------------------------------------------------------------- 1 | export 'configuration.dart'; 2 | export 'performance_exception.dart'; 3 | export 'report.dart'; 4 | export 'score.dart'; 5 | -------------------------------------------------------------------------------- /lib/src/models/performance_exception.dart: -------------------------------------------------------------------------------- 1 | class PerformanceException implements Exception {} 2 | -------------------------------------------------------------------------------- /lib/src/models/report.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | part 'report.g.dart'; 4 | 5 | @JsonSerializable(createFactory: true, createToJson: false) 6 | class Report { 7 | const Report({ 8 | required this.averageFrameBuildTimeMillis, 9 | required this.th90PercentileFrameBuildTimeMillis, 10 | required this.th99PercentileFrameBuildTimeMillis, 11 | required this.worstFrameBuildTimeMillis, 12 | required this.missedFrameBuildBudgetCount, 13 | required this.averageFrameRasterizerTimeMillis, 14 | required this.th90percentileFrameRasterizerTimeMillis, 15 | required this.th99percentileFrameRasterizerTimeMillis, 16 | required this.worstFrameRasterizerTimeMillis, 17 | required this.missedFrameRasterizerBudgetCount, 18 | required this.frameCount, 19 | required this.frameBuildTimes, 20 | required this.frameRasterizerTimes, 21 | }); 22 | 23 | factory Report.fromJson(Map json) => _$ReportFromJson(json); 24 | 25 | @JsonKey(name: 'average_frame_build_time_millis') 26 | final double averageFrameBuildTimeMillis; 27 | @JsonKey(name: '90th_percentile_frame_build_time_millis') 28 | final double th90PercentileFrameBuildTimeMillis; 29 | @JsonKey(name: '99th_percentile_frame_build_time_millis') 30 | final double th99PercentileFrameBuildTimeMillis; 31 | @JsonKey(name: 'worst_frame_build_time_millis') 32 | final double worstFrameBuildTimeMillis; 33 | @JsonKey(name: 'missed_frame_build_budget_count') 34 | final int missedFrameBuildBudgetCount; 35 | @JsonKey(name: 'average_frame_rasterizer_time_millis') 36 | final double averageFrameRasterizerTimeMillis; 37 | @JsonKey(name: '90th_percentile_frame_rasterizer_time_millis') 38 | final double th90percentileFrameRasterizerTimeMillis; 39 | @JsonKey(name: '99th_percentile_frame_rasterizer_time_millis') 40 | final double th99percentileFrameRasterizerTimeMillis; 41 | @JsonKey(name: 'worst_frame_rasterizer_time_millis') 42 | final double worstFrameRasterizerTimeMillis; 43 | @JsonKey(name: 'missed_frame_rasterizer_budget_count') 44 | final int missedFrameRasterizerBudgetCount; 45 | @JsonKey(name: 'frame_count') 46 | final int frameCount; 47 | @JsonKey(name: 'frame_build_times') 48 | final List frameBuildTimes; 49 | @JsonKey(name: 'frame_rasterizer_times') 50 | final List frameRasterizerTimes; 51 | } 52 | -------------------------------------------------------------------------------- /lib/src/models/report.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ignore_for_file: implicit_dynamic_parameter, require_trailing_commas 4 | 5 | part of 'report.dart'; 6 | 7 | // ************************************************************************** 8 | // JsonSerializableGenerator 9 | // ************************************************************************** 10 | 11 | Report _$ReportFromJson(Map json) { 12 | return Report( 13 | averageFrameBuildTimeMillis: 14 | (json['average_frame_build_time_millis'] as num).toDouble(), 15 | th90PercentileFrameBuildTimeMillis: 16 | (json['90th_percentile_frame_build_time_millis'] as num).toDouble(), 17 | th99PercentileFrameBuildTimeMillis: 18 | (json['99th_percentile_frame_build_time_millis'] as num).toDouble(), 19 | worstFrameBuildTimeMillis: 20 | (json['worst_frame_build_time_millis'] as num).toDouble(), 21 | missedFrameBuildBudgetCount: json['missed_frame_build_budget_count'] as int, 22 | averageFrameRasterizerTimeMillis: 23 | (json['average_frame_rasterizer_time_millis'] as num).toDouble(), 24 | th90percentileFrameRasterizerTimeMillis: 25 | (json['90th_percentile_frame_rasterizer_time_millis'] as num) 26 | .toDouble(), 27 | th99percentileFrameRasterizerTimeMillis: 28 | (json['99th_percentile_frame_rasterizer_time_millis'] as num) 29 | .toDouble(), 30 | worstFrameRasterizerTimeMillis: 31 | (json['worst_frame_rasterizer_time_millis'] as num).toDouble(), 32 | missedFrameRasterizerBudgetCount: 33 | json['missed_frame_rasterizer_budget_count'] as int, 34 | frameCount: json['frame_count'] as int, 35 | frameBuildTimes: (json['frame_build_times'] as List) 36 | .map((e) => e as int) 37 | .toList(), 38 | frameRasterizerTimes: (json['frame_rasterizer_times'] as List) 39 | .map((e) => e as int) 40 | .toList(), 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /lib/src/models/score.dart: -------------------------------------------------------------------------------- 1 | enum Rating { 2 | success, 3 | warning, 4 | failure, 5 | } 6 | 7 | class Score { 8 | const Score({ 9 | required this.missedFrames, 10 | required this.averageBuildRate, 11 | required this.worstFrameBuildRate, 12 | }); 13 | 14 | final Rating missedFrames; 15 | final Rating averageBuildRate; 16 | final Rating worstFrameBuildRate; 17 | 18 | Rating get overall { 19 | if (missedFrames == Rating.success && 20 | averageBuildRate == Rating.success && 21 | worstFrameBuildRate == Rating.success) { 22 | return Rating.success; 23 | } else if (missedFrames == Rating.failure || 24 | averageBuildRate == Rating.failure || 25 | worstFrameBuildRate == Rating.failure) { 26 | return Rating.failure; 27 | } 28 | return Rating.warning; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/printer.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:ansicolor/ansicolor.dart'; 4 | import 'package:barbecue/barbecue.dart'; 5 | import 'package:very_good_performance/src/models/models.dart'; 6 | 7 | class Printer { 8 | static void printScore( 9 | Report report, 10 | Score score, 11 | Configuration configuration, 12 | ) { 13 | final perfMetrics = configuration.performanceMetrics; 14 | final missedFrames = perfMetrics.missedFramesThreshold; 15 | final averageBuild = perfMetrics.averageFrameBuildRateThreshold; 16 | final worstBuild = perfMetrics.worstFrameBuildRateThreshold; 17 | stdout 18 | ..writeln( 19 | Table( 20 | tableStyle: const TableStyle(border: true), 21 | cellStyle: const CellStyle( 22 | borderBottom: true, 23 | borderRight: true, 24 | borderLeft: true, 25 | borderTop: true, 26 | alignment: TextAlignment.TopLeft, 27 | paddingRight: 1, 28 | paddingLeft: 2, 29 | ), 30 | header: const TableSection( 31 | rows: [ 32 | Row( 33 | cells: [ 34 | Cell(''), 35 | Cell('Missed Frames'), 36 | Cell('Average Frame Build Time ("ms")'), 37 | Cell('Worst Frame Build Time("ms")'), 38 | ], 39 | ), 40 | ], 41 | ), 42 | body: TableSection( 43 | rows: [ 44 | Row( 45 | cells: [ 46 | const Cell('Result'), 47 | Cell( 48 | score.missedFrames.colorize( 49 | '${report.missedFrameBuildBudgetCount}', 50 | ), 51 | ), 52 | Cell( 53 | score.averageBuildRate.colorize( 54 | '${report.averageFrameBuildTimeMillis}', 55 | ), 56 | ), 57 | Cell( 58 | score.worstFrameBuildRate.colorize( 59 | '${report.worstFrameBuildTimeMillis}', 60 | ), 61 | ), 62 | ], 63 | ), 64 | Row( 65 | cells: [ 66 | const Cell('Warning-Error Range'), 67 | Cell( 68 | '${missedFrames.warning} - ' 69 | '${missedFrames.error}', 70 | ), 71 | Cell( 72 | '${averageBuild.warningTimeInMilliseconds} - ' 73 | '${averageBuild.errorTimeInMilliseconds}', 74 | ), 75 | Cell( 76 | '${worstBuild.warningTimeInMilliseconds} - ' 77 | '${worstBuild.errorTimeInMilliseconds}', 78 | ), 79 | ], 80 | ), 81 | ], 82 | ), 83 | ).render(), 84 | ) 85 | ..writeln(score.overall.explanation); 86 | } 87 | 88 | static void printReportLocation(Configuration configuration, String name) { 89 | final current = Directory.current.path; 90 | final message = ''' 91 | Two performance reports have been generated. They can be located at: 92 | * $current/${configuration.performaceReport.directory}/$name.timeline.json 93 | * $current/${configuration.performaceReport.directory}/$name.timeline_summary.json 94 | '''; 95 | stdout.writeln(message); 96 | } 97 | } 98 | 99 | extension on Rating { 100 | String colorize(String message) { 101 | ansiColorDisabled = false; 102 | switch (this) { 103 | case Rating.success: 104 | final pen = AnsiPen()..green(bold: true); 105 | return pen(message); 106 | case Rating.warning: 107 | final pen = AnsiPen()..yellow(bold: true); 108 | return pen(message); 109 | case Rating.failure: 110 | final pen = AnsiPen()..red(bold: true); 111 | return pen(message); 112 | } 113 | } 114 | 115 | String get explanation { 116 | ansiColorDisabled = false; 117 | switch (this) { 118 | case Rating.success: 119 | final pen = AnsiPen()..green(bold: true); 120 | return pen('Very Good! Your application is performing well!'); 121 | case Rating.warning: 122 | final pen = AnsiPen()..yellow(bold: true); 123 | return pen( 124 | ''' 125 | Heads up! Your application might be starting to experience some degradation in 126 | its performance. You might want to consider launching an investigation to 127 | understand what components of your application are consuming more resources''', 128 | ); 129 | case Rating.failure: 130 | final pen = AnsiPen()..red(bold: true); 131 | return pen('Error! Your application is not performing well!'); 132 | } 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /lib/src/scorer.dart: -------------------------------------------------------------------------------- 1 | import 'package:very_good_performance/src/models/models.dart'; 2 | 3 | class Scorer { 4 | static Score score(Report report, Configuration configuration) { 5 | final perfMetrics = configuration.performanceMetrics; 6 | return Score( 7 | missedFrames: _rating( 8 | value: report.missedFrameBuildBudgetCount, 9 | warning: perfMetrics.missedFramesThreshold.warning, 10 | error: perfMetrics.missedFramesThreshold.error, 11 | ), 12 | averageBuildRate: _rating( 13 | value: report.averageFrameBuildTimeMillis, 14 | warning: perfMetrics 15 | .averageFrameBuildRateThreshold.warningTimeInMilliseconds, 16 | error: 17 | perfMetrics.averageFrameBuildRateThreshold.errorTimeInMilliseconds, 18 | ), 19 | worstFrameBuildRate: _rating( 20 | value: report.worstFrameBuildTimeMillis, 21 | warning: 22 | perfMetrics.worstFrameBuildRateThreshold.warningTimeInMilliseconds, 23 | error: perfMetrics.worstFrameBuildRateThreshold.errorTimeInMilliseconds, 24 | ), 25 | ); 26 | } 27 | 28 | static Rating _rating({ 29 | required num value, 30 | required num warning, 31 | required num error, 32 | }) { 33 | if (value < warning) { 34 | return Rating.success; 35 | } else if (value >= warning && value < error) { 36 | return Rating.warning; 37 | } 38 | return Rating.failure; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/src/very_good_performance.dart: -------------------------------------------------------------------------------- 1 | library very_good_performance; 2 | 3 | import 'dart:io'; 4 | 5 | import 'package:flutter_driver/flutter_driver.dart'; 6 | import 'package:very_good_performance/src/models/models.dart'; 7 | import 'package:very_good_performance/src/printer.dart'; 8 | import 'package:very_good_performance/src/scorer.dart'; 9 | 10 | extension VeryGoodPerformance on FlutterDriver { 11 | /// It will create two performance reports with the given [reportName]: 12 | /// * [reportName].timeline.json 13 | /// * [reportName].timeline_summary.json 14 | /// 15 | /// At the same time, it will also print on the `stdout` some performance 16 | /// information (missed frames, average build time and worst build time). 17 | /// 18 | /// It will terminate with a status code of zero if no performance issues were 19 | /// found. Otherwise, it will look at your `very_good_performance.yaml` 20 | /// configuration to determine which status code should be used. 21 | Future capturePerformanceReport({ 22 | required String reportName, 23 | required Future Function() action, 24 | }) async { 25 | final configuration = _configuration; 26 | final timeline = await traceAction(action); 27 | final summary = TimelineSummary.summarize(timeline); 28 | await summary.writeTimelineToFile( 29 | reportName, 30 | destinationDirectory: configuration.performaceReport.directory, 31 | pretty: true, 32 | ); 33 | final report = Report.fromJson(summary.summaryJson); 34 | final score = Scorer.score(report, configuration); 35 | Printer.printScore(report, score, configuration); 36 | Printer.printReportLocation(configuration, reportName); 37 | score.statusCode(configuration.integrationTestExpectations); 38 | } 39 | 40 | Configuration get _configuration { 41 | final stringYaml = File('very_good_performance.yaml').readAsStringSync(); 42 | return Configuration.fromString(stringYaml); 43 | } 44 | } 45 | 46 | extension on Score { 47 | void statusCode(IntegrationTestExpectations expectations) { 48 | switch (overall) { 49 | case Rating.success: 50 | return; 51 | case Rating.warning: 52 | if (expectations.shouldFailBuildOnWarning) { 53 | throw PerformanceException(); 54 | } 55 | return; 56 | case Rating.failure: 57 | if (expectations.shouldFailBuildOnWarning) { 58 | throw PerformanceException(); 59 | } 60 | return; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/very_good_performance.dart: -------------------------------------------------------------------------------- 1 | library very_good_performance; 2 | 3 | export 'src/very_good_performance.dart'; 4 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: very_good_performance 2 | description: Utility on top of the Flutter Driver API that facilitates measuring the performance of your app in an automated way 3 | version: 0.0.4 4 | homepage: https://github.com/VeryGoodOpenSource/very_good_performance 5 | 6 | environment: 7 | sdk: ">=2.18.0 <3.0.0" 8 | flutter: ">=3.3.0" 9 | 10 | dependencies: 11 | ansicolor: ^2.0.1 12 | barbecue: ^0.4.0 13 | checked_yaml: ^2.0.1 14 | flutter_driver: 15 | sdk: flutter 16 | flutter_test: 17 | sdk: flutter 18 | json_annotation: ^4.7.0 19 | yaml: ^3.1.1 20 | 21 | dev_dependencies: 22 | build_runner: ^2.3.0 23 | json_serializable: ^6.5.1 24 | mocktail: ^0.3.0 25 | very_good_analysis: ^3.1.0 26 | -------------------------------------------------------------------------------- /test/fixtures/fixtures.dart: -------------------------------------------------------------------------------- 1 | export 'timeline/error_report.dart'; 2 | export 'timeline/success_report.dart'; 3 | export 'timeline/warning_report.dart'; 4 | -------------------------------------------------------------------------------- /test/fixtures/timeline/error_report.dart: -------------------------------------------------------------------------------- 1 | const errorReportJson = { 2 | 'traceEvents': [ 3 | { 4 | 'name': 'Frame', 5 | 'cat': 'test category', 6 | 'ph': 'B', 7 | 'pid': 123, 8 | 'tid': 234, 9 | 'dur': 345, 10 | 'tdur': 245, 11 | 'ts': 456, 12 | 'tts': 567, 13 | 'args': { 14 | 'arg1': true, 15 | }, 16 | }, 17 | { 18 | 'name': 'Frame', 19 | 'cat': 'test category 2', 20 | 'ph': 'E', 21 | 'pid': 124, 22 | 'tid': 52490, 23 | 'dur': 53600, 24 | 'tdur': 52610, 25 | 'ts': 54710, 26 | 'tts': 55820, 27 | 'args': { 28 | 'arg1': true, 29 | }, 30 | }, 31 | { 32 | 'name': 'GPURasterizer::Draw', 33 | 'cat': 'test category', 34 | 'ph': 'B', 35 | 'pid': 123, 36 | 'tid': 234, 37 | 'dur': 345, 38 | 'tdur': 245, 39 | 'ts': 456, 40 | 'tts': 567, 41 | 'args': { 42 | 'arg1': true, 43 | }, 44 | }, 45 | { 46 | 'name': 'GPURasterizer::Draw', 47 | 'cat': 'test category 2', 48 | 'ph': 'E', 49 | 'pid': 124, 50 | 'tid': 235, 51 | 'dur': 346, 52 | 'tdur': 247, 53 | 'ts': 457, 54 | 'tts': 568, 55 | 'args': { 56 | 'arg1': true, 57 | }, 58 | }, 59 | ], 60 | }; 61 | -------------------------------------------------------------------------------- /test/fixtures/timeline/success_report.dart: -------------------------------------------------------------------------------- 1 | const successReportJson = { 2 | 'traceEvents': [ 3 | { 4 | 'name': 'Frame', 5 | 'cat': 'test category', 6 | 'ph': 'B', 7 | 'pid': 123, 8 | 'tid': 234, 9 | 'dur': 345, 10 | 'tdur': 245, 11 | 'ts': 456, 12 | 'tts': 567, 13 | 'args': { 14 | 'arg1': true, 15 | }, 16 | }, 17 | { 18 | 'name': 'Frame', 19 | 'cat': 'test category 2', 20 | 'ph': 'E', 21 | 'pid': 124, 22 | 'tid': 235, 23 | 'dur': 346, 24 | 'tdur': 247, 25 | 'ts': 457, 26 | 'tts': 568, 27 | 'args': { 28 | 'arg1': true, 29 | }, 30 | }, 31 | { 32 | 'name': 'GPURasterizer::Draw', 33 | 'cat': 'test category', 34 | 'ph': 'B', 35 | 'pid': 123, 36 | 'tid': 234, 37 | 'dur': 345, 38 | 'tdur': 245, 39 | 'ts': 456, 40 | 'tts': 567, 41 | 'args': { 42 | 'arg1': true, 43 | }, 44 | }, 45 | { 46 | 'name': 'GPURasterizer::Draw', 47 | 'cat': 'test category 2', 48 | 'ph': 'E', 49 | 'pid': 124, 50 | 'tid': 235, 51 | 'dur': 346, 52 | 'tdur': 247, 53 | 'ts': 457, 54 | 'tts': 568, 55 | 'args': { 56 | 'arg1': true, 57 | }, 58 | }, 59 | ], 60 | }; 61 | -------------------------------------------------------------------------------- /test/fixtures/timeline/warning_report.dart: -------------------------------------------------------------------------------- 1 | const warningReportJson = { 2 | 'traceEvents': [ 3 | { 4 | 'name': 'Frame', 5 | 'cat': 'test category', 6 | 'ph': 'B', 7 | 'pid': 123, 8 | 'tid': 234, 9 | 'dur': 345, 10 | 'tdur': 245, 11 | 'ts': 456, 12 | 'tts': 567, 13 | 'args': { 14 | 'arg1': true, 15 | }, 16 | }, 17 | { 18 | 'name': 'Frame', 19 | 'cat': 'test category 2', 20 | 'ph': 'E', 21 | 'pid': 124, 22 | 'tid': 12490, 23 | 'dur': 13600, 24 | 'tdur': 12610, 25 | 'ts': 14710, 26 | 'tts': 15820, 27 | 'args': { 28 | 'arg1': true, 29 | }, 30 | }, 31 | { 32 | 'name': 'GPURasterizer::Draw', 33 | 'cat': 'test category', 34 | 'ph': 'B', 35 | 'pid': 123, 36 | 'tid': 234, 37 | 'dur': 345, 38 | 'tdur': 245, 39 | 'ts': 456, 40 | 'tts': 567, 41 | 'args': { 42 | 'arg1': true, 43 | }, 44 | }, 45 | { 46 | 'name': 'GPURasterizer::Draw', 47 | 'cat': 'test category 2', 48 | 'ph': 'E', 49 | 'pid': 124, 50 | 'tid': 235, 51 | 'dur': 346, 52 | 'tdur': 247, 53 | 'ts': 457, 54 | 'tts': 568, 55 | 'args': { 56 | 'arg1': true, 57 | }, 58 | }, 59 | ], 60 | }; 61 | -------------------------------------------------------------------------------- /test/fixtures/very_good_performance.yaml: -------------------------------------------------------------------------------- 1 | performance_report: 2 | directory: test/fixtures/tmp_reports 3 | integration_test_expectations: 4 | should_fail_build_on_warning: true 5 | should_fail_build_on_error: true 6 | performance_metrics: 7 | missed_frames_threshold: 8 | warning: 5 9 | error: 10 10 | average_frame_build_rate_threshold: 11 | warning_time_in_milliseconds: 14.0 12 | error_time_in_milliseconds: 16.0 13 | worst_frame_build_rate_threshold: 14 | warning_time_in_milliseconds: 14.0 15 | error_time_in_milliseconds: 16.0 16 | -------------------------------------------------------------------------------- /test/very_good_performance_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter_driver/flutter_driver.dart'; 4 | import 'package:flutter_test/flutter_test.dart'; 5 | import 'package:mocktail/mocktail.dart'; 6 | import 'package:very_good_performance/src/models/models.dart'; 7 | import 'package:very_good_performance/very_good_performance.dart'; 8 | 9 | import 'fixtures/fixtures.dart'; 10 | 11 | class MockFlutterDriver extends Mock implements FlutterDriver {} 12 | 13 | void main() { 14 | late final FlutterDriver flutterDriver; 15 | final tempReports = '${Directory.current.path}/test/fixtures/tmp_reports'; 16 | final tempFile = '${Directory.current.path}/very_good_performance.yaml'; 17 | 18 | setUpAll(() async { 19 | await File('test/fixtures/very_good_performance.yaml').copy(tempFile); 20 | flutterDriver = MockFlutterDriver(); 21 | }); 22 | 23 | tearDownAll(() { 24 | if (File(tempFile).existsSync()) { 25 | File(tempFile).deleteSync(); 26 | } 27 | if (Directory(tempReports).existsSync()) { 28 | Directory(tempReports).deleteSync(recursive: true); 29 | } 30 | }); 31 | 32 | group('VeryGoodPerformance', () { 33 | test('measures a successful report', () async { 34 | final timeline = Timeline.fromJson(successReportJson); 35 | when(() => flutterDriver.traceAction(any())) 36 | .thenAnswer((_) async => timeline); 37 | try { 38 | await flutterDriver.capturePerformanceReport( 39 | reportName: 'success', 40 | action: () async => stdout.writeln('do nothing'), 41 | ); 42 | } catch (_) { 43 | fail('this should not throw'); 44 | } 45 | }); 46 | 47 | test('measures a warning report', () async { 48 | final timeline = Timeline.fromJson(warningReportJson); 49 | when( 50 | () => flutterDriver.traceAction(any()), 51 | ).thenAnswer((_) async => timeline); 52 | expect( 53 | () => flutterDriver.capturePerformanceReport( 54 | reportName: 'warning', 55 | action: () async => stdout.writeln('do nothing'), 56 | ), 57 | throwsA(isA()), 58 | ); 59 | }); 60 | 61 | test('measures an error report', () async { 62 | final timeline = Timeline.fromJson(errorReportJson); 63 | when( 64 | () => flutterDriver.traceAction(any()), 65 | ).thenAnswer((_) async => timeline); 66 | expect( 67 | () => flutterDriver.capturePerformanceReport( 68 | reportName: 'warning', 69 | action: () async => stdout.writeln('do nothing'), 70 | ), 71 | throwsA(isA()), 72 | ); 73 | }); 74 | }); 75 | } 76 | --------------------------------------------------------------------------------