├── .flutter-plugins ├── .flutter-plugins-dependencies ├── .github └── workflows │ └── main.yml ├── .gitignore ├── .metadata ├── .vscode └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── bin └── icons.dart ├── build.yaml ├── 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 ├── bin │ └── server.dart ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── example.dart │ ├── example.json │ ├── main.dart │ └── ssr_example.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 │ ├── Podfile │ ├── Podfile.lock │ ├── 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 ├── web │ ├── favicon.png │ ├── icons │ │ ├── Icon-192.png │ │ ├── Icon-512.png │ │ ├── Icon-maskable-192.png │ │ └── Icon-maskable-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 │ ├── runner.exe.manifest │ ├── utils.cpp │ ├── utils.h │ ├── win32_window.cpp │ └── win32_window.h ├── lib ├── flutter.dart ├── flutter_json_widgets.dart ├── transformers │ └── flutter_widget.dart └── widgets │ ├── alignment.dart │ ├── alignment.freezed.dart │ ├── alignment.g.dart │ ├── border_radius.dart │ ├── border_radius.freezed.dart │ ├── border_radius.g.dart │ ├── border_side.dart │ ├── border_side.freezed.dart │ ├── border_side.g.dart │ ├── box_constraints.dart │ ├── box_constraints.freezed.dart │ ├── box_constraints.g.dart │ ├── callback.dart │ ├── callback.freezed.dart │ ├── callback.g.dart │ ├── color.dart │ ├── color.freezed.dart │ ├── color.g.dart │ ├── color_filter.dart │ ├── color_filter.freezed.dart │ ├── color_filter.g.dart │ ├── color_scheme.dart │ ├── color_scheme.freezed.dart │ ├── color_scheme.g.dart │ ├── colors.dart │ ├── curves.dart │ ├── curves.freezed.dart │ ├── curves.g.dart │ ├── data_cell.dart │ ├── data_cell.freezed.dart │ ├── data_cell.g.dart │ ├── data_column.dart │ ├── data_column.freezed.dart │ ├── data_column.g.dart │ ├── data_row.dart │ ├── data_row.freezed.dart │ ├── data_row.g.dart │ ├── decoration.dart │ ├── decoration.freezed.dart │ ├── decoration.g.dart │ ├── decoration_image.dart │ ├── decoration_image.freezed.dart │ ├── decoration_image.g.dart │ ├── dropdown_menu_item.dart │ ├── dropdown_menu_item.freezed.dart │ ├── dropdown_menu_item.g.dart │ ├── edge_insets.dart │ ├── edge_insets.freezed.dart │ ├── edge_insets.g.dart │ ├── enums.dart │ ├── floating_action_button_location.dart │ ├── floating_action_button_location.freezed.dart │ ├── floating_action_button_location.g.dart │ ├── floating_label_alignment.dart │ ├── floating_label_alignment.freezed.dart │ ├── floating_label_alignment.g.dart │ ├── font_feature.dart │ ├── font_feature.freezed.dart │ ├── font_feature.g.dart │ ├── font_variation.dart │ ├── font_variation.freezed.dart │ ├── font_variation.g.dart │ ├── font_weight.dart │ ├── font_weight.freezed.dart │ ├── font_weight.g.dart │ ├── form_data.dart │ ├── form_data.freezed.dart │ ├── form_data.g.dart │ ├── gradient.dart │ ├── gradient.freezed.dart │ ├── gradient.g.dart │ ├── gradient_transform.dart │ ├── gradient_transform.freezed.dart │ ├── gradient_transform.g.dart │ ├── icon_data.dart │ ├── icon_data.freezed.dart │ ├── icon_data.g.dart │ ├── icon_theme_data.dart │ ├── icon_theme_data.freezed.dart │ ├── icon_theme_data.g.dart │ ├── icons.dart │ ├── image_provider.dart │ ├── image_provider.freezed.dart │ ├── image_provider.g.dart │ ├── inline_span.dart │ ├── inline_span.freezed.dart │ ├── inline_span.g.dart │ ├── input_decoration.dart │ ├── input_decoration.freezed.dart │ ├── input_decoration.g.dart │ ├── key.dart │ ├── key.freezed.dart │ ├── key.g.dart │ ├── locale.dart │ ├── locale.freezed.dart │ ├── locale.g.dart │ ├── material_banner.dart │ ├── material_banner.freezed.dart │ ├── material_banner.g.dart │ ├── material_state_property.dart │ ├── material_state_property.freezed.dart │ ├── material_state_property.g.dart │ ├── matrix_4.dart │ ├── mouse_cursor.dart │ ├── mouse_cursor.freezed.dart │ ├── mouse_cursor.g.dart │ ├── navigation_rail_destination.dart │ ├── navigation_rail_destination.freezed.dart │ ├── navigation_rail_destination.g.dart │ ├── network_request.dart │ ├── network_request.freezed.dart │ ├── network_request.g.dart │ ├── offset.dart │ ├── offset.freezed.dart │ ├── offset.g.dart │ ├── paint.dart │ ├── paint.freezed.dart │ ├── paint.g.dart │ ├── popup_menu_entry.dart │ ├── popup_menu_entry.freezed.dart │ ├── popup_menu_entry.g.dart │ ├── preferred_size_widget.dart │ ├── preferred_size_widget.freezed.dart │ ├── preferred_size_widget.g.dart │ ├── radius.dart │ ├── radius.freezed.dart │ ├── radius.g.dart │ ├── rect.dart │ ├── rect.freezed.dart │ ├── rect.g.dart │ ├── scroll_physics.dart │ ├── scroll_physics.freezed.dart │ ├── scroll_physics.g.dart │ ├── shadow.dart │ ├── shadow.freezed.dart │ ├── shadow.g.dart │ ├── shape_border.dart │ ├── shape_border.freezed.dart │ ├── shape_border.g.dart │ ├── size.dart │ ├── size.freezed.dart │ ├── size.g.dart │ ├── sliver.dart │ ├── sliver.freezed.dart │ ├── sliver.g.dart │ ├── sliver_child_delegate.dart │ ├── sliver_child_delegate.freezed.dart │ ├── sliver_child_delegate.g.dart │ ├── sliver_grid_delegate.dart │ ├── sliver_grid_delegate.freezed.dart │ ├── sliver_grid_delegate.g.dart │ ├── snack_bar.dart │ ├── snack_bar.freezed.dart │ ├── snack_bar.g.dart │ ├── snack_bar_action.dart │ ├── snack_bar_action.freezed.dart │ ├── snack_bar_action.g.dart │ ├── strut_style.dart │ ├── strut_style.freezed.dart │ ├── strut_style.g.dart │ ├── table_border.dart │ ├── table_border.freezed.dart │ ├── table_border.g.dart │ ├── table_column_width.dart │ ├── table_column_width.freezed.dart │ ├── table_column_width.g.dart │ ├── table_row.dart │ ├── table_row.freezed.dart │ ├── table_row.g.dart │ ├── text_align_vertical.dart │ ├── text_align_vertical.freezed.dart │ ├── text_align_vertical.g.dart │ ├── text_decoration.dart │ ├── text_decoration.freezed.dart │ ├── text_decoration.g.dart │ ├── text_height_behavior.dart │ ├── text_height_behavior.freezed.dart │ ├── text_height_behavior.g.dart │ ├── text_input_formatter.dart │ ├── text_input_formatter.freezed.dart │ ├── text_input_formatter.g.dart │ ├── text_input_type.dart │ ├── text_input_type.freezed.dart │ ├── text_input_type.g.dart │ ├── text_style.dart │ ├── text_style.freezed.dart │ ├── text_style.g.dart │ ├── text_theme.dart │ ├── text_theme.freezed.dart │ ├── text_theme.g.dart │ ├── theme_data.dart │ ├── theme_data.freezed.dart │ ├── theme_data.g.dart │ ├── visual_density.dart │ ├── visual_density.freezed.dart │ ├── visual_density.g.dart │ ├── widget.dart │ ├── widget.freezed.dart │ └── widget.g.dart └── pubspec.yaml /.flutter-plugins: -------------------------------------------------------------------------------- 1 | # This is a generated file; do not edit or check into version control. 2 | url_launcher=/Users/rodydavis/.pub-cache/hosted/pub.dev/url_launcher-6.1.7/ 3 | url_launcher_android=/Users/rodydavis/.pub-cache/hosted/pub.dev/url_launcher_android-6.0.22/ 4 | url_launcher_ios=/Users/rodydavis/.pub-cache/hosted/pub.dev/url_launcher_ios-6.0.17/ 5 | url_launcher_linux=/Users/rodydavis/.pub-cache/hosted/pub.dev/url_launcher_linux-3.0.1/ 6 | url_launcher_macos=/Users/rodydavis/.pub-cache/hosted/pub.dev/url_launcher_macos-3.0.1/ 7 | url_launcher_web=/Users/rodydavis/.pub-cache/hosted/pub.dev/url_launcher_web-2.0.13/ 8 | url_launcher_windows=/Users/rodydavis/.pub-cache/hosted/pub.dev/url_launcher_windows-3.0.1/ 9 | -------------------------------------------------------------------------------- /.flutter-plugins-dependencies: -------------------------------------------------------------------------------- 1 | {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"url_launcher_ios","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/url_launcher_ios-6.0.17/","native_build":true,"dependencies":[]}],"android":[{"name":"url_launcher_android","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/url_launcher_android-6.0.22/","native_build":true,"dependencies":[]}],"macos":[{"name":"url_launcher_macos","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/url_launcher_macos-3.0.1/","native_build":true,"dependencies":[]}],"linux":[{"name":"url_launcher_linux","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/url_launcher_linux-3.0.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"url_launcher_windows","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/url_launcher_windows-3.0.1/","native_build":true,"dependencies":[]}],"web":[{"name":"url_launcher_web","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/url_launcher_web-2.0.13/","dependencies":[]}]},"dependencyGraph":[{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2023-01-06 00:51:27.387093","version":"3.7.0-14.0.pre.13"} -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: github pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | deploy: 10 | runs-on: ubuntu-18.04 11 | steps: 12 | - uses: actions/checkout@v2 13 | 14 | - name: Setup Flutter 15 | uses: subosito/flutter-action@v1 16 | with: 17 | channel: 'master' 18 | 19 | - name: Install 20 | run: | 21 | flutter config --enable-web 22 | flutter pub get 23 | 24 | - name: Build Example 25 | run: | 26 | cd example && 27 | flutter build web --no-tree-shake-icons --base-href=/flutter_json_widgets/ && 28 | cd .. 29 | 30 | - name: Setup Dart 31 | uses: dart-lang/setup-dart@v1.3 32 | 33 | - name: Build Docs 34 | run: dart doc -o example/build/web/docs 35 | 36 | - name: Deploy 37 | uses: peaceiris/actions-gh-pages@v3 38 | with: 39 | github_token: ${{ secrets.GITHUB_TOKEN }} 40 | publish_dir: ./example/build/web 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | .packages 30 | build/ 31 | 32 | example/lib/temp.dart -------------------------------------------------------------------------------- /.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: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 8 | channel: master 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "**/*.freezed.dart": true, 4 | "**/*.g.dart": true 5 | }, 6 | "cSpell.words": [ 7 | "codepoint" 8 | ] 9 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * Adding lots of core widgets 4 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | 6 | linter: 7 | rules: 8 | constant_identifier_names: false 9 | sort_child_properties_last: false 10 | no_leading_underscores_for_local_identifiers: false 11 | -------------------------------------------------------------------------------- /build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | builders: 4 | # freezed: 5 | # options: 6 | # union_key: runtime_type 7 | # union_value_case: snake 8 | json_serializable: 9 | options: 10 | include_if_null: false 11 | create_field_map: true 12 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /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. 5 | 6 | version: 7 | revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 8 | channel: master 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 17 | base_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 18 | - platform: android 19 | create_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 20 | base_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 21 | - platform: ios 22 | create_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 23 | base_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 24 | - platform: linux 25 | create_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 26 | base_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 27 | - platform: macos 28 | create_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 29 | base_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 30 | - platform: web 31 | create_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 32 | base_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 33 | - platform: windows 34 | create_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 35 | base_revision: 9024c9543b379e9ec822e19a83a9f1a8fe30c6cd 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) 13 | 14 | For help getting started with Flutter development, view the 15 | [online documentation](https://docs.flutter.dev/), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | 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 flutter.compileSdkVersion 30 | ndkVersion flutter.ndkVersion 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | kotlinOptions { 38 | jvmTarget = '1.8' 39 | } 40 | 41 | sourceSets { 42 | main.java.srcDirs += 'src/main/kotlin' 43 | } 44 | 45 | defaultConfig { 46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 47 | applicationId "com.example.example" 48 | // You can update the following values to match your application needs. 49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 50 | minSdkVersion flutter.minSdkVersion 51 | targetSdkVersion flutter.targetSdkVersion 52 | versionCode flutterVersionCode.toInteger() 53 | versionName flutterVersionName 54 | } 55 | 56 | buildTypes { 57 | release { 58 | // TODO: Add your own signing config for the release build. 59 | // Signing with the debug keys for now, so `flutter run --release` works. 60 | signingConfig signingConfigs.debug 61 | } 62 | } 63 | } 64 | 65 | flutter { 66 | source '../..' 67 | } 68 | 69 | dependencies { 70 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 71 | } 72 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.3.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /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/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '11.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /example/ios/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.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/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_json_widgets/flutter_json_widgets.dart'; 2 | 3 | class Example { 4 | Widget buildApp() { 5 | const sourceColor = Colors.blue; 6 | return MaterialApp( 7 | debugShowCheckedModeBanner: false, 8 | theme: const ThemeData( 9 | brightness: Brightness.light, 10 | colorScheme: ColorScheme.fromSeed( 11 | seedColor: sourceColor, 12 | brightness: Brightness.light, 13 | ), 14 | ), 15 | darkTheme: const ThemeData( 16 | brightness: Brightness.dark, 17 | colorScheme: ColorScheme.fromSeed( 18 | seedColor: sourceColor, 19 | brightness: Brightness.dark, 20 | ), 21 | ), 22 | themeMode: ThemeMode.light, 23 | initialRoute: '/', 24 | routes: { 25 | '/': buildHome(), 26 | '/settings': buildSettings(), 27 | }, 28 | ); 29 | } 30 | 31 | Widget buildHome() { 32 | return Scaffold( 33 | appBar: const AppBar( 34 | title: Text('Example'), 35 | actions: [ 36 | IconButton( 37 | tooltip: 'Show a Material Banner', 38 | onPressed: Callback.showMaterialBanner( 39 | MaterialBanner( 40 | content: Text('New Banner!'), 41 | actions: [ 42 | IconButton( 43 | onPressed: Callback.hideCurrentMaterialBanner(), 44 | icon: Icon(Icons.close), 45 | ), 46 | ], 47 | ), 48 | ), 49 | icon: Icon(Icons.info_outline), 50 | ), 51 | IconButton( 52 | tooltip: 'Navigate to settings', 53 | onPressed: Callback.navigatorPushNamed( 54 | '/settings', 55 | ), 56 | icon: Icon(Icons.settings), 57 | ), 58 | ], 59 | ), 60 | body: Container( 61 | color: const Color.background(), 62 | child: Center( 63 | child: Text( 64 | 'Material App', 65 | style: const TextStyle.displayMedium().copyWith( 66 | fontSize: 24, 67 | color: const Color.onBackground(), 68 | ), 69 | ), 70 | ), 71 | ), 72 | floatingActionButton: const FloatingActionButtonExtended( 73 | onPressed: Callback.showSnackBar( 74 | SnackBar( 75 | content: Text('Floating action button pressed'), 76 | ), 77 | ), 78 | label: Text('Show SnackBar'), 79 | icon: Icon(Icons.edit), 80 | ), 81 | ); 82 | } 83 | 84 | Widget buildSettings() { 85 | return const Scaffold( 86 | appBar: AppBar( 87 | title: Text('Settings'), 88 | centerTitle: false, 89 | ), 90 | ); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /example/lib/ssr_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_json_widgets/flutter.dart'; 3 | 4 | void main() { 5 | runApp(const MyApp()); 6 | } 7 | 8 | class MyApp extends StatelessWidget { 9 | const MyApp({super.key}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return MaterialApp( 14 | debugShowCheckedModeBanner: false, 15 | title: 'Flutter SSR Example', 16 | theme: ThemeData.light(useMaterial3: true), 17 | darkTheme: ThemeData.dark(useMaterial3: true), 18 | themeMode: ThemeMode.system, 19 | onGenerateRoute: (settings) => MaterialPageRoute( 20 | builder: (context) => const FlutterWidget.network( 21 | request: NetworkHttpRequest(url: 'http://localhost:8080/'), 22 | ), 23 | ), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /example/linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /example/linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /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 | #include 10 | 11 | void fl_register_plugins(FlPluginRegistry* registry) { 12 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 13 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 14 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 15 | } 16 | -------------------------------------------------------------------------------- /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 | url_launcher_linux 7 | ) 8 | 9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /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.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 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import url_launcher_macos 9 | 10 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 11 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 12 | } 13 | -------------------------------------------------------------------------------- /example/macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | end 35 | 36 | post_install do |installer| 37 | installer.pods_project.targets.each do |target| 38 | flutter_additional_macos_build_settings(target) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /example/macos/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FlutterMacOS (1.0.0) 3 | - url_launcher_macos (0.0.1): 4 | - FlutterMacOS 5 | 6 | DEPENDENCIES: 7 | - FlutterMacOS (from `Flutter/ephemeral`) 8 | - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) 9 | 10 | EXTERNAL SOURCES: 11 | FlutterMacOS: 12 | :path: Flutter/ephemeral 13 | url_launcher_macos: 14 | :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos 15 | 16 | SPEC CHECKSUMS: 17 | FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 18 | url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3 19 | 20 | PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 21 | 22 | COCOAPODS: 1.11.3 23 | -------------------------------------------------------------------------------- /example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/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 © 2022 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.client 10 | 11 | com.apple.security.network.server 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /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 | com.apple.security.network.client 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter project. 3 | 4 | publish_to: "none" 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=3.0.0-46.0.dev <4.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | cupertino_icons: ^1.0.2 16 | flutter_json_widgets: 17 | path: .. 18 | http: ^0.13.5 19 | 20 | dev_dependencies: 21 | flutter_test: 22 | sdk: flutter 23 | 24 | flutter_lints: ^2.0.0 25 | shelf: ^1.4.0 26 | shelf_router: ^1.1.3 27 | shelf_cors_headers: ^0.1.4 28 | 29 | flutter: 30 | uses-material-design: true 31 | 32 | scripts: 33 | server: dart bin/server.dart 34 | client: flutter run -t lib/ssr_example.dart -d chrome -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/example/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/example/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | example 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /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/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 | #include 10 | 11 | void RegisterPlugins(flutter::PluginRegistry* registry) { 12 | UrlLauncherWindowsRegisterWithRegistrar( 13 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 14 | } 15 | -------------------------------------------------------------------------------- /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 | url_launcher_windows 7 | ) 8 | 9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /example/windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /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(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | return true; 35 | } 36 | 37 | void FlutterWindow::OnDestroy() { 38 | if (flutter_controller_) { 39 | flutter_controller_ = nullptr; 40 | } 41 | 42 | Win32Window::OnDestroy(); 43 | } 44 | 45 | LRESULT 46 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 47 | WPARAM const wparam, 48 | LPARAM const lparam) noexcept { 49 | // Give Flutter, including plugins, an opportunity to handle window messages. 50 | if (flutter_controller_) { 51 | std::optional result = 52 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 53 | lparam); 54 | if (result) { 55 | return *result; 56 | } 57 | } 58 | 59 | switch (message) { 60 | case WM_FONTCHANGE: 61 | flutter_controller_->engine()->ReloadSystemFonts(); 62 | break; 63 | } 64 | 65 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 66 | } 67 | -------------------------------------------------------------------------------- /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 "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /example/windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"example", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /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/rodydavis/flutter_json_widgets/3bdfc7d349cbb83192c06a3a1c6d6799a19fcd85/example/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /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 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 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 | -------------------------------------------------------------------------------- /lib/flutter.dart: -------------------------------------------------------------------------------- 1 | /// Flutter compatible import. 2 | library flutter; 3 | 4 | export 'transformers/flutter_widget.dart'; 5 | export 'widgets/network_request.dart'; 6 | export 'widgets/form_data.dart'; 7 | -------------------------------------------------------------------------------- /lib/flutter_json_widgets.dart: -------------------------------------------------------------------------------- 1 | library flutter_json_widgets; 2 | 3 | export 'widgets/alignment.dart'; 4 | export 'widgets/border_radius.dart'; 5 | export 'widgets/border_side.dart'; 6 | export 'widgets/box_constraints.dart'; 7 | export 'widgets/color.dart'; 8 | export 'widgets/color_filter.dart'; 9 | export 'widgets/color_scheme.dart'; 10 | export 'widgets/curves.dart'; 11 | export 'widgets/decoration.dart'; 12 | export 'widgets/decoration_image.dart'; 13 | export 'widgets/edge_insets.dart'; 14 | export 'widgets/floating_action_button_location.dart'; 15 | export 'widgets/font_feature.dart'; 16 | export 'widgets/font_variation.dart'; 17 | export 'widgets/font_weight.dart'; 18 | export 'widgets/gradient.dart'; 19 | export 'widgets/gradient_transform.dart'; 20 | export 'widgets/image_provider.dart'; 21 | export 'widgets/key.dart'; 22 | export 'widgets/locale.dart'; 23 | export 'widgets/matrix_4.dart'; 24 | export 'widgets/offset.dart'; 25 | export 'widgets/paint.dart'; 26 | export 'widgets/radius.dart'; 27 | export 'widgets/rect.dart'; 28 | export 'widgets/shadow.dart'; 29 | export 'widgets/shape_border.dart'; 30 | export 'widgets/size.dart'; 31 | export 'widgets/strut_style.dart'; 32 | export 'widgets/text_decoration.dart'; 33 | export 'widgets/text_height_behavior.dart'; 34 | export 'widgets/text_style.dart'; 35 | export 'widgets/text_theme.dart'; 36 | export 'widgets/theme_data.dart'; 37 | export 'widgets/visual_density.dart'; 38 | export 'widgets/widget.dart'; 39 | export 'widgets/icon_data.dart'; 40 | export 'widgets/callback.dart'; 41 | export 'widgets/snack_bar_action.dart'; 42 | export 'widgets/preferred_size_widget.dart'; 43 | export 'widgets/snack_bar.dart'; 44 | export 'widgets/scroll_physics.dart'; 45 | export 'widgets/material_banner.dart'; 46 | export 'widgets/enums.dart'; 47 | export 'widgets/icons.dart'; 48 | export 'widgets/colors.dart'; 49 | export 'widgets/mouse_cursor.dart'; 50 | export 'widgets/sliver_grid_delegate.dart'; 51 | export 'widgets/sliver_child_delegate.dart'; 52 | export 'widgets/sliver.dart'; 53 | export 'widgets/table_row.dart'; 54 | export 'widgets/table_border.dart'; 55 | export 'widgets/table_column_width.dart'; 56 | export 'widgets/material_state_property.dart'; 57 | export 'widgets/data_cell.dart'; 58 | export 'widgets/data_row.dart'; 59 | export 'widgets/data_column.dart'; 60 | export 'widgets/network_request.dart'; 61 | export 'widgets/form_data.dart'; 62 | export 'widgets/icon_theme_data.dart'; 63 | export 'widgets/navigation_rail_destination.dart'; 64 | export 'widgets/inline_span.dart'; 65 | export 'widgets/input_decoration.dart'; 66 | export 'widgets/floating_label_alignment.dart'; 67 | export 'widgets/text_align_vertical.dart'; 68 | export 'widgets/text_input_type.dart'; 69 | export 'widgets/text_input_formatter.dart'; 70 | export 'widgets/dropdown_menu_item.dart'; 71 | export 'widgets/popup_menu_entry.dart'; 72 | -------------------------------------------------------------------------------- /lib/widgets/alignment.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [Alignment](https://api.flutter.dev/flutter/painting/Alignment-class.html) class in the Flutter SDK. 2 | /// 3 | /// This will map to the [AlignmentDirectional](https://api.flutter.dev/flutter/painting/AlignmentDirectional-class.html) class in some widgets. 4 | /// 5 | /// This is based on the [AlignmentGeometry](https://api.flutter.dev/flutter/painting/AlignmentGeometry-class.html) class and simplifies the API. 6 | library alignment; 7 | 8 | import 'package:freezed_annotation/freezed_annotation.dart'; 9 | 10 | part 'alignment.freezed.dart'; 11 | part 'alignment.g.dart'; 12 | 13 | @freezed 14 | class Alignment with _$Alignment { 15 | const factory Alignment(double x, double y) = _Alignment; 16 | static const Alignment topLeft = Alignment(-1.0, -1.0); 17 | static const Alignment topCenter = Alignment(0.0, -1.0); 18 | static const Alignment topRight = Alignment(1.0, -1.0); 19 | static const Alignment centerLeft = Alignment(-1.0, 0.0); 20 | static const Alignment center = Alignment(0.0, 0.0); 21 | static const Alignment centerRight = Alignment(1.0, 0.0); 22 | static const Alignment bottomLeft = Alignment(-1.0, 1.0); 23 | static const Alignment bottomCenter = Alignment(0.0, 1.0); 24 | static const Alignment bottomRight = Alignment(1.0, 1.0); 25 | 26 | factory Alignment.fromJson(Map json) => 27 | _$AlignmentFromJson(json); 28 | } 29 | -------------------------------------------------------------------------------- /lib/widgets/alignment.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of alignment; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_Alignment _$$_AlignmentFromJson(Map json) => _$_Alignment( 10 | (json['x'] as num).toDouble(), 11 | (json['y'] as num).toDouble(), 12 | ); 13 | 14 | const _$$_AlignmentFieldMap = { 15 | 'x': 'x', 16 | 'y': 'y', 17 | }; 18 | 19 | Map _$$_AlignmentToJson(_$_Alignment instance) => 20 | { 21 | 'x': instance.x, 22 | 'y': instance.y, 23 | }; 24 | -------------------------------------------------------------------------------- /lib/widgets/border_radius.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [BorderRadius](https://api.flutter.dev/flutter/painting/BorderRadius-class.html) class in the Flutter SDK. 2 | library border_radius; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'radius.dart'; 7 | 8 | part 'border_radius.freezed.dart'; 9 | part 'border_radius.g.dart'; 10 | 11 | @freezed 12 | class BorderRadius with _$BorderRadius { 13 | const factory BorderRadius.all(Radius radius) = BorderRadiusAll; 14 | 15 | const factory BorderRadius.circular(double radius) = BorderRadiusCircular; 16 | 17 | const factory BorderRadius.vertical({ 18 | @Default(Radius.zero) Radius top, 19 | @Default(Radius.zero) Radius bottom, 20 | }) = BorderRadiusVertical; 21 | 22 | const factory BorderRadius.horizontal({ 23 | @Default(Radius.zero) Radius left, 24 | @Default(Radius.zero) Radius right, 25 | }) = BorderRadiusHorizontal; 26 | 27 | const factory BorderRadius.only({ 28 | Radius? topLeft, 29 | Radius? topRight, 30 | Radius? bottomLeft, 31 | Radius? bottomRight, 32 | }) = BorderRadiusOnly; 33 | 34 | static const BorderRadius zero = BorderRadius.all(Radius.zero); 35 | 36 | factory BorderRadius.fromJson(Map json) => 37 | _$BorderRadiusFromJson(json); 38 | } 39 | -------------------------------------------------------------------------------- /lib/widgets/border_side.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [BorderSide](https://api.flutter.dev/flutter/painting/BorderSide-class.html) class in the Flutter SDK. 2 | library border_side; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'color.dart'; 7 | import 'enums.dart'; 8 | 9 | part 'border_side.freezed.dart'; 10 | part 'border_side.g.dart'; 11 | 12 | @freezed 13 | class BorderSide with _$BorderSide { 14 | const factory BorderSide({ 15 | @Default(Color(0xFF000000)) Color color, 16 | @Default(1.0) double width, 17 | @Default(BorderStyle.solid) BorderStyle style, 18 | @Default(-1.0) double strokeAlign, 19 | }) = _BorderSide; 20 | 21 | static const BorderSide none = BorderSide( 22 | color: Color(0x00000000), 23 | width: 0.0, 24 | style: BorderStyle.none, 25 | ); 26 | 27 | factory BorderSide.fromJson(Map json) => 28 | _$BorderSideFromJson(json); 29 | } 30 | -------------------------------------------------------------------------------- /lib/widgets/border_side.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of border_side; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_BorderSide _$$_BorderSideFromJson(Map json) => 10 | _$_BorderSide( 11 | color: json['color'] == null 12 | ? const Color(0xFF000000) 13 | : Color.fromJson(json['color'] as Map), 14 | width: (json['width'] as num?)?.toDouble() ?? 1.0, 15 | style: $enumDecodeNullable(_$BorderStyleEnumMap, json['style']) ?? 16 | BorderStyle.solid, 17 | strokeAlign: (json['strokeAlign'] as num?)?.toDouble() ?? -1.0, 18 | ); 19 | 20 | const _$$_BorderSideFieldMap = { 21 | 'color': 'color', 22 | 'width': 'width', 23 | 'style': 'style', 24 | 'strokeAlign': 'strokeAlign', 25 | }; 26 | 27 | Map _$$_BorderSideToJson(_$_BorderSide instance) => 28 | { 29 | 'color': instance.color, 30 | 'width': instance.width, 31 | 'style': _$BorderStyleEnumMap[instance.style]!, 32 | 'strokeAlign': instance.strokeAlign, 33 | }; 34 | 35 | const _$BorderStyleEnumMap = { 36 | BorderStyle.none: 'none', 37 | BorderStyle.solid: 'solid', 38 | }; 39 | -------------------------------------------------------------------------------- /lib/widgets/box_constraints.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [BoxConstraints](https://api.flutter.dev/flutter/rendering/BoxConstraints-class.html) class in the Flutter SDK. 2 | library box_constraints; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'box_constraints.freezed.dart'; 7 | part 'box_constraints.g.dart'; 8 | 9 | @freezed 10 | class BoxConstraints with _$BoxConstraints { 11 | const factory BoxConstraints({ 12 | @Default(0.0) double minWidth, 13 | @Default(double.infinity) double maxWidth, 14 | @Default(0.0) double minHeight, 15 | @Default(double.infinity) double maxHeight, 16 | }) = _BoxConstraints; 17 | 18 | factory BoxConstraints.fromJson(Map json) => 19 | _$BoxConstraintsFromJson(json); 20 | } 21 | -------------------------------------------------------------------------------- /lib/widgets/box_constraints.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of box_constraints; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_BoxConstraints _$$_BoxConstraintsFromJson(Map json) => 10 | _$_BoxConstraints( 11 | minWidth: (json['minWidth'] as num?)?.toDouble() ?? 0.0, 12 | maxWidth: (json['maxWidth'] as num?)?.toDouble() ?? double.infinity, 13 | minHeight: (json['minHeight'] as num?)?.toDouble() ?? 0.0, 14 | maxHeight: (json['maxHeight'] as num?)?.toDouble() ?? double.infinity, 15 | ); 16 | 17 | const _$$_BoxConstraintsFieldMap = { 18 | 'minWidth': 'minWidth', 19 | 'maxWidth': 'maxWidth', 20 | 'minHeight': 'minHeight', 21 | 'maxHeight': 'maxHeight', 22 | }; 23 | 24 | Map _$$_BoxConstraintsToJson(_$_BoxConstraints instance) => 25 | { 26 | 'minWidth': instance.minWidth, 27 | 'maxWidth': instance.maxWidth, 28 | 'minHeight': instance.minHeight, 29 | 'maxHeight': instance.maxHeight, 30 | }; 31 | -------------------------------------------------------------------------------- /lib/widgets/callback.dart: -------------------------------------------------------------------------------- 1 | /// Since JSON does not support functions, we need to use a custom class to map intents to callbacks. 2 | /// 3 | /// These classes do not depend on Flutter and can be extended to work with whichever runtime you are using. 4 | library callback; 5 | 6 | import 'package:freezed_annotation/freezed_annotation.dart'; 7 | 8 | import 'enums.dart'; 9 | import 'material_banner.dart'; 10 | import 'network_request.dart'; 11 | import 'snack_bar.dart'; 12 | 13 | part 'callback.freezed.dart'; 14 | part 'callback.g.dart'; 15 | 16 | @freezed 17 | class Callback with _$Callback { 18 | const factory Callback.intSelection({ 19 | required Map values, 20 | }) = IntSelectionCallback; 21 | 22 | const factory Callback.boolSelection({ 23 | required Callback trueCallback, 24 | required Callback falseCallback, 25 | }) = BoolSelectionCallback; 26 | 27 | const factory Callback.navigatorPushNamed( 28 | String value, { 29 | Map? arguments, 30 | }) = NavigationPushNamedCallback; 31 | 32 | const factory Callback.navigatorPop({ 33 | Object? value, 34 | }) = NavigationPopCallback; 35 | 36 | const factory Callback.launchUrl( 37 | String url, { 38 | String? path, 39 | Map? params, 40 | }) = UrlCallback; 41 | 42 | const factory Callback.copyClipboard( 43 | String text, { 44 | Callback? callback, 45 | }) = CopyClipboardCallback; 46 | 47 | const factory Callback.networkRequest( 48 | NetworkRequest request, { 49 | Callback? callback, 50 | }) = HttpRequestCallback; 51 | 52 | const factory Callback.showSnackBar(SnackBar snackBar) = ShowSnackBarCallback; 53 | 54 | const factory Callback.hideCurrentSnackBar({ 55 | @Default(SnackBarClosedReason.hide) SnackBarClosedReason reason, 56 | }) = HideCurrentSnackBarCallback; 57 | 58 | const factory Callback.removeCurrentSnackBar({ 59 | @Default(SnackBarClosedReason.remove) SnackBarClosedReason reason, 60 | }) = RemoveCurrentSnackBarCallback; 61 | 62 | const factory Callback.clearMaterialBanners() = ClearMaterialBannersCallback; 63 | 64 | const factory Callback.hideCurrentMaterialBanner( 65 | {@Default(MaterialBannerClosedReason.hide) 66 | MaterialBannerClosedReason reason}) = 67 | HideCurrentMaterialBannerCallback; 68 | 69 | const factory Callback.removeCurrentMaterialBanner( 70 | {@Default(MaterialBannerClosedReason.remove) 71 | MaterialBannerClosedReason reason}) = 72 | RemoveCurrentMaterialBannerCallback; 73 | 74 | const factory Callback.showMaterialBanner(MaterialBanner materialBanner) = 75 | ShowMaterialBannerCallback; 76 | 77 | const factory Callback.empty() = EmptyCallback; 78 | 79 | const factory Callback.reload() = ReloadCallback; 80 | 81 | factory Callback.fromJson(Map json) => 82 | _$CallbackFromJson(json); 83 | } 84 | -------------------------------------------------------------------------------- /lib/widgets/color_filter.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [ColorFilter](https://api.flutter.dev/flutter/dart-ui/ColorFilter-class.html) class in the Flutter SDK. 2 | library color_filter; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'color.dart'; 7 | import 'enums.dart'; 8 | 9 | part 'color_filter.freezed.dart'; 10 | part 'color_filter.g.dart'; 11 | 12 | @freezed 13 | class ColorFilter with _$ColorFilter { 14 | const factory ColorFilter.mode( 15 | Color color, 16 | BlendMode blendMode, 17 | ) = ColorFilterMode; 18 | 19 | const factory ColorFilter.matrix(List matrix) = ColorFilterMatrix; 20 | 21 | const factory ColorFilter.linearToSrgbGamma() = ColorFilterLinearToSrgbGamma; 22 | 23 | const factory ColorFilter.srgbToLinearGamma() = ColorFilterSrgbToLinearGamma; 24 | 25 | factory ColorFilter.fromJson(Map json) => 26 | _$ColorFilterFromJson(json); 27 | } 28 | -------------------------------------------------------------------------------- /lib/widgets/color_scheme.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [ColorScheme](https://api.flutter.dev/flutter/material/ColorScheme-class.html) class in the Flutter SDK. 2 | library color_scheme; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'color.dart'; 7 | import 'enums.dart'; 8 | 9 | part 'color_scheme.freezed.dart'; 10 | part 'color_scheme.g.dart'; 11 | 12 | @freezed 13 | class ColorScheme with _$ColorScheme { 14 | const factory ColorScheme({ 15 | required Brightness brightness, 16 | required Color primary, 17 | required Color onPrimary, 18 | Color? primaryContainer, 19 | Color? onPrimaryContainer, 20 | required Color secondary, 21 | required Color onSecondary, 22 | Color? secondaryContainer, 23 | Color? onSecondaryContainer, 24 | Color? tertiary, 25 | Color? onTertiary, 26 | Color? tertiaryContainer, 27 | Color? onTertiaryContainer, 28 | required Color error, 29 | required Color onError, 30 | Color? errorContainer, 31 | Color? onErrorContainer, 32 | required Color background, 33 | required Color onBackground, 34 | required Color surface, 35 | required Color onSurface, 36 | Color? surfaceVariant, 37 | Color? onSurfaceVariant, 38 | Color? outline, 39 | Color? outlineVariant, 40 | Color? shadow, 41 | Color? scrim, 42 | Color? inverseSurface, 43 | Color? onInverseSurface, 44 | Color? inversePrimary, 45 | Color? surfaceTint, 46 | }) = _ColorScheme; 47 | 48 | const factory ColorScheme.fromSeed({ 49 | required Color seedColor, 50 | @Default(Brightness.light) Brightness brightness, 51 | Color? primary, 52 | Color? onPrimary, 53 | Color? primaryContainer, 54 | Color? onPrimaryContainer, 55 | Color? secondary, 56 | Color? onSecondary, 57 | Color? secondaryContainer, 58 | Color? onSecondaryContainer, 59 | Color? tertiary, 60 | Color? onTertiary, 61 | Color? tertiaryContainer, 62 | Color? onTertiaryContainer, 63 | Color? error, 64 | Color? onError, 65 | Color? errorContainer, 66 | Color? onErrorContainer, 67 | Color? outline, 68 | Color? outlineVariant, 69 | Color? background, 70 | Color? onBackground, 71 | Color? surface, 72 | Color? onSurface, 73 | Color? surfaceVariant, 74 | Color? onSurfaceVariant, 75 | Color? inverseSurface, 76 | Color? onInverseSurface, 77 | Color? inversePrimary, 78 | Color? shadow, 79 | Color? scrim, 80 | Color? surfaceTint, 81 | }) = ColorSchemeFromSeed; 82 | 83 | factory ColorScheme.fromJson(Map json) => 84 | _$ColorSchemeFromJson(json); 85 | } 86 | -------------------------------------------------------------------------------- /lib/widgets/curves.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [Curve](https://api.flutter.dev/flutter/animation/Curve-class.html) class in the Flutter SDK. 2 | library curves; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'curves.freezed.dart'; 7 | part 'curves.g.dart'; 8 | 9 | @freezed 10 | class Curves with _$Curves { 11 | const factory Curves.linear() = LinearCurve; 12 | 13 | const factory Curves.cubic( 14 | double x1, 15 | double y1, 16 | double x2, 17 | double y2, 18 | ) = Cubic; 19 | const factory Curves.decelerate() = DecelerateCurve; 20 | static const fastLinearToSlowEaseIn = Cubic(0.18, 1.0, 0.04, 1.0); 21 | static const fastEaseInToLinear = Cubic(0.25, 0.1, 0.25, 1.0); 22 | static const ease = Cubic(0.25, 0.1, 0.25, 1.0); 23 | static const easeIn = Cubic(0.42, 0.0, 1.0, 1.0); 24 | static const easeInToLinear = Cubic(0.67, 0.03, 0.65, 0.09); 25 | static const easeInSine = Cubic(0.47, 0.0, 0.745, 0.715); 26 | static const easeInQuad = Cubic(0.55, 0.085, 0.68, 0.53); 27 | static const easeInCubic = Cubic(0.55, 0.055, 0.675, 0.19); 28 | static const easeInQuart = Cubic(0.895, 0.03, 0.685, 0.22); 29 | static const easeInQuint = Cubic(0.755, 0.05, 0.855, 0.06); 30 | static const easeInExpo = Cubic(0.95, 0.05, 0.795, 0.035); 31 | static const easeInCirc = Cubic(0.6, 0.04, 0.98, 0.335); 32 | static const easeInBack = Cubic(0.6, -0.28, 0.735, 0.045); 33 | static const easeOut = Cubic(0.0, 0.0, 0.58, 1.0); 34 | static const linearToEaseOut = Cubic(0.35, 0.91, 0.35, 1.0); 35 | static const easeOutSine = Cubic(0.39, 0.575, 0.565, 1.0); 36 | static const easeOutQuad = Cubic(0.25, 0.46, 0.45, 0.94); 37 | static const easeOutCubic = Cubic(0.215, 0.61, 0.355, 1.0); 38 | static const easeOutQuart = Cubic(0.165, 0.84, 0.44, 1.0); 39 | static const easeOutQuint = Cubic(0.23, 1.0, 0.32, 1.0); 40 | static const easeOutExpo = Cubic(0.19, 1.0, 0.22, 1.0); 41 | static const easeOutCirc = Cubic(0.075, 0.82, 0.165, 1.0); 42 | static const easeOutBack = Cubic(0.175, 0.885, 0.32, 1.275); 43 | static const easeInOut = Cubic(0.42, 0.0, 0.58, 1.0); 44 | static const easeInOutSine = Cubic(0.445, 0.05, 0.55, 0.95); 45 | static const easeInOutQuad = Cubic(0.455, 0.03, 0.515, 0.955); 46 | static const easeInOutCubic = Cubic(0.645, 0.045, 0.355, 1.0); 47 | static const easeInOutQuart = Cubic(0.77, 0.0, 0.175, 1.0); 48 | static const easeInOutQuint = Cubic(0.86, 0.0, 0.07, 1.0); 49 | static const easeInOutExpo = Cubic(1.0, 0.0, 0.0, 1.0); 50 | static const easeInOutCirc = Cubic(0.785, 0.135, 0.15, 0.86); 51 | static const easeInOutBack = Cubic(0.68, -0.55, 0.265, 1.55); 52 | static const fastOutSlowIn = Cubic(0.4, 0.0, 0.2, 1.0); 53 | static const slowMiddle = Cubic(0.4, 0.0, 0.6, 1.0); 54 | const factory Curves.bounceIn() = BounceInCurve; 55 | const factory Curves.bounceOut() = BounceOutCurve; 56 | const factory Curves.bounceInOut() = BounceInOutCurve; 57 | const factory Curves.elasticIn() = ElasticInCurve; 58 | const factory Curves.elasticOut() = ElasticOutCurve; 59 | const factory Curves.elasticInOut() = ElasticInOutCurve; 60 | 61 | factory Curves.fromJson(Map json) => _$CurvesFromJson(json); 62 | } 63 | -------------------------------------------------------------------------------- /lib/widgets/data_cell.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [DataCell](https://api.flutter.dev/flutter/material/DataCell-class.html) class in the Flutter SDK. 2 | library data_cell; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'callback.dart'; 7 | import 'widget.dart'; 8 | 9 | part 'data_cell.freezed.dart'; 10 | part 'data_cell.g.dart'; 11 | 12 | @freezed 13 | class DataCell with _$DataCell { 14 | const factory DataCell( 15 | Widget child, { 16 | @Default(false) bool placeholder, 17 | @Default(false) bool showEditIcon, 18 | Callback? onTap, 19 | Callback? onLongPress, 20 | Callback? onDoubleTap, 21 | }) = _DataCell; 22 | 23 | static const DataCell empty = DataCell(SizedBoxShrink()); 24 | 25 | factory DataCell.fromJson(Map json) => 26 | _$DataCellFromJson(json); 27 | } 28 | -------------------------------------------------------------------------------- /lib/widgets/data_cell.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of data_cell; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_DataCell _$$_DataCellFromJson(Map json) => _$_DataCell( 10 | Widget.fromJson(json['child'] as Map), 11 | placeholder: json['placeholder'] as bool? ?? false, 12 | showEditIcon: json['showEditIcon'] as bool? ?? false, 13 | onTap: json['onTap'] == null 14 | ? null 15 | : Callback.fromJson(json['onTap'] as Map), 16 | onLongPress: json['onLongPress'] == null 17 | ? null 18 | : Callback.fromJson(json['onLongPress'] as Map), 19 | onDoubleTap: json['onDoubleTap'] == null 20 | ? null 21 | : Callback.fromJson(json['onDoubleTap'] as Map), 22 | ); 23 | 24 | const _$$_DataCellFieldMap = { 25 | 'child': 'child', 26 | 'placeholder': 'placeholder', 27 | 'showEditIcon': 'showEditIcon', 28 | 'onTap': 'onTap', 29 | 'onLongPress': 'onLongPress', 30 | 'onDoubleTap': 'onDoubleTap', 31 | }; 32 | 33 | Map _$$_DataCellToJson(_$_DataCell instance) { 34 | final val = { 35 | 'child': instance.child, 36 | 'placeholder': instance.placeholder, 37 | 'showEditIcon': instance.showEditIcon, 38 | }; 39 | 40 | void writeNotNull(String key, dynamic value) { 41 | if (value != null) { 42 | val[key] = value; 43 | } 44 | } 45 | 46 | writeNotNull('onTap', instance.onTap); 47 | writeNotNull('onLongPress', instance.onLongPress); 48 | writeNotNull('onDoubleTap', instance.onDoubleTap); 49 | return val; 50 | } 51 | -------------------------------------------------------------------------------- /lib/widgets/data_column.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [DataColumn](https://api.flutter.dev/flutter/material/DataColumn-class.html) class in the Flutter SDK. 2 | library data_column; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'widget.dart'; 7 | 8 | part 'data_column.freezed.dart'; 9 | part 'data_column.g.dart'; 10 | 11 | @freezed 12 | class DataColumn with _$DataColumn { 13 | const factory DataColumn({ 14 | required Widget label, 15 | String? tooltip, 16 | @Default(false) bool numeric, 17 | }) = _DataColumn; 18 | 19 | factory DataColumn.fromJson(Map json) => 20 | _$DataColumnFromJson(json); 21 | } 22 | -------------------------------------------------------------------------------- /lib/widgets/data_column.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of data_column; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_DataColumn _$$_DataColumnFromJson(Map json) => 10 | _$_DataColumn( 11 | label: Widget.fromJson(json['label'] as Map), 12 | tooltip: json['tooltip'] as String?, 13 | numeric: json['numeric'] as bool? ?? false, 14 | ); 15 | 16 | const _$$_DataColumnFieldMap = { 17 | 'label': 'label', 18 | 'tooltip': 'tooltip', 19 | 'numeric': 'numeric', 20 | }; 21 | 22 | Map _$$_DataColumnToJson(_$_DataColumn instance) { 23 | final val = { 24 | 'label': instance.label, 25 | }; 26 | 27 | void writeNotNull(String key, dynamic value) { 28 | if (value != null) { 29 | val[key] = value; 30 | } 31 | } 32 | 33 | writeNotNull('tooltip', instance.tooltip); 34 | val['numeric'] = instance.numeric; 35 | return val; 36 | } 37 | -------------------------------------------------------------------------------- /lib/widgets/data_row.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [DataRow](https://api.flutter.dev/flutter/material/DataRow-class.html) class in the Flutter SDK. 2 | library data_row; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'callback.dart'; 7 | import 'data_cell.dart'; 8 | import 'key.dart'; 9 | import 'material_state_property.dart'; 10 | 11 | part 'data_row.freezed.dart'; 12 | part 'data_row.g.dart'; 13 | 14 | @freezed 15 | class DataRow with _$DataRow { 16 | const factory DataRow({ 17 | Key? key, 18 | @Default(false) bool selected, 19 | Callback? onSelect, 20 | Callback? onDeselect, 21 | Callback? onLongPress, 22 | MaterialStateProperty? color, 23 | required List cells, 24 | }) = _DataRow; 25 | 26 | const factory DataRow.byIndex({ 27 | int? index, 28 | @Default(false) bool selected, 29 | Callback? onSelect, 30 | Callback? onDeselect, 31 | Callback? onLongPress, 32 | MaterialStateProperty? color, 33 | required List cells, 34 | }) = DataRowByIndex; 35 | 36 | factory DataRow.fromJson(Map json) => 37 | _$DataRowFromJson(json); 38 | } 39 | -------------------------------------------------------------------------------- /lib/widgets/decoration.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [Decoration](https://api.flutter.dev/flutter/painting/Decoration-class.html) class in the Flutter SDK. 2 | library decoration; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'border_radius.dart'; 7 | import 'shape_border.dart'; 8 | import 'color.dart'; 9 | import 'decoration_image.dart'; 10 | import 'enums.dart'; 11 | import 'gradient.dart'; 12 | import 'shadow.dart'; 13 | 14 | part 'decoration.freezed.dart'; 15 | part 'decoration.g.dart'; 16 | 17 | @freezed 18 | class Decoration with _$Decoration { 19 | const factory Decoration.box({ 20 | Color? color, 21 | DecorationImage? image, 22 | ShapeBorder? border, 23 | BorderRadius? borderRadius, 24 | List? boxShadow, 25 | Gradient? gradient, 26 | BlendMode? backgroundBlendMode, 27 | @Default(BoxShape.rectangle) BoxShape shape, 28 | }) = BoxDecoration; 29 | 30 | const factory Decoration.shape({ 31 | Color? color, 32 | DecorationImage? image, 33 | Gradient? gradient, 34 | List? shadows, 35 | required ShapeBorder shape, 36 | }) = ShapeDecoration; 37 | 38 | factory Decoration.fromJson(Map json) => 39 | _$DecorationFromJson(json); 40 | } 41 | -------------------------------------------------------------------------------- /lib/widgets/decoration_image.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [DecorationImage](https://api.flutter.dev/flutter/painting/DecorationImage-class.html) class in the Flutter SDK. 2 | library decoration_image; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'alignment.dart'; 7 | import 'color_filter.dart'; 8 | import 'enums.dart'; 9 | import 'image_provider.dart'; 10 | import 'rect.dart'; 11 | 12 | part 'decoration_image.freezed.dart'; 13 | part 'decoration_image.g.dart'; 14 | 15 | @freezed 16 | class DecorationImage with _$DecorationImage { 17 | const factory DecorationImage({ 18 | required ImageProvider image, 19 | ColorFilter? colorFilter, 20 | BoxFit? fit, 21 | @Default(Alignment.center) Alignment alignment, 22 | Rect? centerSlice, 23 | @Default(ImageRepeat.noRepeat) ImageRepeat repeat, 24 | @Default(false) bool matchTextDirection, 25 | @Default(1.0) double scale, 26 | @Default(1.0) double opacity, 27 | @Default(FilterQuality.low) FilterQuality filterQuality, 28 | @Default(false) bool invertColors, 29 | @Default(false) bool isAntiAlias, 30 | }) = _DecorationImage; 31 | 32 | factory DecorationImage.fromJson(Map json) => 33 | _$DecorationImageFromJson(json); 34 | } 35 | -------------------------------------------------------------------------------- /lib/widgets/dropdown_menu_item.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [DropdownMenuItem](https://api.flutter.dev/flutter/material/DropdownMenuItem-class.html) class in the Flutter SDK. 2 | library dropdown_menu_item; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'alignment.dart'; 7 | import 'callback.dart'; 8 | import 'key.dart'; 9 | import 'widget.dart'; 10 | 11 | part 'dropdown_menu_item.freezed.dart'; 12 | part 'dropdown_menu_item.g.dart'; 13 | 14 | @freezed 15 | class DropdownMenuItem with _$DropdownMenuItem { 16 | const factory DropdownMenuItem({ 17 | Key? key, 18 | Callback? onTap, 19 | String? value, 20 | @Default(true) bool enabled, 21 | @Default(Alignment.centerLeft) Alignment alignment, 22 | required Widget child, 23 | }) = _DropdownMenuItem; 24 | 25 | factory DropdownMenuItem.fromJson(Map json) => 26 | _$DropdownMenuItemFromJson(json); 27 | } 28 | -------------------------------------------------------------------------------- /lib/widgets/dropdown_menu_item.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of dropdown_menu_item; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_DropdownMenuItem _$$_DropdownMenuItemFromJson(Map json) => 10 | _$_DropdownMenuItem( 11 | key: json['key'] == null 12 | ? null 13 | : Key.fromJson(json['key'] as Map), 14 | onTap: json['onTap'] == null 15 | ? null 16 | : Callback.fromJson(json['onTap'] as Map), 17 | value: json['value'] as String?, 18 | enabled: json['enabled'] as bool? ?? true, 19 | alignment: json['alignment'] == null 20 | ? Alignment.centerLeft 21 | : Alignment.fromJson(json['alignment'] as Map), 22 | child: Widget.fromJson(json['child'] as Map), 23 | ); 24 | 25 | const _$$_DropdownMenuItemFieldMap = { 26 | 'key': 'key', 27 | 'onTap': 'onTap', 28 | 'value': 'value', 29 | 'enabled': 'enabled', 30 | 'alignment': 'alignment', 31 | 'child': 'child', 32 | }; 33 | 34 | Map _$$_DropdownMenuItemToJson(_$_DropdownMenuItem instance) { 35 | final val = {}; 36 | 37 | void writeNotNull(String key, dynamic value) { 38 | if (value != null) { 39 | val[key] = value; 40 | } 41 | } 42 | 43 | writeNotNull('key', instance.key); 44 | writeNotNull('onTap', instance.onTap); 45 | writeNotNull('value', instance.value); 46 | val['enabled'] = instance.enabled; 47 | val['alignment'] = instance.alignment; 48 | val['child'] = instance.child; 49 | return val; 50 | } 51 | -------------------------------------------------------------------------------- /lib/widgets/edge_insets.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [EdgeInsets](https://api.flutter.dev/flutter/painting/EdgeInsets-class.html) class in the Flutter SDK. 2 | library edge_insets; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'edge_insets.freezed.dart'; 7 | part 'edge_insets.g.dart'; 8 | 9 | @freezed 10 | class EdgeInsets with _$EdgeInsets { 11 | const factory EdgeInsets( 12 | double left, 13 | double top, 14 | double right, 15 | double bottom, 16 | ) = _EdgeInsets; 17 | 18 | static const EdgeInsets zero = EdgeInsets(0.0, 0.0, 0.0, 0.0); 19 | 20 | const factory EdgeInsets.only({ 21 | @Default(0.0) double left, 22 | @Default(0.0) double top, 23 | @Default(0.0) double right, 24 | @Default(0.0) double bottom, 25 | }) = EdgeInsetsOnly; 26 | 27 | const factory EdgeInsets.all(double value) = EdgeInsetsAll; 28 | 29 | const factory EdgeInsets.symmetric({ 30 | @Default(0.0) double vertical, 31 | @Default(0.0) double horizontal, 32 | }) = EdgeInsetsSymmetric; 33 | 34 | factory EdgeInsets.fromJson(Map json) => 35 | _$EdgeInsetsFromJson(json); 36 | } 37 | -------------------------------------------------------------------------------- /lib/widgets/floating_label_alignment.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [FloatingLabelAlignment](https://api.flutter.dev/flutter/material/FloatingLabelAlignment-class.html) class in the Flutter SDK. 2 | library floating_label_alignment; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'floating_label_alignment.freezed.dart'; 7 | part 'floating_label_alignment.g.dart'; 8 | 9 | @freezed 10 | class FloatingLabelAlignment with _$FloatingLabelAlignment { 11 | const factory FloatingLabelAlignment.start() = FloatingLabelAlignmentStart; 12 | const factory FloatingLabelAlignment.center() = FloatingLabelAlignmentCenter; 13 | 14 | factory FloatingLabelAlignment.fromJson(Map json) => 15 | _$FloatingLabelAlignmentFromJson(json); 16 | } 17 | -------------------------------------------------------------------------------- /lib/widgets/floating_label_alignment.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of floating_label_alignment; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$FloatingLabelAlignmentStart _$$FloatingLabelAlignmentStartFromJson( 10 | Map json) => 11 | _$FloatingLabelAlignmentStart( 12 | $type: json['runtimeType'] as String?, 13 | ); 14 | 15 | const _$$FloatingLabelAlignmentStartFieldMap = { 16 | r'$type': 'runtimeType', 17 | }; 18 | 19 | Map _$$FloatingLabelAlignmentStartToJson( 20 | _$FloatingLabelAlignmentStart instance) => 21 | { 22 | 'runtimeType': instance.$type, 23 | }; 24 | 25 | _$FloatingLabelAlignmentCenter _$$FloatingLabelAlignmentCenterFromJson( 26 | Map json) => 27 | _$FloatingLabelAlignmentCenter( 28 | $type: json['runtimeType'] as String?, 29 | ); 30 | 31 | const _$$FloatingLabelAlignmentCenterFieldMap = { 32 | r'$type': 'runtimeType', 33 | }; 34 | 35 | Map _$$FloatingLabelAlignmentCenterToJson( 36 | _$FloatingLabelAlignmentCenter instance) => 37 | { 38 | 'runtimeType': instance.$type, 39 | }; 40 | -------------------------------------------------------------------------------- /lib/widgets/font_feature.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [FontFeature](https://api.flutter.dev/flutter/dart-ui/FontFeature-class.html) class in the Flutter SDK. 2 | library font_feature; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'font_feature.freezed.dart'; 7 | part 'font_feature.g.dart'; 8 | 9 | @freezed 10 | class FontFeature with _$FontFeature { 11 | const factory FontFeature( 12 | String feature, { 13 | @Default(1) int value, 14 | }) = _FontFeature; 15 | 16 | factory FontFeature.fromJson(Map json) => 17 | _$FontFeatureFromJson(json); 18 | } 19 | -------------------------------------------------------------------------------- /lib/widgets/font_feature.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of font_feature; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_FontFeature _$$_FontFeatureFromJson(Map json) => 10 | _$_FontFeature( 11 | json['feature'] as String, 12 | value: json['value'] as int? ?? 1, 13 | ); 14 | 15 | const _$$_FontFeatureFieldMap = { 16 | 'feature': 'feature', 17 | 'value': 'value', 18 | }; 19 | 20 | Map _$$_FontFeatureToJson(_$_FontFeature instance) => 21 | { 22 | 'feature': instance.feature, 23 | 'value': instance.value, 24 | }; 25 | -------------------------------------------------------------------------------- /lib/widgets/font_variation.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [FontVariation](https://api.flutter.dev/flutter/dart-ui/FontVariation-class.html) class in the Flutter SDK. 2 | library font_variation; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'font_variation.freezed.dart'; 7 | part 'font_variation.g.dart'; 8 | 9 | @freezed 10 | class FontVariation with _$FontVariation { 11 | const factory FontVariation( 12 | String axis, 13 | double value, 14 | ) = _FontVariation; 15 | 16 | factory FontVariation.fromJson(Map json) => 17 | _$FontVariationFromJson(json); 18 | } 19 | -------------------------------------------------------------------------------- /lib/widgets/font_variation.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of font_variation; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_FontVariation _$$_FontVariationFromJson(Map json) => 10 | _$_FontVariation( 11 | json['axis'] as String, 12 | (json['value'] as num).toDouble(), 13 | ); 14 | 15 | const _$$_FontVariationFieldMap = { 16 | 'axis': 'axis', 17 | 'value': 'value', 18 | }; 19 | 20 | Map _$$_FontVariationToJson(_$_FontVariation instance) => 21 | { 22 | 'axis': instance.axis, 23 | 'value': instance.value, 24 | }; 25 | -------------------------------------------------------------------------------- /lib/widgets/font_weight.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [FontWeight](https://api.flutter.dev/flutter/dart-ui/FontWeight-class.html) class in the Flutter SDK. 2 | library font_weight; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'font_weight.freezed.dart'; 7 | part 'font_weight.g.dart'; 8 | 9 | @freezed 10 | class FontWeight with _$FontWeight { 11 | const factory FontWeight.w100() = FontWeightW100; 12 | const factory FontWeight.w200() = FontWeightW200; 13 | const factory FontWeight.w300() = FontWeightW300; 14 | const factory FontWeight.w400() = FontWeightW400; 15 | const factory FontWeight.w500() = FontWeightW500; 16 | const factory FontWeight.w600() = FontWeightW600; 17 | const factory FontWeight.w700() = FontWeightW700; 18 | const factory FontWeight.w800() = FontWeightW800; 19 | const factory FontWeight.w900() = FontWeightW900; 20 | static const FontWeight normal = FontWeight.w400(); 21 | static const FontWeight bold = FontWeight.w700(); 22 | 23 | static const List values = [ 24 | FontWeight.w100(), 25 | FontWeight.w200(), 26 | FontWeight.w300(), 27 | FontWeight.w400(), 28 | FontWeight.w500(), 29 | FontWeight.w600(), 30 | FontWeight.w700(), 31 | FontWeight.w800(), 32 | FontWeight.w900() 33 | ]; 34 | 35 | factory FontWeight.fromJson(Map json) => 36 | _$FontWeightFromJson(json); 37 | } 38 | -------------------------------------------------------------------------------- /lib/widgets/gradient.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [Gradient](https://api.flutter.dev/flutter/painting/Gradient-class.html) class in the Flutter SDK. 2 | library gradient; 3 | 4 | import 'dart:math'; 5 | 6 | import 'package:freezed_annotation/freezed_annotation.dart'; 7 | 8 | import 'alignment.dart'; 9 | import 'color.dart'; 10 | import 'enums.dart'; 11 | import 'gradient_transform.dart'; 12 | 13 | part 'gradient.freezed.dart'; 14 | part 'gradient.g.dart'; 15 | 16 | @freezed 17 | class Gradient with _$Gradient { 18 | const factory Gradient.linear({ 19 | @Default(Alignment.centerLeft) Alignment begin, 20 | @Default(Alignment.centerRight) Alignment end, 21 | required List colors, 22 | List? stops, 23 | @Default(TileMode.clamp) TileMode tileMode, 24 | GradientTransform? transform, 25 | }) = LinearGradient; 26 | 27 | const factory Gradient.radial({ 28 | @Default(Alignment.center) Alignment center, 29 | @Default(0.5) double radius, 30 | required List colors, 31 | List? stops, 32 | @Default(TileMode.clamp) TileMode tileMode, 33 | Alignment? focal, 34 | @Default(0.0) double focalRadius, 35 | GradientTransform? transform, 36 | }) = RadialGradient; 37 | 38 | const factory Gradient.sweep({ 39 | @Default(Alignment.center) Alignment center, 40 | @Default(0.0) double startAngle, 41 | @Default(pi * 2) double endAngle, 42 | required List colors, 43 | List? stops, 44 | @Default(TileMode.clamp) TileMode tileMode, 45 | GradientTransform? transform, 46 | }) = SweepGradient; 47 | 48 | factory Gradient.fromJson(Map json) => 49 | _$GradientFromJson(json); 50 | } 51 | -------------------------------------------------------------------------------- /lib/widgets/gradient_transform.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [GradientTransform](https://api.flutter.dev/flutter/painting/GradientTransform-class.html) class in the Flutter SDK. 2 | library gradient_transform; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'gradient_transform.freezed.dart'; 7 | part 'gradient_transform.g.dart'; 8 | 9 | @freezed 10 | class GradientTransform with _$GradientTransform { 11 | const factory GradientTransform.rotation(double radians) = GradientRotation; 12 | 13 | factory GradientTransform.fromJson(Map json) => 14 | _$GradientTransformFromJson(json); 15 | } 16 | -------------------------------------------------------------------------------- /lib/widgets/gradient_transform.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of gradient_transform; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$GradientRotation _$$GradientRotationFromJson(Map json) => 10 | _$GradientRotation( 11 | (json['radians'] as num).toDouble(), 12 | ); 13 | 14 | const _$$GradientRotationFieldMap = { 15 | 'radians': 'radians', 16 | }; 17 | 18 | Map _$$GradientRotationToJson(_$GradientRotation instance) => 19 | { 20 | 'radians': instance.radians, 21 | }; 22 | -------------------------------------------------------------------------------- /lib/widgets/icon_data.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [IconData](https://api.flutter.dev/flutter/widgets/IconData-class.html) class in the Flutter SDK. 2 | library icon_data; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'icon_data.freezed.dart'; 7 | part 'icon_data.g.dart'; 8 | 9 | @freezed 10 | class IconData with _$IconData { 11 | const factory IconData( 12 | int codePoint, { 13 | String? fontFamily, 14 | String? fontPackage, 15 | @Default(false) bool matchTextDirection, 16 | }) = _IconData; 17 | 18 | factory IconData.fromJson(Map json) => 19 | _$IconDataFromJson(json); 20 | } 21 | -------------------------------------------------------------------------------- /lib/widgets/icon_data.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of icon_data; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_IconData _$$_IconDataFromJson(Map json) => _$_IconData( 10 | json['codePoint'] as int, 11 | fontFamily: json['fontFamily'] as String?, 12 | fontPackage: json['fontPackage'] as String?, 13 | matchTextDirection: json['matchTextDirection'] as bool? ?? false, 14 | ); 15 | 16 | const _$$_IconDataFieldMap = { 17 | 'codePoint': 'codePoint', 18 | 'fontFamily': 'fontFamily', 19 | 'fontPackage': 'fontPackage', 20 | 'matchTextDirection': 'matchTextDirection', 21 | }; 22 | 23 | Map _$$_IconDataToJson(_$_IconData instance) { 24 | final val = { 25 | 'codePoint': instance.codePoint, 26 | }; 27 | 28 | void writeNotNull(String key, dynamic value) { 29 | if (value != null) { 30 | val[key] = value; 31 | } 32 | } 33 | 34 | writeNotNull('fontFamily', instance.fontFamily); 35 | writeNotNull('fontPackage', instance.fontPackage); 36 | val['matchTextDirection'] = instance.matchTextDirection; 37 | return val; 38 | } 39 | -------------------------------------------------------------------------------- /lib/widgets/icon_theme_data.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [IconThemeData](https://api.flutter.dev/flutter/widgets/IconThemeData-class.html) class in the Flutter SDK. 2 | library icon_theme_data; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'color.dart'; 7 | import 'shadow.dart'; 8 | 9 | part 'icon_theme_data.freezed.dart'; 10 | part 'icon_theme_data.g.dart'; 11 | 12 | @freezed 13 | class IconThemeData with _$IconThemeData { 14 | const factory IconThemeData({ 15 | double? size, 16 | double? fill, 17 | double? weight, 18 | double? grade, 19 | double? opticalSize, 20 | Color? color, 21 | double? opacity, 22 | List? shadows, 23 | }) = _IconThemeData; 24 | 25 | factory IconThemeData.fromJson(Map json) => 26 | _$IconThemeDataFromJson(json); 27 | } 28 | -------------------------------------------------------------------------------- /lib/widgets/icon_theme_data.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of icon_theme_data; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_IconThemeData _$$_IconThemeDataFromJson(Map json) => 10 | _$_IconThemeData( 11 | size: (json['size'] as num?)?.toDouble(), 12 | fill: (json['fill'] as num?)?.toDouble(), 13 | weight: (json['weight'] as num?)?.toDouble(), 14 | grade: (json['grade'] as num?)?.toDouble(), 15 | opticalSize: (json['opticalSize'] as num?)?.toDouble(), 16 | color: json['color'] == null 17 | ? null 18 | : Color.fromJson(json['color'] as Map), 19 | opacity: (json['opacity'] as num?)?.toDouble(), 20 | shadows: (json['shadows'] as List?) 21 | ?.map((e) => Shadow.fromJson(e as Map)) 22 | .toList(), 23 | ); 24 | 25 | const _$$_IconThemeDataFieldMap = { 26 | 'size': 'size', 27 | 'fill': 'fill', 28 | 'weight': 'weight', 29 | 'grade': 'grade', 30 | 'opticalSize': 'opticalSize', 31 | 'color': 'color', 32 | 'opacity': 'opacity', 33 | 'shadows': 'shadows', 34 | }; 35 | 36 | Map _$$_IconThemeDataToJson(_$_IconThemeData instance) { 37 | final val = {}; 38 | 39 | void writeNotNull(String key, dynamic value) { 40 | if (value != null) { 41 | val[key] = value; 42 | } 43 | } 44 | 45 | writeNotNull('size', instance.size); 46 | writeNotNull('fill', instance.fill); 47 | writeNotNull('weight', instance.weight); 48 | writeNotNull('grade', instance.grade); 49 | writeNotNull('opticalSize', instance.opticalSize); 50 | writeNotNull('color', instance.color); 51 | writeNotNull('opacity', instance.opacity); 52 | writeNotNull('shadows', instance.shadows); 53 | return val; 54 | } 55 | -------------------------------------------------------------------------------- /lib/widgets/image_provider.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [ImageProvider](https://api.flutter.dev/flutter/painting/ImageProvider-class.html) class in the Flutter SDK. 2 | library image_provider; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'image_provider.freezed.dart'; 7 | part 'image_provider.g.dart'; 8 | 9 | @freezed 10 | class ImageProvider with _$ImageProvider { 11 | const factory ImageProvider.bytes( 12 | List bytes, { 13 | @Default(1.0) double scale, 14 | }) = MemoryImage; 15 | 16 | const factory ImageProvider.asset( 17 | String path, { 18 | String? package, 19 | }) = AssetImage; 20 | 21 | const factory ImageProvider.network( 22 | String url, { 23 | @Default(1.0) double scale, 24 | Map? headers, 25 | }) = NetworkImage; 26 | 27 | factory ImageProvider.fromJson(Map json) => 28 | _$ImageProviderFromJson(json); 29 | } 30 | -------------------------------------------------------------------------------- /lib/widgets/image_provider.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of image_provider; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$MemoryImage _$$MemoryImageFromJson(Map json) => 10 | _$MemoryImage( 11 | (json['bytes'] as List).map((e) => e as int).toList(), 12 | scale: (json['scale'] as num?)?.toDouble() ?? 1.0, 13 | $type: json['runtimeType'] as String?, 14 | ); 15 | 16 | const _$$MemoryImageFieldMap = { 17 | 'bytes': 'bytes', 18 | 'scale': 'scale', 19 | r'$type': 'runtimeType', 20 | }; 21 | 22 | Map _$$MemoryImageToJson(_$MemoryImage instance) => 23 | { 24 | 'bytes': instance.bytes, 25 | 'scale': instance.scale, 26 | 'runtimeType': instance.$type, 27 | }; 28 | 29 | _$AssetImage _$$AssetImageFromJson(Map json) => _$AssetImage( 30 | json['path'] as String, 31 | package: json['package'] as String?, 32 | $type: json['runtimeType'] as String?, 33 | ); 34 | 35 | const _$$AssetImageFieldMap = { 36 | 'path': 'path', 37 | 'package': 'package', 38 | r'$type': 'runtimeType', 39 | }; 40 | 41 | Map _$$AssetImageToJson(_$AssetImage instance) { 42 | final val = { 43 | 'path': instance.path, 44 | }; 45 | 46 | void writeNotNull(String key, dynamic value) { 47 | if (value != null) { 48 | val[key] = value; 49 | } 50 | } 51 | 52 | writeNotNull('package', instance.package); 53 | val['runtimeType'] = instance.$type; 54 | return val; 55 | } 56 | 57 | _$NetworkImage _$$NetworkImageFromJson(Map json) => 58 | _$NetworkImage( 59 | json['url'] as String, 60 | scale: (json['scale'] as num?)?.toDouble() ?? 1.0, 61 | headers: (json['headers'] as Map?)?.map( 62 | (k, e) => MapEntry(k, e as String), 63 | ), 64 | $type: json['runtimeType'] as String?, 65 | ); 66 | 67 | const _$$NetworkImageFieldMap = { 68 | 'url': 'url', 69 | 'scale': 'scale', 70 | 'headers': 'headers', 71 | r'$type': 'runtimeType', 72 | }; 73 | 74 | Map _$$NetworkImageToJson(_$NetworkImage instance) { 75 | final val = { 76 | 'url': instance.url, 77 | 'scale': instance.scale, 78 | }; 79 | 80 | void writeNotNull(String key, dynamic value) { 81 | if (value != null) { 82 | val[key] = value; 83 | } 84 | } 85 | 86 | writeNotNull('headers', instance.headers); 87 | val['runtimeType'] = instance.$type; 88 | return val; 89 | } 90 | -------------------------------------------------------------------------------- /lib/widgets/inline_span.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [InlineSpan](https://api.flutter.dev/flutter/painting/InlineSpan-class.html) class in the Flutter SDK. 2 | library inline_span; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'callback.dart'; 7 | import 'enums.dart'; 8 | import 'locale.dart'; 9 | import 'mouse_cursor.dart'; 10 | import 'text_style.dart'; 11 | import 'widget.dart'; 12 | 13 | part 'inline_span.freezed.dart'; 14 | part 'inline_span.g.dart'; 15 | 16 | @freezed 17 | class InlineSpan with _$InlineSpan { 18 | const factory InlineSpan.widget({ 19 | required Widget child, 20 | @Default(PlaceholderAlignment.bottom) PlaceholderAlignment alignment, 21 | TextBaseline? baseline, 22 | TextStyle? style, 23 | }) = WidgetSpan; 24 | 25 | const factory InlineSpan.text({ 26 | String? text, 27 | List? children, 28 | TextStyle? style, 29 | MouseCursor? mouseCursor, 30 | Callback? onTap, 31 | String? semanticsLabel, 32 | Locale? locale, 33 | bool? spellOut, 34 | }) = TextSpan; 35 | 36 | factory InlineSpan.fromJson(Map json) => 37 | _$InlineSpanFromJson(json); 38 | } 39 | -------------------------------------------------------------------------------- /lib/widgets/input_decoration.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [InputDecoration](https://api.flutter.dev/flutter/material/InputDecoration-class.html) class in the Flutter SDK. 2 | library input_decoration; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'box_constraints.dart'; 7 | import 'color.dart'; 8 | import 'edge_insets.dart'; 9 | import 'enums.dart'; 10 | import 'floating_label_alignment.dart'; 11 | import 'shape_border.dart'; 12 | import 'text_style.dart'; 13 | import 'widget.dart'; 14 | 15 | part 'input_decoration.freezed.dart'; 16 | part 'input_decoration.g.dart'; 17 | 18 | @freezed 19 | class InputDecoration with _$InputDecoration { 20 | const factory InputDecoration({ 21 | Widget? icon, 22 | Color? iconColor, 23 | Widget? label, 24 | String? labelText, 25 | TextStyle? labelStyle, 26 | TextStyle? floatingLabelStyle, 27 | String? helperText, 28 | TextStyle? helperStyle, 29 | int? helperMaxLines, 30 | String? hintText, 31 | TextStyle? hintStyle, 32 | TextDirection? hintTextDirection, 33 | int? hintMaxLines, 34 | String? errorText, 35 | TextStyle? errorStyle, 36 | int? errorMaxLines, 37 | FloatingLabelBehavior? floatingLabelBehavior, 38 | FloatingLabelAlignment? floatingLabelAlignment, 39 | @Default(false) bool isCollapsed, 40 | bool? isDense, 41 | EdgeInsets? contentPadding, 42 | Widget? prefixIcon, 43 | BoxConstraints? prefixIconConstraints, 44 | Widget? prefix, 45 | String? prefixText, 46 | TextStyle? prefixStyle, 47 | Color? prefixIconColor, 48 | Widget? suffixIcon, 49 | Widget? suffix, 50 | String? suffixText, 51 | TextStyle? suffixStyle, 52 | Color? suffixIconColor, 53 | BoxConstraints? suffixIconConstraints, 54 | Widget? counter, 55 | String? counterText, 56 | TextStyle? counterStyle, 57 | bool? filled, 58 | Color? fillColor, 59 | Color? focusColor, 60 | Color? hoverColor, 61 | ShapeBorder? errorBorder, 62 | ShapeBorder? focusedBorder, 63 | ShapeBorder? focusedErrorBorder, 64 | ShapeBorder? disabledBorder, 65 | ShapeBorder? enabledBorder, 66 | ShapeBorder? border, 67 | @Default(true) bool enabled, 68 | String? semanticCounterText, 69 | bool? alignLabelWithHint, 70 | BoxConstraints? constraints, 71 | }) = _InputDecoration; 72 | 73 | factory InputDecoration.fromJson(Map json) => 74 | _$InputDecorationFromJson(json); 75 | } 76 | -------------------------------------------------------------------------------- /lib/widgets/key.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [Key](https://api.flutter.dev/flutter/foundation/Key-class.html) class in the Flutter SDK. 2 | library key; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'key.freezed.dart'; 7 | part 'key.g.dart'; 8 | 9 | abstract class LocalKey {} 10 | 11 | @freezed 12 | class Key with _$Key { 13 | @Implements() 14 | const factory Key.value(String value) = ValueKey; 15 | 16 | @Implements() 17 | const factory Key.unique() = UniqueKey; 18 | 19 | factory Key.fromJson(Map json) => _$KeyFromJson(json); 20 | } 21 | -------------------------------------------------------------------------------- /lib/widgets/key.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of key; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$ValueKey _$$ValueKeyFromJson(Map json) => _$ValueKey( 10 | json['value'] as String, 11 | $type: json['runtimeType'] as String?, 12 | ); 13 | 14 | const _$$ValueKeyFieldMap = { 15 | 'value': 'value', 16 | r'$type': 'runtimeType', 17 | }; 18 | 19 | Map _$$ValueKeyToJson(_$ValueKey instance) => 20 | { 21 | 'value': instance.value, 22 | 'runtimeType': instance.$type, 23 | }; 24 | 25 | _$UniqueKey _$$UniqueKeyFromJson(Map json) => _$UniqueKey( 26 | $type: json['runtimeType'] as String?, 27 | ); 28 | 29 | const _$$UniqueKeyFieldMap = { 30 | r'$type': 'runtimeType', 31 | }; 32 | 33 | Map _$$UniqueKeyToJson(_$UniqueKey instance) => 34 | { 35 | 'runtimeType': instance.$type, 36 | }; 37 | -------------------------------------------------------------------------------- /lib/widgets/locale.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [Locale](https://api.flutter.dev/flutter/dart-ui/Locale-class.html) class in the Flutter SDK. 2 | library locale; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'locale.freezed.dart'; 7 | part 'locale.g.dart'; 8 | 9 | @freezed 10 | class Locale with _$Locale { 11 | const factory Locale( 12 | String languageCode, [ 13 | String? countryCode, 14 | ]) = _Locale; 15 | 16 | factory Locale.fromJson(Map json) => _$LocaleFromJson(json); 17 | } 18 | -------------------------------------------------------------------------------- /lib/widgets/locale.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of locale; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_Locale _$$_LocaleFromJson(Map json) => _$_Locale( 10 | json['languageCode'] as String, 11 | json['countryCode'] as String?, 12 | ); 13 | 14 | const _$$_LocaleFieldMap = { 15 | 'languageCode': 'languageCode', 16 | 'countryCode': 'countryCode', 17 | }; 18 | 19 | Map _$$_LocaleToJson(_$_Locale instance) { 20 | final val = { 21 | 'languageCode': instance.languageCode, 22 | }; 23 | 24 | void writeNotNull(String key, dynamic value) { 25 | if (value != null) { 26 | val[key] = value; 27 | } 28 | } 29 | 30 | writeNotNull('countryCode', instance.countryCode); 31 | return val; 32 | } 33 | -------------------------------------------------------------------------------- /lib/widgets/material_banner.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [MaterialBanner](https://api.flutter.dev/flutter/material/MaterialBanner-class.html) class in the Flutter SDK. 2 | library material_banner; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'color.dart'; 7 | import 'edge_insets.dart'; 8 | import 'enums.dart'; 9 | import 'key.dart'; 10 | import 'text_style.dart'; 11 | import 'widget.dart'; 12 | import 'callback.dart'; 13 | 14 | part 'material_banner.freezed.dart'; 15 | part 'material_banner.g.dart'; 16 | 17 | @freezed 18 | class MaterialBanner with _$MaterialBanner { 19 | const factory MaterialBanner({ 20 | Key? key, 21 | required Widget content, 22 | TextStyle? contentTextStyle, 23 | required List actions, 24 | double? elevation, 25 | Widget? leading, 26 | Color? backgroundColor, 27 | Color? surfaceTintColor, 28 | Color? shadowColor, 29 | Color? dividerColor, 30 | EdgeInsets? padding, 31 | EdgeInsets? leadingPadding, 32 | @Default(false) bool forceActionsBelow, 33 | @Default(OverflowBarAlignment.end) OverflowBarAlignment overflowAlignment, 34 | Callback? onVisible, 35 | }) = _MaterialBanner; 36 | 37 | factory MaterialBanner.fromJson(Map json) => 38 | _$MaterialBannerFromJson(json); 39 | } 40 | -------------------------------------------------------------------------------- /lib/widgets/material_state_property.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [MaterialStateProperty](https://api.flutter.dev/flutter/material/MaterialStateProperty-class.html) class in the Flutter SDK. 2 | library material_state_property; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'color.dart'; 7 | 8 | part 'material_state_property.freezed.dart'; 9 | part 'material_state_property.g.dart'; 10 | 11 | @freezed 12 | class MaterialStateProperty with _$MaterialStateProperty { 13 | const factory MaterialStateProperty.all(Color? color) = 14 | MaterialStatePropertyAll; 15 | 16 | factory MaterialStateProperty.fromJson(Map json) => 17 | _$MaterialStatePropertyFromJson(json); 18 | } 19 | -------------------------------------------------------------------------------- /lib/widgets/material_state_property.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of material_state_property; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$MaterialStatePropertyAll _$$MaterialStatePropertyAllFromJson( 10 | Map json) => 11 | _$MaterialStatePropertyAll( 12 | json['color'] == null 13 | ? null 14 | : Color.fromJson(json['color'] as Map), 15 | ); 16 | 17 | const _$$MaterialStatePropertyAllFieldMap = { 18 | 'color': 'color', 19 | }; 20 | 21 | Map _$$MaterialStatePropertyAllToJson( 22 | _$MaterialStatePropertyAll instance) { 23 | final val = {}; 24 | 25 | void writeNotNull(String key, dynamic value) { 26 | if (value != null) { 27 | val[key] = value; 28 | } 29 | } 30 | 31 | writeNotNull('color', instance.color); 32 | return val; 33 | } 34 | -------------------------------------------------------------------------------- /lib/widgets/matrix_4.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [Matrix4](https://api.flutter.dev/flutter/vector_math/Matrix4-class.html) class in the Flutter SDK. 2 | /// 3 | /// This class is used to convert a [Matrix4] to and from JSON. 4 | /// 5 | /// To work with a [Matrix4] class, import it from [vector_math](https://pub.dev/packages/vector_math) and use it like normal. 6 | library matrix_4; 7 | 8 | import 'package:freezed_annotation/freezed_annotation.dart'; 9 | import 'package:vector_math/vector_math.dart'; 10 | 11 | const matrixConverter = Matrix4Converter(); 12 | 13 | class Matrix4Converter implements JsonConverter> { 14 | const Matrix4Converter(); 15 | 16 | @override 17 | Matrix4 fromJson(List json) => Matrix4.fromList(json); 18 | 19 | @override 20 | List toJson(Matrix4 object) => object.storage.toList(); 21 | } 22 | -------------------------------------------------------------------------------- /lib/widgets/mouse_cursor.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of mouse_cursor; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_MouseCursor _$$_MouseCursorFromJson(Map json) => 10 | _$_MouseCursor( 11 | kind: json['kind'] as String, 12 | ); 13 | 14 | const _$$_MouseCursorFieldMap = { 15 | 'kind': 'kind', 16 | }; 17 | 18 | Map _$$_MouseCursorToJson(_$_MouseCursor instance) => 19 | { 20 | 'kind': instance.kind, 21 | }; 22 | -------------------------------------------------------------------------------- /lib/widgets/navigation_rail_destination.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [NavigationRailDestination](https://api.flutter.dev/flutter/material/NavigationRailDestination-class.html) class in the Flutter SDK. 2 | library navigation_rail_destination; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'color.dart'; 7 | import 'edge_insets.dart'; 8 | import 'shape_border.dart'; 9 | import 'widget.dart'; 10 | 11 | part 'navigation_rail_destination.freezed.dart'; 12 | part 'navigation_rail_destination.g.dart'; 13 | 14 | @freezed 15 | class NavigationRailDestination with _$NavigationRailDestination { 16 | const factory NavigationRailDestination({ 17 | required Widget icon, 18 | Widget? selectedIcon, 19 | Color? indicatorColor, 20 | ShapeBorder? indicatorShape, 21 | required Widget label, 22 | EdgeInsets? padding, 23 | }) = _NavigationRailDestination; 24 | 25 | factory NavigationRailDestination.fromJson(Map json) => 26 | _$NavigationRailDestinationFromJson(json); 27 | } 28 | -------------------------------------------------------------------------------- /lib/widgets/navigation_rail_destination.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of navigation_rail_destination; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_NavigationRailDestination _$$_NavigationRailDestinationFromJson( 10 | Map json) => 11 | _$_NavigationRailDestination( 12 | icon: Widget.fromJson(json['icon'] as Map), 13 | selectedIcon: json['selectedIcon'] == null 14 | ? null 15 | : Widget.fromJson(json['selectedIcon'] as Map), 16 | indicatorColor: json['indicatorColor'] == null 17 | ? null 18 | : Color.fromJson(json['indicatorColor'] as Map), 19 | indicatorShape: json['indicatorShape'] == null 20 | ? null 21 | : ShapeBorder.fromJson( 22 | json['indicatorShape'] as Map), 23 | label: Widget.fromJson(json['label'] as Map), 24 | padding: json['padding'] == null 25 | ? null 26 | : EdgeInsets.fromJson(json['padding'] as Map), 27 | ); 28 | 29 | const _$$_NavigationRailDestinationFieldMap = { 30 | 'icon': 'icon', 31 | 'selectedIcon': 'selectedIcon', 32 | 'indicatorColor': 'indicatorColor', 33 | 'indicatorShape': 'indicatorShape', 34 | 'label': 'label', 35 | 'padding': 'padding', 36 | }; 37 | 38 | Map _$$_NavigationRailDestinationToJson( 39 | _$_NavigationRailDestination instance) { 40 | final val = { 41 | 'icon': instance.icon, 42 | }; 43 | 44 | void writeNotNull(String key, dynamic value) { 45 | if (value != null) { 46 | val[key] = value; 47 | } 48 | } 49 | 50 | writeNotNull('selectedIcon', instance.selectedIcon); 51 | writeNotNull('indicatorColor', instance.indicatorColor); 52 | writeNotNull('indicatorShape', instance.indicatorShape); 53 | val['label'] = instance.label; 54 | writeNotNull('padding', instance.padding); 55 | return val; 56 | } 57 | -------------------------------------------------------------------------------- /lib/widgets/network_request.dart: -------------------------------------------------------------------------------- 1 | /// Since this is JSON we need to describe the network requests that will be made. 2 | /// 3 | /// For the form submit event it will be a POST request with the form data. 4 | library network_request; 5 | 6 | import 'package:freezed_annotation/freezed_annotation.dart'; 7 | 8 | part 'network_request.freezed.dart'; 9 | part 'network_request.g.dart'; 10 | 11 | @freezed 12 | class NetworkRequest with _$NetworkRequest { 13 | const factory NetworkRequest.http({ 14 | required String url, 15 | @Default({}) Map headers, 16 | String? method, 17 | String? bodyText, 18 | List? bodyBytes, 19 | Map? bodyMap, 20 | @Default(false) bool streamedResponse, 21 | }) = NetworkHttpRequest; 22 | 23 | const factory NetworkRequest.formSubmit({ 24 | required String url, 25 | @Default({}) Map headers, 26 | @Default(false) bool validate, 27 | }) = FormSubmitNetworkRequest; 28 | 29 | factory NetworkRequest.fromJson(Map json) => 30 | _$NetworkRequestFromJson(json); 31 | } 32 | -------------------------------------------------------------------------------- /lib/widgets/network_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of network_request; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$NetworkHttpRequest _$$NetworkHttpRequestFromJson(Map json) => 10 | _$NetworkHttpRequest( 11 | url: json['url'] as String, 12 | headers: (json['headers'] as Map?)?.map( 13 | (k, e) => MapEntry(k, e as String), 14 | ) ?? 15 | const {}, 16 | method: json['method'] as String?, 17 | bodyText: json['bodyText'] as String?, 18 | bodyBytes: 19 | (json['bodyBytes'] as List?)?.map((e) => e as int).toList(), 20 | bodyMap: (json['bodyMap'] as Map?)?.map( 21 | (k, e) => MapEntry(k, e as Object), 22 | ), 23 | streamedResponse: json['streamedResponse'] as bool? ?? false, 24 | $type: json['runtimeType'] as String?, 25 | ); 26 | 27 | const _$$NetworkHttpRequestFieldMap = { 28 | 'url': 'url', 29 | 'headers': 'headers', 30 | 'method': 'method', 31 | 'bodyText': 'bodyText', 32 | 'bodyBytes': 'bodyBytes', 33 | 'bodyMap': 'bodyMap', 34 | 'streamedResponse': 'streamedResponse', 35 | r'$type': 'runtimeType', 36 | }; 37 | 38 | Map _$$NetworkHttpRequestToJson( 39 | _$NetworkHttpRequest instance) { 40 | final val = { 41 | 'url': instance.url, 42 | 'headers': instance.headers, 43 | }; 44 | 45 | void writeNotNull(String key, dynamic value) { 46 | if (value != null) { 47 | val[key] = value; 48 | } 49 | } 50 | 51 | writeNotNull('method', instance.method); 52 | writeNotNull('bodyText', instance.bodyText); 53 | writeNotNull('bodyBytes', instance.bodyBytes); 54 | writeNotNull('bodyMap', instance.bodyMap); 55 | val['streamedResponse'] = instance.streamedResponse; 56 | val['runtimeType'] = instance.$type; 57 | return val; 58 | } 59 | 60 | _$FormSubmitNetworkRequest _$$FormSubmitNetworkRequestFromJson( 61 | Map json) => 62 | _$FormSubmitNetworkRequest( 63 | url: json['url'] as String, 64 | headers: (json['headers'] as Map?)?.map( 65 | (k, e) => MapEntry(k, e as String), 66 | ) ?? 67 | const {}, 68 | validate: json['validate'] as bool? ?? false, 69 | $type: json['runtimeType'] as String?, 70 | ); 71 | 72 | const _$$FormSubmitNetworkRequestFieldMap = { 73 | 'url': 'url', 74 | 'headers': 'headers', 75 | 'validate': 'validate', 76 | r'$type': 'runtimeType', 77 | }; 78 | 79 | Map _$$FormSubmitNetworkRequestToJson( 80 | _$FormSubmitNetworkRequest instance) => 81 | { 82 | 'url': instance.url, 83 | 'headers': instance.headers, 84 | 'validate': instance.validate, 85 | 'runtimeType': instance.$type, 86 | }; 87 | -------------------------------------------------------------------------------- /lib/widgets/offset.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [Offset](https://api.flutter.dev/flutter/dart-ui/Offset-class.html) class in the Flutter SDK. 2 | library offset; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'offset.freezed.dart'; 7 | part 'offset.g.dart'; 8 | 9 | @freezed 10 | class Offset with _$Offset { 11 | const factory Offset(double dx, double dy) = _Offset; 12 | 13 | static const Offset zero = Offset(0.0, 0.0); 14 | 15 | factory Offset.fromJson(Map json) => _$OffsetFromJson(json); 16 | } 17 | -------------------------------------------------------------------------------- /lib/widgets/offset.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of offset; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_Offset _$$_OffsetFromJson(Map json) => _$_Offset( 10 | (json['dx'] as num).toDouble(), 11 | (json['dy'] as num).toDouble(), 12 | ); 13 | 14 | const _$$_OffsetFieldMap = { 15 | 'dx': 'dx', 16 | 'dy': 'dy', 17 | }; 18 | 19 | Map _$$_OffsetToJson(_$_Offset instance) => { 20 | 'dx': instance.dx, 21 | 'dy': instance.dy, 22 | }; 23 | -------------------------------------------------------------------------------- /lib/widgets/paint.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [Paint](https://api.flutter.dev/flutter/dart-ui/Paint-class.html) class in the Flutter SDK. 2 | library paint; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'paint.freezed.dart'; 7 | part 'paint.g.dart'; 8 | 9 | @freezed 10 | class Paint with _$Paint { 11 | const factory Paint() = _Paint; 12 | 13 | factory Paint.fromJson(Map json) => _$PaintFromJson(json); 14 | } 15 | -------------------------------------------------------------------------------- /lib/widgets/paint.freezed.dart: -------------------------------------------------------------------------------- 1 | // coverage:ignore-file 2 | // GENERATED CODE - DO NOT MODIFY BY HAND 3 | // ignore_for_file: type=lint 4 | // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark 5 | 6 | part of paint; 7 | 8 | // ************************************************************************** 9 | // FreezedGenerator 10 | // ************************************************************************** 11 | 12 | T _$identity(T value) => value; 13 | 14 | final _privateConstructorUsedError = UnsupportedError( 15 | 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); 16 | 17 | Paint _$PaintFromJson(Map json) { 18 | return _Paint.fromJson(json); 19 | } 20 | 21 | /// @nodoc 22 | mixin _$Paint { 23 | Map toJson() => throw _privateConstructorUsedError; 24 | } 25 | 26 | /// @nodoc 27 | abstract class $PaintCopyWith<$Res> { 28 | factory $PaintCopyWith(Paint value, $Res Function(Paint) then) = 29 | _$PaintCopyWithImpl<$Res, Paint>; 30 | } 31 | 32 | /// @nodoc 33 | class _$PaintCopyWithImpl<$Res, $Val extends Paint> 34 | implements $PaintCopyWith<$Res> { 35 | _$PaintCopyWithImpl(this._value, this._then); 36 | 37 | // ignore: unused_field 38 | final $Val _value; 39 | // ignore: unused_field 40 | final $Res Function($Val) _then; 41 | } 42 | 43 | /// @nodoc 44 | abstract class _$$_PaintCopyWith<$Res> { 45 | factory _$$_PaintCopyWith(_$_Paint value, $Res Function(_$_Paint) then) = 46 | __$$_PaintCopyWithImpl<$Res>; 47 | } 48 | 49 | /// @nodoc 50 | class __$$_PaintCopyWithImpl<$Res> extends _$PaintCopyWithImpl<$Res, _$_Paint> 51 | implements _$$_PaintCopyWith<$Res> { 52 | __$$_PaintCopyWithImpl(_$_Paint _value, $Res Function(_$_Paint) _then) 53 | : super(_value, _then); 54 | } 55 | 56 | /// @nodoc 57 | @JsonSerializable() 58 | class _$_Paint implements _Paint { 59 | const _$_Paint(); 60 | 61 | factory _$_Paint.fromJson(Map json) => 62 | _$$_PaintFromJson(json); 63 | 64 | @override 65 | String toString() { 66 | return 'Paint()'; 67 | } 68 | 69 | @override 70 | bool operator ==(dynamic other) { 71 | return identical(this, other) || 72 | (other.runtimeType == runtimeType && other is _$_Paint); 73 | } 74 | 75 | @JsonKey(ignore: true) 76 | @override 77 | int get hashCode => runtimeType.hashCode; 78 | 79 | @override 80 | Map toJson() { 81 | return _$$_PaintToJson( 82 | this, 83 | ); 84 | } 85 | } 86 | 87 | abstract class _Paint implements Paint { 88 | const factory _Paint() = _$_Paint; 89 | 90 | factory _Paint.fromJson(Map json) = _$_Paint.fromJson; 91 | } 92 | -------------------------------------------------------------------------------- /lib/widgets/paint.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of paint; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_Paint _$$_PaintFromJson(Map json) => _$_Paint(); 10 | 11 | const _$$_PaintFieldMap = {}; 12 | 13 | Map _$$_PaintToJson(_$_Paint instance) => {}; 14 | -------------------------------------------------------------------------------- /lib/widgets/popup_menu_entry.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [PopupMenuEntry](https://api.flutter.dev/flutter/material/PopupMenuEntry-class.html) class in the Flutter SDK. 2 | library popup_menu_entry; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'callback.dart'; 7 | import 'edge_insets.dart'; 8 | import 'key.dart'; 9 | import 'mouse_cursor.dart'; 10 | import 'text_style.dart'; 11 | import 'widget.dart'; 12 | 13 | part 'popup_menu_entry.freezed.dart'; 14 | part 'popup_menu_entry.g.dart'; 15 | 16 | @freezed 17 | class PopupMenuEntry with _$PopupMenuEntry { 18 | const factory PopupMenuEntry.item({ 19 | Key? key, 20 | String? value, 21 | Callback? onTap, 22 | @Default(true) bool enabled, 23 | @Default(48.0) double height, 24 | EdgeInsets? padding, 25 | TextStyle? textStyle, 26 | MouseCursor? mouseCursor, 27 | required Widget? child, 28 | }) = PopupMenuItem; 29 | 30 | const factory PopupMenuEntry.divider({ 31 | Key? key, 32 | @Default(16.0) double height, 33 | }) = PopupMenuDivider; 34 | 35 | const factory PopupMenuEntry.checked({ 36 | Key? key, 37 | String? value, 38 | @Default(false) bool checked, 39 | @Default(true) bool enabled, 40 | EdgeInsets? padding, 41 | @Default(48.0) double height, 42 | MouseCursor? mouseCursor, 43 | Widget? child, 44 | }) = CheckedPopupMenuItem; 45 | 46 | factory PopupMenuEntry.fromJson(Map json) => 47 | _$PopupMenuEntryFromJson(json); 48 | } 49 | -------------------------------------------------------------------------------- /lib/widgets/preferred_size_widget.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [PreferredSizeWidget](https://api.flutter.dev/flutter/widgets/PreferredSizeWidget-class.html) class in the Flutter SDK. 2 | library preferred_size_widget; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'border_radius.dart'; 7 | import 'callback.dart'; 8 | import 'color.dart'; 9 | import 'decoration.dart'; 10 | import 'edge_insets.dart'; 11 | import 'enums.dart'; 12 | import 'key.dart'; 13 | import 'material_state_property.dart'; 14 | import 'mouse_cursor.dart'; 15 | import 'scroll_physics.dart'; 16 | import 'shape_border.dart'; 17 | import 'size.dart'; 18 | import 'text_style.dart'; 19 | import 'widget.dart'; 20 | 21 | part 'preferred_size_widget.freezed.dart'; 22 | part 'preferred_size_widget.g.dart'; 23 | 24 | @freezed 25 | class PreferredSizeWidget with _$PreferredSizeWidget { 26 | const factory PreferredSizeWidget({ 27 | Key? key, 28 | required Size preferredSize, 29 | required Widget child, 30 | }) = PreferredSize; 31 | 32 | const factory PreferredSizeWidget.appBar({ 33 | Key? key, 34 | Widget? leading, 35 | @Default(true) bool automaticallyImplyLeading, 36 | Widget? title, 37 | List? actions, 38 | Widget? flexibleSpace, 39 | PreferredSizeWidget? bottom, 40 | double? elevation, 41 | double? scrolledUnderElevation, 42 | Color? shadowColor, 43 | Color? surfaceTintColor, 44 | ShapeBorder? shape, 45 | Color? backgroundColor, 46 | Color? foregroundColor, 47 | @Default(true) bool primary, 48 | bool? centerTitle, 49 | @Default(false) bool excludeHeaderSemantics, 50 | double? titleSpacing, 51 | @Default(1.0) double toolbarOpacity, 52 | @Default(1.0) double bottomOpacity, 53 | double? toolbarHeight, 54 | double? leadingWidth, 55 | TextStyle? toolbarTextStyle, 56 | TextStyle? titleTextStyle, 57 | @Default(false) bool forceMaterialTransparency, 58 | }) = AppBar; 59 | 60 | const factory PreferredSizeWidget.tabBar({ 61 | Key? key, 62 | required List tabs, 63 | @Default(false) bool isScrollable, 64 | IntSelectionCallback? onTap, 65 | EdgeInsets? padding, 66 | Color? indicatorColor, 67 | @Default(true) bool automaticIndicatorColorAdjustment, 68 | @Default(2.0) double indicatorWeight, 69 | @Default(EdgeInsets.zero) EdgeInsets indicatorPadding, 70 | Decoration? indicator, 71 | TabBarIndicatorSize? indicatorSize, 72 | Color? dividerColor, 73 | Color? labelColor, 74 | TextStyle? labelStyle, 75 | EdgeInsets? labelPadding, 76 | Color? unselectedLabelColor, 77 | TextStyle? unselectedLabelStyle, 78 | @Default(DragStartBehavior.start) DragStartBehavior dragStartBehavior, 79 | MaterialStateProperty? overlayColor, 80 | MouseCursor? mouseCursor, 81 | bool? enableFeedback, 82 | ScrollPhysics? physics, 83 | BorderRadius? splashBorderRadius, 84 | }) = TabBar; 85 | 86 | factory PreferredSizeWidget.fromJson(Map json) => 87 | _$PreferredSizeWidgetFromJson(json); 88 | } 89 | -------------------------------------------------------------------------------- /lib/widgets/radius.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [Radius](https://api.flutter.dev/flutter/dart-ui/Radius-class.html) class in the Flutter SDK. 2 | library radius; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'radius.freezed.dart'; 7 | part 'radius.g.dart'; 8 | 9 | @freezed 10 | class Radius with _$Radius { 11 | const factory Radius.circular( 12 | double radius, 13 | ) = RadiusCircular; 14 | 15 | const factory Radius.elliptical( 16 | double x, 17 | double y, 18 | ) = RadiusElliptical; 19 | 20 | static const Radius zero = Radius.circular(0.0); 21 | 22 | factory Radius.fromJson(Map json) => _$RadiusFromJson(json); 23 | } 24 | -------------------------------------------------------------------------------- /lib/widgets/radius.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of radius; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$RadiusCircular _$$RadiusCircularFromJson(Map json) => 10 | _$RadiusCircular( 11 | (json['radius'] as num).toDouble(), 12 | $type: json['runtimeType'] as String?, 13 | ); 14 | 15 | const _$$RadiusCircularFieldMap = { 16 | 'radius': 'radius', 17 | r'$type': 'runtimeType', 18 | }; 19 | 20 | Map _$$RadiusCircularToJson(_$RadiusCircular instance) => 21 | { 22 | 'radius': instance.radius, 23 | 'runtimeType': instance.$type, 24 | }; 25 | 26 | _$RadiusElliptical _$$RadiusEllipticalFromJson(Map json) => 27 | _$RadiusElliptical( 28 | (json['x'] as num).toDouble(), 29 | (json['y'] as num).toDouble(), 30 | $type: json['runtimeType'] as String?, 31 | ); 32 | 33 | const _$$RadiusEllipticalFieldMap = { 34 | 'x': 'x', 35 | 'y': 'y', 36 | r'$type': 'runtimeType', 37 | }; 38 | 39 | Map _$$RadiusEllipticalToJson(_$RadiusElliptical instance) => 40 | { 41 | 'x': instance.x, 42 | 'y': instance.y, 43 | 'runtimeType': instance.$type, 44 | }; 45 | -------------------------------------------------------------------------------- /lib/widgets/rect.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [Rect](https://api.flutter.dev/flutter/dart-ui/Rect-class.html) class in the Flutter SDK. 2 | library rect; 3 | 4 | import 'dart:math'; 5 | import 'package:freezed_annotation/freezed_annotation.dart'; 6 | 7 | import 'offset.dart'; 8 | 9 | part 'rect.freezed.dart'; 10 | part 'rect.g.dart'; 11 | 12 | @freezed 13 | class Rect with _$Rect { 14 | const factory Rect( 15 | double left, 16 | double top, 17 | double right, 18 | double bottom, 19 | ) = _Rect; 20 | 21 | static const Rect zero = Rect(0.0, 0.0, 0.0, 0.0); 22 | 23 | static Rect fromLTWH(double left, double top, double width, double height) => 24 | Rect(left, top, left + width, top + height); 25 | 26 | static Rect fromCircle({ 27 | required double x, 28 | required double y, 29 | required double radius, 30 | }) => 31 | Rect(x - radius, y - radius, x + radius, y + radius); 32 | 33 | static Rect fromPoints(Offset a, Offset b) => 34 | Rect(min(a.dx, b.dx), min(a.dy, b.dy), max(a.dx, b.dx), max(a.dy, b.dy)); 35 | 36 | static Rect fromCenter({ 37 | required double x, 38 | required double y, 39 | required double width, 40 | required double height, 41 | }) => 42 | Rect.fromLTWH(x - width / 2, y - height / 2, width, height); 43 | 44 | static Rect fromLTRB(double left, double top, double right, double bottom) => 45 | Rect(left, top, right, bottom); 46 | 47 | factory Rect.fromJson(Map json) => _$RectFromJson(json); 48 | } 49 | -------------------------------------------------------------------------------- /lib/widgets/rect.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of rect; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_Rect _$$_RectFromJson(Map json) => _$_Rect( 10 | (json['left'] as num).toDouble(), 11 | (json['top'] as num).toDouble(), 12 | (json['right'] as num).toDouble(), 13 | (json['bottom'] as num).toDouble(), 14 | ); 15 | 16 | const _$$_RectFieldMap = { 17 | 'left': 'left', 18 | 'top': 'top', 19 | 'right': 'right', 20 | 'bottom': 'bottom', 21 | }; 22 | 23 | Map _$$_RectToJson(_$_Rect instance) => { 24 | 'left': instance.left, 25 | 'top': instance.top, 26 | 'right': instance.right, 27 | 'bottom': instance.bottom, 28 | }; 29 | -------------------------------------------------------------------------------- /lib/widgets/scroll_physics.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [ScrollPhysics](https://api.flutter.dev/flutter/widgets/ScrollPhysics-class.html) class in the Flutter SDK. 2 | library scroll_physics; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'enums.dart'; 7 | 8 | part 'scroll_physics.freezed.dart'; 9 | part 'scroll_physics.g.dart'; 10 | 11 | @freezed 12 | class ScrollPhysics with _$ScrollPhysics { 13 | const factory ScrollPhysics({ScrollPhysics? parent}) = _ScrollPhysics; 14 | const factory ScrollPhysics.rangeMaintaining({ScrollPhysics? parent}) = 15 | RangeMaintainingScrollPhysics; 16 | const factory ScrollPhysics.bouncingScroll( 17 | {@Default(ScrollDecelerationRate.normal) 18 | ScrollDecelerationRate decelerationRate, 19 | ScrollPhysics? parent}) = BouncingScrollScrollPhysics; 20 | const factory ScrollPhysics.clamping({ScrollPhysics? parent}) = 21 | ClampingScrollPhysics; 22 | const factory ScrollPhysics.alwaysScrollable({ScrollPhysics? parent}) = 23 | AlwaysScrollableScrollPhysics; 24 | const factory ScrollPhysics.neverScrollable({ScrollPhysics? parent}) = 25 | NeverScrollableScrollPhysics; 26 | const factory ScrollPhysics.pageScroll({ScrollPhysics? parent}) = 27 | PageScrollPhysics; 28 | const factory ScrollPhysics.fixedExtent({ScrollPhysics? parent}) = 29 | FixedExtentScrollPhysics; 30 | 31 | factory ScrollPhysics.fromJson(Map json) => 32 | _$ScrollPhysicsFromJson(json); 33 | } 34 | -------------------------------------------------------------------------------- /lib/widgets/shadow.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [Shadow](https://api.flutter.dev/flutter/dart-ui/Shadow-class.html) class in the Flutter SDK. 2 | library shadow; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'color.dart'; 7 | import 'enums.dart'; 8 | import 'offset.dart'; 9 | 10 | part 'shadow.freezed.dart'; 11 | part 'shadow.g.dart'; 12 | 13 | @freezed 14 | class Shadow with _$Shadow { 15 | const factory Shadow({ 16 | @Default(Color(0xFF000000)) Color color, 17 | @Default(Offset.zero) Offset offset, 18 | @Default(0.0) double blurRadius, 19 | }) = _Shadow; 20 | 21 | const factory Shadow.box({ 22 | @Default(Color(0xFF000000)) Color color, 23 | @Default(Offset.zero) Offset offset, 24 | @Default(0.0) double blurRadius, 25 | @Default(0.0) double spreadRadius, 26 | @Default(BlurStyle.normal) BlurStyle blurStyle, 27 | }) = BoxShadow; 28 | 29 | factory Shadow.fromJson(Map json) => _$ShadowFromJson(json); 30 | } 31 | -------------------------------------------------------------------------------- /lib/widgets/shadow.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of shadow; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_Shadow _$$_ShadowFromJson(Map json) => _$_Shadow( 10 | color: json['color'] == null 11 | ? const Color(0xFF000000) 12 | : Color.fromJson(json['color'] as Map), 13 | offset: json['offset'] == null 14 | ? Offset.zero 15 | : Offset.fromJson(json['offset'] as Map), 16 | blurRadius: (json['blurRadius'] as num?)?.toDouble() ?? 0.0, 17 | $type: json['runtimeType'] as String?, 18 | ); 19 | 20 | const _$$_ShadowFieldMap = { 21 | 'color': 'color', 22 | 'offset': 'offset', 23 | 'blurRadius': 'blurRadius', 24 | r'$type': 'runtimeType', 25 | }; 26 | 27 | Map _$$_ShadowToJson(_$_Shadow instance) => { 28 | 'color': instance.color, 29 | 'offset': instance.offset, 30 | 'blurRadius': instance.blurRadius, 31 | 'runtimeType': instance.$type, 32 | }; 33 | 34 | _$BoxShadow _$$BoxShadowFromJson(Map json) => _$BoxShadow( 35 | color: json['color'] == null 36 | ? const Color(0xFF000000) 37 | : Color.fromJson(json['color'] as Map), 38 | offset: json['offset'] == null 39 | ? Offset.zero 40 | : Offset.fromJson(json['offset'] as Map), 41 | blurRadius: (json['blurRadius'] as num?)?.toDouble() ?? 0.0, 42 | spreadRadius: (json['spreadRadius'] as num?)?.toDouble() ?? 0.0, 43 | blurStyle: $enumDecodeNullable(_$BlurStyleEnumMap, json['blurStyle']) ?? 44 | BlurStyle.normal, 45 | $type: json['runtimeType'] as String?, 46 | ); 47 | 48 | const _$$BoxShadowFieldMap = { 49 | 'color': 'color', 50 | 'offset': 'offset', 51 | 'blurRadius': 'blurRadius', 52 | 'spreadRadius': 'spreadRadius', 53 | 'blurStyle': 'blurStyle', 54 | r'$type': 'runtimeType', 55 | }; 56 | 57 | Map _$$BoxShadowToJson(_$BoxShadow instance) => 58 | { 59 | 'color': instance.color, 60 | 'offset': instance.offset, 61 | 'blurRadius': instance.blurRadius, 62 | 'spreadRadius': instance.spreadRadius, 63 | 'blurStyle': _$BlurStyleEnumMap[instance.blurStyle]!, 64 | 'runtimeType': instance.$type, 65 | }; 66 | 67 | const _$BlurStyleEnumMap = { 68 | BlurStyle.normal: 'normal', 69 | BlurStyle.solid: 'solid', 70 | BlurStyle.outer: 'outer', 71 | BlurStyle.inner: 'inner', 72 | }; 73 | -------------------------------------------------------------------------------- /lib/widgets/size.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [Size](https://api.flutter.dev/flutter/dart-ui/Size-class.html) class in the Flutter SDK. 2 | library size; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'size.freezed.dart'; 7 | part 'size.g.dart'; 8 | 9 | @freezed 10 | class Size with _$Size { 11 | const factory Size(double width, double height) = _Size; 12 | 13 | static const Size zero = Size(0.0, 0.0); 14 | 15 | factory Size.fromJson(Map json) => _$SizeFromJson(json); 16 | } 17 | -------------------------------------------------------------------------------- /lib/widgets/size.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of size; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_Size _$$_SizeFromJson(Map json) => _$_Size( 10 | (json['width'] as num).toDouble(), 11 | (json['height'] as num).toDouble(), 12 | ); 13 | 14 | const _$$_SizeFieldMap = { 15 | 'width': 'width', 16 | 'height': 'height', 17 | }; 18 | 19 | Map _$$_SizeToJson(_$_Size instance) => { 20 | 'width': instance.width, 21 | 'height': instance.height, 22 | }; 23 | -------------------------------------------------------------------------------- /lib/widgets/sliver_child_delegate.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [SliverChildDelegate](https://api.flutter.dev/flutter/widgets/SliverChildDelegate-class.html) class in the Flutter SDK. 2 | library sliver_child_delegate; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'widget.dart'; 7 | 8 | part 'sliver_child_delegate.freezed.dart'; 9 | part 'sliver_child_delegate.g.dart'; 10 | 11 | @freezed 12 | class SliverChildDelegate with _$SliverChildDelegate { 13 | const factory SliverChildDelegate.fixed( 14 | List children, { 15 | @Default(true) bool addAutomaticKeepAlives, 16 | @Default(true) bool addRepaintBoundaries, 17 | @Default(true) bool addSemanticIndexes, 18 | @Default(0) int semanticIndexOffset, 19 | }) = SliverChildListDelegateFixed; 20 | 21 | factory SliverChildDelegate.fromJson(Map json) => 22 | _$SliverChildDelegateFromJson(json); 23 | } 24 | -------------------------------------------------------------------------------- /lib/widgets/sliver_child_delegate.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of sliver_child_delegate; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$SliverChildListDelegateFixed _$$SliverChildListDelegateFixedFromJson( 10 | Map json) => 11 | _$SliverChildListDelegateFixed( 12 | (json['children'] as List) 13 | .map((e) => Widget.fromJson(e as Map)) 14 | .toList(), 15 | addAutomaticKeepAlives: json['addAutomaticKeepAlives'] as bool? ?? true, 16 | addRepaintBoundaries: json['addRepaintBoundaries'] as bool? ?? true, 17 | addSemanticIndexes: json['addSemanticIndexes'] as bool? ?? true, 18 | semanticIndexOffset: json['semanticIndexOffset'] as int? ?? 0, 19 | ); 20 | 21 | const _$$SliverChildListDelegateFixedFieldMap = { 22 | 'children': 'children', 23 | 'addAutomaticKeepAlives': 'addAutomaticKeepAlives', 24 | 'addRepaintBoundaries': 'addRepaintBoundaries', 25 | 'addSemanticIndexes': 'addSemanticIndexes', 26 | 'semanticIndexOffset': 'semanticIndexOffset', 27 | }; 28 | 29 | Map _$$SliverChildListDelegateFixedToJson( 30 | _$SliverChildListDelegateFixed instance) => 31 | { 32 | 'children': instance.children, 33 | 'addAutomaticKeepAlives': instance.addAutomaticKeepAlives, 34 | 'addRepaintBoundaries': instance.addRepaintBoundaries, 35 | 'addSemanticIndexes': instance.addSemanticIndexes, 36 | 'semanticIndexOffset': instance.semanticIndexOffset, 37 | }; 38 | -------------------------------------------------------------------------------- /lib/widgets/sliver_grid_delegate.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [SliverGridDelegate](https://api.flutter.dev/flutter/rendering/SliverGridDelegate-class.html) class in the Flutter SDK. 2 | library sliver_grid_delegate; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'sliver_grid_delegate.freezed.dart'; 7 | part 'sliver_grid_delegate.g.dart'; 8 | 9 | @freezed 10 | class SliverGridDelegate with _$SliverGridDelegate { 11 | const factory SliverGridDelegate.count({ 12 | required int crossAxisCount, 13 | @Default(0.0) double mainAxisSpacing, 14 | @Default(0.0) double crossAxisSpacing, 15 | @Default(1.0) double childAspectRatio, 16 | double? mainAxisExtent, 17 | }) = SliverGridDelegateWithFixedCrossAxisCount; 18 | 19 | const factory SliverGridDelegate.extend({ 20 | required double maxCrossAxisExtent, 21 | @Default(0.0) double mainAxisSpacing, 22 | @Default(0.0) double crossAxisSpacing, 23 | @Default(1.0) double childAspectRatio, 24 | double? mainAxisExtent, 25 | }) = SliverGridDelegateWithMaxCrossAxisExtent; 26 | 27 | factory SliverGridDelegate.fromJson(Map json) => 28 | _$SliverGridDelegateFromJson(json); 29 | } 30 | -------------------------------------------------------------------------------- /lib/widgets/snack_bar.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [SnackBar](https://api.flutter.dev/flutter/material/SnackBar-class.html) class in the Flutter SDK. 2 | library snack_bar; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'callback.dart'; 7 | import 'color.dart'; 8 | import 'edge_insets.dart'; 9 | import 'enums.dart'; 10 | import 'key.dart'; 11 | import 'shape_border.dart'; 12 | import 'snack_bar_action.dart'; 13 | import 'widget.dart'; 14 | 15 | part 'snack_bar.freezed.dart'; 16 | part 'snack_bar.g.dart'; 17 | 18 | @freezed 19 | class SnackBar with _$SnackBar { 20 | const factory SnackBar({ 21 | Key? key, 22 | required Widget content, 23 | Color? backgroundColor, 24 | double? elevation, 25 | EdgeInsets? margin, 26 | EdgeInsets? padding, 27 | double? width, 28 | ShapeBorder? shape, 29 | SnackBarBehavior? behavior, 30 | SnackBarAction? action, 31 | bool? showCloseIcon, 32 | Color? closeIconColor, 33 | @Default(Duration(milliseconds: 4000)) Duration duration, 34 | Callback? onVisible, 35 | @Default(DismissDirection.down) DismissDirection dismissDirection, 36 | @Default(Clip.hardEdge) Clip clipBehavior, 37 | }) = _SnackBar; 38 | 39 | factory SnackBar.fromJson(Map json) => 40 | _$SnackBarFromJson(json); 41 | } 42 | -------------------------------------------------------------------------------- /lib/widgets/snack_bar_action.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [SnackBarAction](https://api.flutter.dev/flutter/material/SnackBarAction-class.html) class in the Flutter SDK. 2 | library snack_bar_action; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'callback.dart'; 7 | import 'color.dart'; 8 | import 'key.dart'; 9 | 10 | part 'snack_bar_action.freezed.dart'; 11 | part 'snack_bar_action.g.dart'; 12 | 13 | @freezed 14 | class SnackBarAction with _$SnackBarAction { 15 | const factory SnackBarAction({ 16 | Key? key, 17 | Color? textColor, 18 | Color? disabledTextColor, 19 | required String label, 20 | required Callback onPressed, 21 | }) = _SnackBarAction; 22 | 23 | factory SnackBarAction.fromJson(Map json) => 24 | _$SnackBarActionFromJson(json); 25 | } 26 | -------------------------------------------------------------------------------- /lib/widgets/snack_bar_action.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of snack_bar_action; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_SnackBarAction _$$_SnackBarActionFromJson(Map json) => 10 | _$_SnackBarAction( 11 | key: json['key'] == null 12 | ? null 13 | : Key.fromJson(json['key'] as Map), 14 | textColor: json['textColor'] == null 15 | ? null 16 | : Color.fromJson(json['textColor'] as Map), 17 | disabledTextColor: json['disabledTextColor'] == null 18 | ? null 19 | : Color.fromJson(json['disabledTextColor'] as Map), 20 | label: json['label'] as String, 21 | onPressed: Callback.fromJson(json['onPressed'] as Map), 22 | ); 23 | 24 | const _$$_SnackBarActionFieldMap = { 25 | 'key': 'key', 26 | 'textColor': 'textColor', 27 | 'disabledTextColor': 'disabledTextColor', 28 | 'label': 'label', 29 | 'onPressed': 'onPressed', 30 | }; 31 | 32 | Map _$$_SnackBarActionToJson(_$_SnackBarAction instance) { 33 | final val = {}; 34 | 35 | void writeNotNull(String key, dynamic value) { 36 | if (value != null) { 37 | val[key] = value; 38 | } 39 | } 40 | 41 | writeNotNull('key', instance.key); 42 | writeNotNull('textColor', instance.textColor); 43 | writeNotNull('disabledTextColor', instance.disabledTextColor); 44 | val['label'] = instance.label; 45 | val['onPressed'] = instance.onPressed; 46 | return val; 47 | } 48 | -------------------------------------------------------------------------------- /lib/widgets/strut_style.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [StrutStyle](https://api.flutter.dev/flutter/painting/StrutStyle-class.html) class in the Flutter SDK. 2 | library strut_style; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'enums.dart'; 7 | import 'font_weight.dart'; 8 | 9 | part 'strut_style.freezed.dart'; 10 | part 'strut_style.g.dart'; 11 | 12 | @freezed 13 | class StrutStyle with _$StrutStyle { 14 | const factory StrutStyle({ 15 | String? fontFamily, 16 | List? fontFamilyFallback, 17 | double? fontSize, 18 | double? height, 19 | TextLeadingDistribution? leadingDistribution, 20 | double? leading, 21 | FontWeight? fontWeight, 22 | FontStyle? fontStyle, 23 | bool? forceStrutHeight, 24 | String? debugLabel, 25 | String? package, 26 | }) = _StrutStyle; 27 | 28 | factory StrutStyle.fromJson(Map json) => 29 | _$StrutStyleFromJson(json); 30 | } 31 | -------------------------------------------------------------------------------- /lib/widgets/strut_style.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of strut_style; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_StrutStyle _$$_StrutStyleFromJson(Map json) => 10 | _$_StrutStyle( 11 | fontFamily: json['fontFamily'] as String?, 12 | fontFamilyFallback: (json['fontFamilyFallback'] as List?) 13 | ?.map((e) => e as String) 14 | .toList(), 15 | fontSize: (json['fontSize'] as num?)?.toDouble(), 16 | height: (json['height'] as num?)?.toDouble(), 17 | leadingDistribution: $enumDecodeNullable( 18 | _$TextLeadingDistributionEnumMap, json['leadingDistribution']), 19 | leading: (json['leading'] as num?)?.toDouble(), 20 | fontWeight: json['fontWeight'] == null 21 | ? null 22 | : FontWeight.fromJson(json['fontWeight'] as Map), 23 | fontStyle: $enumDecodeNullable(_$FontStyleEnumMap, json['fontStyle']), 24 | forceStrutHeight: json['forceStrutHeight'] as bool?, 25 | debugLabel: json['debugLabel'] as String?, 26 | package: json['package'] as String?, 27 | ); 28 | 29 | const _$$_StrutStyleFieldMap = { 30 | 'fontFamily': 'fontFamily', 31 | 'fontFamilyFallback': 'fontFamilyFallback', 32 | 'fontSize': 'fontSize', 33 | 'height': 'height', 34 | 'leadingDistribution': 'leadingDistribution', 35 | 'leading': 'leading', 36 | 'fontWeight': 'fontWeight', 37 | 'fontStyle': 'fontStyle', 38 | 'forceStrutHeight': 'forceStrutHeight', 39 | 'debugLabel': 'debugLabel', 40 | 'package': 'package', 41 | }; 42 | 43 | Map _$$_StrutStyleToJson(_$_StrutStyle instance) { 44 | final val = {}; 45 | 46 | void writeNotNull(String key, dynamic value) { 47 | if (value != null) { 48 | val[key] = value; 49 | } 50 | } 51 | 52 | writeNotNull('fontFamily', instance.fontFamily); 53 | writeNotNull('fontFamilyFallback', instance.fontFamilyFallback); 54 | writeNotNull('fontSize', instance.fontSize); 55 | writeNotNull('height', instance.height); 56 | writeNotNull('leadingDistribution', 57 | _$TextLeadingDistributionEnumMap[instance.leadingDistribution]); 58 | writeNotNull('leading', instance.leading); 59 | writeNotNull('fontWeight', instance.fontWeight); 60 | writeNotNull('fontStyle', _$FontStyleEnumMap[instance.fontStyle]); 61 | writeNotNull('forceStrutHeight', instance.forceStrutHeight); 62 | writeNotNull('debugLabel', instance.debugLabel); 63 | writeNotNull('package', instance.package); 64 | return val; 65 | } 66 | 67 | const _$TextLeadingDistributionEnumMap = { 68 | TextLeadingDistribution.proportional: 'proportional', 69 | TextLeadingDistribution.even: 'even', 70 | }; 71 | 72 | const _$FontStyleEnumMap = { 73 | FontStyle.normal: 'normal', 74 | FontStyle.italic: 'italic', 75 | }; 76 | -------------------------------------------------------------------------------- /lib/widgets/table_border.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [TableBorder](https://api.flutter.dev/flutter/rendering/TableBorder-class.html) class in the Flutter SDK. 2 | library table_border; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'border_radius.dart'; 7 | import 'border_side.dart'; 8 | import 'color.dart'; 9 | import 'enums.dart'; 10 | 11 | part 'table_border.freezed.dart'; 12 | part 'table_border.g.dart'; 13 | 14 | @freezed 15 | class TableBorder with _$TableBorder { 16 | const factory TableBorder({ 17 | @Default(BorderSide.none) BorderSide top, 18 | @Default(BorderSide.none) BorderSide right, 19 | @Default(BorderSide.none) BorderSide bottom, 20 | @Default(BorderSide.none) BorderSide left, 21 | @Default(BorderSide.none) BorderSide horizontalInside, 22 | @Default(BorderSide.none) BorderSide verticalInside, 23 | @Default(BorderRadius.zero) BorderRadius borderRadius, 24 | }) = _TableBorder; 25 | 26 | const factory TableBorder.all({ 27 | @Default(Color(0xFF000000)) Color color, 28 | @Default(1.0) double width, 29 | @Default(BorderStyle.solid) BorderStyle style, 30 | @Default(BorderRadius.zero) BorderRadius borderRadius, 31 | }) = TableBorderAll; 32 | 33 | const factory TableBorder.symmetric({ 34 | @Default(BorderSide.none) BorderSide inside, 35 | @Default(BorderSide.none) BorderSide outside, 36 | }) = TableBorderSymmetric; 37 | 38 | factory TableBorder.fromJson(Map json) => 39 | _$TableBorderFromJson(json); 40 | } 41 | -------------------------------------------------------------------------------- /lib/widgets/table_column_width.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [TableColumnWidth](https://api.flutter.dev/flutter/rendering/TableColumnWidth-class.html) class in the Flutter SDK. 2 | library table_column_width; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'table_column_width.freezed.dart'; 7 | part 'table_column_width.g.dart'; 8 | 9 | @freezed 10 | class TableColumnWidth with _$TableColumnWidth { 11 | const factory TableColumnWidth.intrinsic({double? flex}) = 12 | IntrinsicColumnWidth; 13 | 14 | const factory TableColumnWidth.fixed(double value) = FixedColumnWidth; 15 | 16 | const factory TableColumnWidth.fraction(double value) = FractionColumnWidth; 17 | 18 | const factory TableColumnWidth.flex([@Default(1.0) double value]) = 19 | FlexColumnWidth; 20 | 21 | const factory TableColumnWidth.max(TableColumnWidth a, TableColumnWidth b) = 22 | MaxColumnWidth; 23 | 24 | const factory TableColumnWidth.min(TableColumnWidth a, TableColumnWidth b) = 25 | MinColumnWidth; 26 | 27 | factory TableColumnWidth.fromJson(Map json) => 28 | _$TableColumnWidthFromJson(json); 29 | } 30 | -------------------------------------------------------------------------------- /lib/widgets/table_row.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [TableRow](https://api.flutter.dev/flutter/widgets/TableRow-class.html) class in the Flutter SDK. 2 | library table_row; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'decoration.dart'; 7 | import 'key.dart'; 8 | import 'widget.dart'; 9 | 10 | part 'table_row.freezed.dart'; 11 | part 'table_row.g.dart'; 12 | 13 | @freezed 14 | class TableRow with _$TableRow { 15 | const factory TableRow({ 16 | Key? key, 17 | Decoration? decoration, 18 | List? children, 19 | }) = _TableRow; 20 | 21 | factory TableRow.fromJson(Map json) => 22 | _$TableRowFromJson(json); 23 | } 24 | -------------------------------------------------------------------------------- /lib/widgets/table_row.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of table_row; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_TableRow _$$_TableRowFromJson(Map json) => _$_TableRow( 10 | key: json['key'] == null 11 | ? null 12 | : Key.fromJson(json['key'] as Map), 13 | decoration: json['decoration'] == null 14 | ? null 15 | : Decoration.fromJson(json['decoration'] as Map), 16 | children: (json['children'] as List?) 17 | ?.map((e) => Widget.fromJson(e as Map)) 18 | .toList(), 19 | ); 20 | 21 | const _$$_TableRowFieldMap = { 22 | 'key': 'key', 23 | 'decoration': 'decoration', 24 | 'children': 'children', 25 | }; 26 | 27 | Map _$$_TableRowToJson(_$_TableRow instance) { 28 | final val = {}; 29 | 30 | void writeNotNull(String key, dynamic value) { 31 | if (value != null) { 32 | val[key] = value; 33 | } 34 | } 35 | 36 | writeNotNull('key', instance.key); 37 | writeNotNull('decoration', instance.decoration); 38 | writeNotNull('children', instance.children); 39 | return val; 40 | } 41 | -------------------------------------------------------------------------------- /lib/widgets/text_align_vertical.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [TextAlignVertical](https://api.flutter.dev/flutter/painting/TextAlignVertical-class.html) class in the Flutter SDK. 2 | library text_align_vertical; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'text_align_vertical.freezed.dart'; 7 | part 'text_align_vertical.g.dart'; 8 | 9 | @freezed 10 | class TextAlignVertical with _$TextAlignVertical { 11 | const factory TextAlignVertical({ 12 | required double y, 13 | }) = _TextAlignVertical; 14 | 15 | static const TextAlignVertical top = TextAlignVertical(y: -1.0); 16 | static const TextAlignVertical center = TextAlignVertical(y: 0.0); 17 | static const TextAlignVertical bottom = TextAlignVertical(y: 1.0); 18 | 19 | factory TextAlignVertical.fromJson(Map json) => 20 | _$TextAlignVerticalFromJson(json); 21 | } 22 | -------------------------------------------------------------------------------- /lib/widgets/text_align_vertical.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of text_align_vertical; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_TextAlignVertical _$$_TextAlignVerticalFromJson(Map json) => 10 | _$_TextAlignVertical( 11 | y: (json['y'] as num).toDouble(), 12 | ); 13 | 14 | const _$$_TextAlignVerticalFieldMap = { 15 | 'y': 'y', 16 | }; 17 | 18 | Map _$$_TextAlignVerticalToJson( 19 | _$_TextAlignVertical instance) => 20 | { 21 | 'y': instance.y, 22 | }; 23 | -------------------------------------------------------------------------------- /lib/widgets/text_decoration.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [TextDecoration](https://api.flutter.dev/flutter/dart-ui/TextDecoration-class.html) class in the Flutter SDK. 2 | library text_decoration; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'text_decoration.freezed.dart'; 7 | part 'text_decoration.g.dart'; 8 | 9 | @freezed 10 | class TextDecoration with _$TextDecoration { 11 | const TextDecoration._(); 12 | 13 | const factory TextDecoration.none() = TextDecorationNone; 14 | const factory TextDecoration.underline() = TextDecorationUnderline; 15 | const factory TextDecoration.overline() = TextDecorationOverline; 16 | const factory TextDecoration.lineThrough() = TextDecorationLineThrough; 17 | 18 | factory TextDecoration.fromJson(Map json) => 19 | _$TextDecorationFromJson(json); 20 | } 21 | -------------------------------------------------------------------------------- /lib/widgets/text_decoration.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of text_decoration; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$TextDecorationNone _$$TextDecorationNoneFromJson(Map json) => 10 | _$TextDecorationNone( 11 | $type: json['runtimeType'] as String?, 12 | ); 13 | 14 | const _$$TextDecorationNoneFieldMap = { 15 | r'$type': 'runtimeType', 16 | }; 17 | 18 | Map _$$TextDecorationNoneToJson( 19 | _$TextDecorationNone instance) => 20 | { 21 | 'runtimeType': instance.$type, 22 | }; 23 | 24 | _$TextDecorationUnderline _$$TextDecorationUnderlineFromJson( 25 | Map json) => 26 | _$TextDecorationUnderline( 27 | $type: json['runtimeType'] as String?, 28 | ); 29 | 30 | const _$$TextDecorationUnderlineFieldMap = { 31 | r'$type': 'runtimeType', 32 | }; 33 | 34 | Map _$$TextDecorationUnderlineToJson( 35 | _$TextDecorationUnderline instance) => 36 | { 37 | 'runtimeType': instance.$type, 38 | }; 39 | 40 | _$TextDecorationOverline _$$TextDecorationOverlineFromJson( 41 | Map json) => 42 | _$TextDecorationOverline( 43 | $type: json['runtimeType'] as String?, 44 | ); 45 | 46 | const _$$TextDecorationOverlineFieldMap = { 47 | r'$type': 'runtimeType', 48 | }; 49 | 50 | Map _$$TextDecorationOverlineToJson( 51 | _$TextDecorationOverline instance) => 52 | { 53 | 'runtimeType': instance.$type, 54 | }; 55 | 56 | _$TextDecorationLineThrough _$$TextDecorationLineThroughFromJson( 57 | Map json) => 58 | _$TextDecorationLineThrough( 59 | $type: json['runtimeType'] as String?, 60 | ); 61 | 62 | const _$$TextDecorationLineThroughFieldMap = { 63 | r'$type': 'runtimeType', 64 | }; 65 | 66 | Map _$$TextDecorationLineThroughToJson( 67 | _$TextDecorationLineThrough instance) => 68 | { 69 | 'runtimeType': instance.$type, 70 | }; 71 | -------------------------------------------------------------------------------- /lib/widgets/text_height_behavior.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [TextHeightBehavior](https://api.flutter.dev/flutter/dart-ui/TextHeightBehavior-class.html) class in the Flutter SDK. 2 | library text_height_behavior; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'enums.dart'; 7 | 8 | part 'text_height_behavior.freezed.dart'; 9 | part 'text_height_behavior.g.dart'; 10 | 11 | @freezed 12 | class TextHeightBehavior with _$TextHeightBehavior { 13 | const factory TextHeightBehavior({ 14 | @Default(true) bool applyHeightToFirstAscent, 15 | @Default(true) bool applyHeightToLastDescent, 16 | @Default(TextLeadingDistribution.proportional) 17 | TextLeadingDistribution leadingDistribution, 18 | }) = _TextHeightBehavior; 19 | 20 | factory TextHeightBehavior.fromJson(Map json) => 21 | _$TextHeightBehaviorFromJson(json); 22 | } 23 | -------------------------------------------------------------------------------- /lib/widgets/text_height_behavior.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of text_height_behavior; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_TextHeightBehavior _$$_TextHeightBehaviorFromJson( 10 | Map json) => 11 | _$_TextHeightBehavior( 12 | applyHeightToFirstAscent: 13 | json['applyHeightToFirstAscent'] as bool? ?? true, 14 | applyHeightToLastDescent: 15 | json['applyHeightToLastDescent'] as bool? ?? true, 16 | leadingDistribution: $enumDecodeNullable( 17 | _$TextLeadingDistributionEnumMap, json['leadingDistribution']) ?? 18 | TextLeadingDistribution.proportional, 19 | ); 20 | 21 | const _$$_TextHeightBehaviorFieldMap = { 22 | 'applyHeightToFirstAscent': 'applyHeightToFirstAscent', 23 | 'applyHeightToLastDescent': 'applyHeightToLastDescent', 24 | 'leadingDistribution': 'leadingDistribution', 25 | }; 26 | 27 | Map _$$_TextHeightBehaviorToJson( 28 | _$_TextHeightBehavior instance) => 29 | { 30 | 'applyHeightToFirstAscent': instance.applyHeightToFirstAscent, 31 | 'applyHeightToLastDescent': instance.applyHeightToLastDescent, 32 | 'leadingDistribution': 33 | _$TextLeadingDistributionEnumMap[instance.leadingDistribution]!, 34 | }; 35 | 36 | const _$TextLeadingDistributionEnumMap = { 37 | TextLeadingDistribution.proportional: 'proportional', 38 | TextLeadingDistribution.even: 'even', 39 | }; 40 | -------------------------------------------------------------------------------- /lib/widgets/text_input_formatter.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [TextInputFormatter](https://api.flutter.dev/flutter/services/TextInputFormatter-class.html) class in the Flutter SDK. 2 | library text_input_formatter; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'enums.dart'; 7 | 8 | part 'text_input_formatter.freezed.dart'; 9 | part 'text_input_formatter.g.dart'; 10 | 11 | @freezed 12 | class TextInputFormatter with _$TextInputFormatter { 13 | const factory TextInputFormatter.lengthLimiting( 14 | int? maxLength, { 15 | MaxLengthEnforcement? maxLengthEnforcement, 16 | }) = LengthLimitingTextInputFormatter; 17 | 18 | const factory TextInputFormatter.filtering( 19 | String filterPattern, { 20 | required bool allow, 21 | @Default('') String replacementString, 22 | }) = FilteringTextInputFormatter; 23 | 24 | const factory TextInputFormatter.filteringAllow( 25 | String filterPattern, { 26 | @Default('') String replacementString, 27 | }) = FilteringAllowTextInputFormatter; 28 | 29 | const factory TextInputFormatter.filteringDeny( 30 | String filterPattern, { 31 | @Default('') String replacementString, 32 | }) = FilteringDenyTextInputFormatter; 33 | 34 | factory TextInputFormatter.fromJson(Map json) => 35 | _$TextInputFormatterFromJson(json); 36 | } 37 | -------------------------------------------------------------------------------- /lib/widgets/text_input_type.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [TextInputType](https://api.flutter.dev/flutter/services/TextInputType-class.html) class in the Flutter SDK. 2 | library text_input_type; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'text_input_type.freezed.dart'; 7 | part 'text_input_type.g.dart'; 8 | 9 | @freezed 10 | class TextInputType with _$TextInputType { 11 | const factory TextInputType.numberWithOptions({ 12 | @Default(false) bool? signed, 13 | @Default(false) bool? decimal, 14 | }) = TextInputTypeNumberWithOptions; 15 | 16 | const factory TextInputType.text() = TextInputTypeText; 17 | const factory TextInputType.multiline() = TextInputTypeMultiline; 18 | const factory TextInputType.number() = TextInputTypeNumber; 19 | const factory TextInputType.phone() = TextInputTypePhone; 20 | const factory TextInputType.datetime() = TextInputTypeDatetime; 21 | const factory TextInputType.emailAddress() = TextInputTypeEmailAddress; 22 | const factory TextInputType.url() = TextInputTypeUrl; 23 | const factory TextInputType.visiblePassword() = TextInputTypeVisiblePassword; 24 | const factory TextInputType.name() = TextInputTypeName; 25 | const factory TextInputType.streetAddress() = TextInputTypeStreetAddress; 26 | const factory TextInputType.none() = TextInputTypeNone; 27 | 28 | static const List values = [ 29 | TextInputType.text(), 30 | TextInputType.multiline(), 31 | TextInputType.number(), 32 | TextInputType.phone(), 33 | TextInputType.datetime(), 34 | TextInputType.emailAddress(), 35 | TextInputType.url(), 36 | TextInputType.visiblePassword(), 37 | TextInputType.name(), 38 | TextInputType.streetAddress(), 39 | TextInputType.none(), 40 | ]; 41 | 42 | factory TextInputType.fromJson(Map json) => 43 | _$TextInputTypeFromJson(json); 44 | } 45 | -------------------------------------------------------------------------------- /lib/widgets/text_theme.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [TextTheme](https://api.flutter.dev/flutter/material/TextTheme-class.html) class in the Flutter SDK. 2 | library text_theme; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'text_style.dart'; 7 | 8 | part 'text_theme.freezed.dart'; 9 | part 'text_theme.g.dart'; 10 | 11 | @freezed 12 | class TextTheme with _$TextTheme { 13 | const factory TextTheme({ 14 | TextStyle? displayLarge, 15 | TextStyle? displayMedium, 16 | TextStyle? displaySmall, 17 | TextStyle? headlineLarge, 18 | TextStyle? headlineMedium, 19 | TextStyle? headlineSmall, 20 | TextStyle? titleLarge, 21 | TextStyle? titleMedium, 22 | TextStyle? titleSmall, 23 | TextStyle? bodyLarge, 24 | TextStyle? bodyMedium, 25 | TextStyle? bodySmall, 26 | TextStyle? labelLarge, 27 | TextStyle? labelMedium, 28 | TextStyle? labelSmall, 29 | }) = _TextTheme; 30 | 31 | factory TextTheme.fromJson(Map json) => 32 | _$TextThemeFromJson(json); 33 | } 34 | -------------------------------------------------------------------------------- /lib/widgets/theme_data.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [ThemeData](https://api.flutter.dev/flutter/material/ThemeData-class.html) class in the Flutter SDK. 2 | library theme_data; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | import 'color.dart'; 7 | import 'color_scheme.dart'; 8 | import 'enums.dart'; 9 | import 'text_theme.dart'; 10 | import 'visual_density.dart'; 11 | 12 | part 'theme_data.freezed.dart'; 13 | part 'theme_data.g.dart'; 14 | 15 | @freezed 16 | class ThemeData with _$ThemeData { 17 | const factory ThemeData({ 18 | bool? applyElevationOverlayColor, 19 | TargetPlatform? platform, 20 | bool? useMaterial3, 21 | VisualDensity? visualDensity, 22 | Brightness? brightness, 23 | Color? canvasColor, 24 | Color? cardColor, 25 | ColorScheme? colorScheme, 26 | Color? colorSchemeSeed, 27 | Color? dialogBackgroundColor, 28 | Color? disabledColor, 29 | Color? dividerColor, 30 | Color? focusColor, 31 | Color? highlightColor, 32 | Color? hintColor, 33 | Color? hoverColor, 34 | Color? indicatorColor, 35 | Color? primaryColor, 36 | Color? primaryColorDark, 37 | Color? primaryColorLight, 38 | MaterialColor? primarySwatch, 39 | Color? scaffoldBackgroundColor, 40 | Color? secondaryHeaderColor, 41 | Color? shadowColor, 42 | Color? splashColor, 43 | Color? unselectedWidgetColor, 44 | String? fontFamily, 45 | List? fontFamilyFallback, 46 | String? package, 47 | TextTheme? textTheme, 48 | }) = _ThemeData; 49 | 50 | factory ThemeData.fromJson(Map json) => 51 | _$ThemeDataFromJson(json); 52 | } 53 | -------------------------------------------------------------------------------- /lib/widgets/visual_density.dart: -------------------------------------------------------------------------------- 1 | /// Based on the [VisualDensity](https://api.flutter.dev/flutter/material/VisualDensity-class.html) class in the Flutter SDK. 2 | library visual_density; 3 | 4 | import 'package:freezed_annotation/freezed_annotation.dart'; 5 | 6 | part 'visual_density.freezed.dart'; 7 | part 'visual_density.g.dart'; 8 | 9 | @freezed 10 | class VisualDensity with _$VisualDensity { 11 | const factory VisualDensity({ 12 | @Default(0.0) double horizontal, 13 | @Default(0.0) double vertical, 14 | }) = _VisualDensity; 15 | 16 | const factory VisualDensity.adaptivePlatformDensity() = 17 | AdaptivePlatformDensity; 18 | 19 | static const VisualDensity standard = VisualDensity(); 20 | 21 | static const VisualDensity comfortable = 22 | VisualDensity(horizontal: -1.0, vertical: -1.0); 23 | 24 | static const VisualDensity compact = 25 | VisualDensity(horizontal: -2.0, vertical: -2.0); 26 | 27 | factory VisualDensity.fromJson(Map json) => 28 | _$VisualDensityFromJson(json); 29 | } 30 | -------------------------------------------------------------------------------- /lib/widgets/visual_density.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of visual_density; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | _$_VisualDensity _$$_VisualDensityFromJson(Map json) => 10 | _$_VisualDensity( 11 | horizontal: (json['horizontal'] as num?)?.toDouble() ?? 0.0, 12 | vertical: (json['vertical'] as num?)?.toDouble() ?? 0.0, 13 | $type: json['runtimeType'] as String?, 14 | ); 15 | 16 | const _$$_VisualDensityFieldMap = { 17 | 'horizontal': 'horizontal', 18 | 'vertical': 'vertical', 19 | r'$type': 'runtimeType', 20 | }; 21 | 22 | Map _$$_VisualDensityToJson(_$_VisualDensity instance) => 23 | { 24 | 'horizontal': instance.horizontal, 25 | 'vertical': instance.vertical, 26 | 'runtimeType': instance.$type, 27 | }; 28 | 29 | _$AdaptivePlatformDensity _$$AdaptivePlatformDensityFromJson( 30 | Map json) => 31 | _$AdaptivePlatformDensity( 32 | $type: json['runtimeType'] as String?, 33 | ); 34 | 35 | const _$$AdaptivePlatformDensityFieldMap = { 36 | r'$type': 'runtimeType', 37 | }; 38 | 39 | Map _$$AdaptivePlatformDensityToJson( 40 | _$AdaptivePlatformDensity instance) => 41 | { 42 | 'runtimeType': instance.$type, 43 | }; 44 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_json_widgets 2 | description: A package for creating flutter widgets from json or dart classes 3 | version: 0.1.3 4 | 5 | environment: 6 | sdk: ">=3.0.0-46.0.dev <4.0.0" 7 | flutter: ">=1.17.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | freezed_annotation: ^2.2.0 13 | json_annotation: ^4.7.0 14 | url_launcher: ^6.1.7 15 | http: ^0.13.5 16 | collection: ^1.17.0 17 | vector_math: ^2.1.4 18 | 19 | dev_dependencies: 20 | flutter_test: 21 | sdk: flutter 22 | flutter_lints: ^2.0.0 23 | build_runner: ^2.3.3 24 | freezed: ^2.3.2 25 | json_serializable: ^6.5.4 26 | 27 | flutter: 28 | 29 | scripts: 30 | rebuild: flutter pub run build_runner build 31 | build: flutter pub run build_runner build --delete-conflicting-outputs 32 | watch: flutter pub run build_runner watch --delete-conflicting-outputs 33 | clean: 34 | - flutter pub run build_runner clean 35 | - find ./lib -name '*.g.dart' -delete 36 | - find ./lib -name '*.freezed.dart' -delete 37 | demo: 38 | - cd example && flutter build web --no-tree-shake-icons 39 | - dart doc -o example/build/web/docs 40 | - dhttpd --path example/build/web --------------------------------------------------------------------------------