├── .github
└── workflows
│ ├── form_bloc.yml
│ └── form_bloc_web.yml
├── .gitignore
├── README.md
├── form_bloc_web
├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── form_bloc_web
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── res
│ │ │ │ ├── drawable-v21
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values-night
│ │ │ │ └── styles.xml
│ │ │ │ └── values
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ └── settings.gradle
├── assets
│ └── fonts
│ │ ├── JosefinSans-Bold.ttf
│ │ └── JosefinSans-Regular.ttf
├── ios
│ ├── .gitignore
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ ├── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ │ └── LaunchImage.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ └── README.md
│ │ ├── Base.lproj
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── Runner-Bridging-Header.h
│ └── RunnerTests
│ │ └── RunnerTests.swift
├── lib
│ ├── constants
│ │ └── style.dart
│ ├── examples
│ │ ├── all_fields_form.dart
│ │ ├── async_field_validation_form.dart
│ │ ├── conditional_fields_form.dart
│ │ ├── crud_from.dart
│ │ ├── list_fields_form.dart
│ │ ├── loading_and_initializing_form.dart
│ │ ├── serialized_form.dart
│ │ ├── simple_form.dart
│ │ ├── submission_error_to_field_form.dart
│ │ ├── submission_progress_form.dart
│ │ ├── validation_based_on_other_field.dart
│ │ └── wizard_form.dart
│ ├── main.dart
│ ├── pages
│ │ ├── all_fields_form_example_page.dart
│ │ ├── async_field_validation_example_page.dart
│ │ ├── conditional_fields_example_page.dart
│ │ ├── crud_example_page.dart
│ │ ├── home_page.dart
│ │ ├── list_fields_example_page.dart
│ │ ├── loading_and_initializing_example_page.dart
│ │ ├── serialized_form_example_page.dart
│ │ ├── simple_example_page.dart
│ │ ├── submission_error_to_field_example_page.dart
│ │ ├── submission_progress_example_page.dart
│ │ ├── validation_based_on_other_field_example_page.dart
│ │ └── wizard_example_page.dart
│ ├── routes.dart
│ ├── super_bloc_delegate.dart
│ └── widgets
│ │ ├── app_drawer.dart
│ │ ├── app_scaffold.dart
│ │ ├── code_card.dart
│ │ ├── code_screen.dart
│ │ ├── copy_flash.dart
│ │ ├── device_screen.dart
│ │ ├── example_scaffold.dart
│ │ ├── gradient_button.dart
│ │ ├── show_all_code_button.dart
│ │ ├── tutorial_screen.dart
│ │ ├── tutorial_stepper_screen.dart
│ │ ├── tutorial_text.dart
│ │ ├── under_construction.dart
│ │ └── widgets.dart
├── linux
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── flutter
│ │ ├── CMakeLists.txt
│ │ ├── generated_plugin_registrant.cc
│ │ ├── generated_plugin_registrant.h
│ │ └── generated_plugins.cmake
│ ├── main.cc
│ ├── my_application.cc
│ └── my_application.h
├── macos
│ ├── .gitignore
│ ├── Flutter
│ │ ├── Flutter-Debug.xcconfig
│ │ ├── Flutter-Release.xcconfig
│ │ └── GeneratedPluginRegistrant.swift
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── app_icon_1024.png
│ │ │ │ ├── app_icon_128.png
│ │ │ │ ├── app_icon_16.png
│ │ │ │ ├── app_icon_256.png
│ │ │ │ ├── app_icon_32.png
│ │ │ │ ├── app_icon_512.png
│ │ │ │ └── app_icon_64.png
│ │ ├── Base.lproj
│ │ │ └── MainMenu.xib
│ │ ├── Configs
│ │ │ ├── AppInfo.xcconfig
│ │ │ ├── Debug.xcconfig
│ │ │ ├── Release.xcconfig
│ │ │ └── Warnings.xcconfig
│ │ ├── DebugProfile.entitlements
│ │ ├── Info.plist
│ │ ├── MainFlutterWindow.swift
│ │ └── Release.entitlements
│ └── RunnerTests
│ │ └── RunnerTests.swift
├── 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
├── melos.yaml
├── packages
├── flutter_form_bloc
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── example
│ │ ├── .gitignore
│ │ ├── .metadata
│ │ ├── README.md
│ │ ├── 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
│ │ ├── ios
│ │ │ ├── .gitignore
│ │ │ ├── Flutter
│ │ │ │ ├── AppFrameworkInfo.plist
│ │ │ │ ├── Debug.xcconfig
│ │ │ │ └── Release.xcconfig
│ │ │ ├── Runner.xcodeproj
│ │ │ │ ├── project.pbxproj
│ │ │ │ ├── project.xcworkspace
│ │ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ │ └── xcshareddata
│ │ │ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ │ │ └── WorkspaceSettings.xcsettings
│ │ │ │ └── xcshareddata
│ │ │ │ │ └── xcschemes
│ │ │ │ │ └── Runner.xcscheme
│ │ │ ├── Runner.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ │ └── WorkspaceSettings.xcsettings
│ │ │ ├── Runner
│ │ │ │ ├── AppDelegate.swift
│ │ │ │ ├── Assets.xcassets
│ │ │ │ │ ├── AppIcon.appiconset
│ │ │ │ │ │ ├── Contents.json
│ │ │ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ │ │ │ └── LaunchImage.imageset
│ │ │ │ │ │ ├── Contents.json
│ │ │ │ │ │ ├── LaunchImage.png
│ │ │ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ │ │ └── README.md
│ │ │ │ ├── Base.lproj
│ │ │ │ │ ├── LaunchScreen.storyboard
│ │ │ │ │ └── Main.storyboard
│ │ │ │ ├── Info.plist
│ │ │ │ └── Runner-Bridging-Header.h
│ │ │ └── RunnerTests
│ │ │ │ └── RunnerTests.swift
│ │ ├── lib
│ │ │ └── main.dart
│ │ ├── linux
│ │ │ ├── .gitignore
│ │ │ ├── CMakeLists.txt
│ │ │ ├── flutter
│ │ │ │ └── CMakeLists.txt
│ │ │ ├── main.cc
│ │ │ ├── my_application.cc
│ │ │ └── my_application.h
│ │ ├── macos
│ │ │ ├── .gitignore
│ │ │ ├── Flutter
│ │ │ │ ├── Flutter-Debug.xcconfig
│ │ │ │ ├── Flutter-Release.xcconfig
│ │ │ │ └── GeneratedPluginRegistrant.swift
│ │ │ ├── Runner.xcodeproj
│ │ │ │ ├── project.pbxproj
│ │ │ │ ├── project.xcworkspace
│ │ │ │ │ └── xcshareddata
│ │ │ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ │ └── xcshareddata
│ │ │ │ │ └── xcschemes
│ │ │ │ │ └── Runner.xcscheme
│ │ │ ├── Runner.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ ├── Runner
│ │ │ │ ├── AppDelegate.swift
│ │ │ │ ├── Assets.xcassets
│ │ │ │ │ └── AppIcon.appiconset
│ │ │ │ │ │ ├── Contents.json
│ │ │ │ │ │ ├── app_icon_1024.png
│ │ │ │ │ │ ├── app_icon_128.png
│ │ │ │ │ │ ├── app_icon_16.png
│ │ │ │ │ │ ├── app_icon_256.png
│ │ │ │ │ │ ├── app_icon_32.png
│ │ │ │ │ │ ├── app_icon_512.png
│ │ │ │ │ │ └── app_icon_64.png
│ │ │ │ ├── Base.lproj
│ │ │ │ │ └── MainMenu.xib
│ │ │ │ ├── Configs
│ │ │ │ │ ├── AppInfo.xcconfig
│ │ │ │ │ ├── Debug.xcconfig
│ │ │ │ │ ├── Release.xcconfig
│ │ │ │ │ └── Warnings.xcconfig
│ │ │ │ ├── DebugProfile.entitlements
│ │ │ │ ├── Info.plist
│ │ │ │ ├── MainFlutterWindow.swift
│ │ │ │ └── Release.entitlements
│ │ │ └── RunnerTests
│ │ │ │ └── RunnerTests.swift
│ │ ├── 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
│ │ │ └── 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_form_bloc.dart
│ │ └── src
│ │ │ ├── checkbox_field_bloc_builder.dart
│ │ │ ├── chip
│ │ │ ├── chip_field_item_builder.dart
│ │ │ ├── choice_chip_field_bloc_builder.dart
│ │ │ └── filter_chip_field_bloc_builder.dart
│ │ │ ├── date_time
│ │ │ ├── date_time_field_bloc_builder.dart
│ │ │ ├── date_time_field_bloc_builder_base.dart
│ │ │ └── time_field_bloc_builder.dart
│ │ │ ├── dropdown_field_bloc_builder.dart
│ │ │ ├── features
│ │ │ ├── appear
│ │ │ │ └── can_show_field_bloc_builder.dart
│ │ │ └── scroll
│ │ │ │ ├── scrollable_field_bloc_target.dart
│ │ │ │ └── scrollable_form_bloc_manager.dart
│ │ │ ├── field_bloc_builder.dart
│ │ │ ├── fields
│ │ │ └── simple_field_bloc_builder.dart
│ │ │ ├── flutter_typeahead.dart
│ │ │ ├── form_bloc_listener.dart
│ │ │ ├── groups
│ │ │ ├── fields
│ │ │ │ ├── checkbox_group_field_bloc_builder.dart
│ │ │ │ └── radio_button_group_field_bloc.dart
│ │ │ └── widgets
│ │ │ │ ├── group_view.dart
│ │ │ │ └── item_group_tile.dart
│ │ │ ├── slider
│ │ │ └── slider_field_bloc_builder.dart
│ │ │ ├── stepper
│ │ │ ├── stepper.dart
│ │ │ └── stepper_form_bloc_builder.dart
│ │ │ ├── suffix_buttons
│ │ │ ├── clear_suffix_button.dart
│ │ │ ├── obscure_suffix_button.dart
│ │ │ └── suffix_button_bloc_builder.dart
│ │ │ ├── switch_field_bloc_builder.dart
│ │ │ ├── text_field_bloc_builder.dart
│ │ │ ├── theme
│ │ │ ├── field_theme_resolver.dart
│ │ │ ├── form_bloc_theme.dart
│ │ │ ├── form_bloc_theme_provider.dart
│ │ │ ├── form_config.dart
│ │ │ ├── material_states.dart
│ │ │ └── suffix_button_themes.dart
│ │ │ └── utils
│ │ │ ├── field_bloc_builder_control_affinity.dart
│ │ │ ├── field_item.dart
│ │ │ ├── functions.dart
│ │ │ ├── style.dart
│ │ │ ├── to_string.dart
│ │ │ ├── typedefs.dart
│ │ │ ├── utils.dart
│ │ │ └── widgets.dart
│ └── pubspec.yaml
└── form_bloc
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── example
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── main.dart
│ └── pubspec.yaml
│ ├── lib
│ ├── form_bloc.dart
│ └── src
│ │ ├── blocs
│ │ ├── boolean_field
│ │ │ ├── boolean_field_bloc.dart
│ │ │ └── boolean_field_state.dart
│ │ ├── field
│ │ │ ├── field_bloc.dart
│ │ │ ├── field_bloc_utils.dart
│ │ │ └── field_state.dart
│ │ ├── form
│ │ │ ├── form_bloc.dart
│ │ │ ├── form_bloc_utils.dart
│ │ │ └── form_state.dart
│ │ ├── form_bloc_observer.dart
│ │ ├── group_field
│ │ │ └── group_field_bloc.dart
│ │ ├── input_field
│ │ │ ├── input_field_bloc.dart
│ │ │ └── input_field_state.dart
│ │ ├── list_field
│ │ │ └── list_field_bloc.dart
│ │ ├── multi_select_field
│ │ │ ├── multi_select_field_bloc.dart
│ │ │ └── multi_select_field_state.dart
│ │ ├── select_field
│ │ │ ├── select_field_bloc.dart
│ │ │ └── select_field_state.dart
│ │ └── text_field
│ │ │ ├── text_field_bloc.dart
│ │ │ └── text_field_state.dart
│ │ ├── extension
│ │ └── extension.dart
│ │ ├── utils.dart
│ │ └── validators
│ │ └── field_bloc_validators.dart
│ ├── pubspec.yaml
│ └── test
│ ├── boolean_field
│ ├── boolean_field_bloc_test.dart
│ └── boolean_field_state_test.dart
│ ├── field_bloc
│ ├── field_bloc_test.dart
│ └── multi_field_bloc_test.dart
│ ├── field_bloc_validator
│ └── field_bloc_validator_test.dart
│ ├── form_bloc
│ ├── form_bloc_state_test.dart
│ ├── form_bloc_test.dart
│ └── form_bloc_utils_test.dart
│ ├── group_field
│ └── group_field_bloc_test.dart
│ ├── input_field
│ ├── input_field_bloc_test.dart
│ └── input_field_state_test.dart
│ ├── list_field
│ └── list_field_bloc_test.dart
│ ├── multi_select_field
│ ├── multi_select_field_bloc_test.dart
│ └── multi_select_field_state_test.dart
│ ├── select_field
│ ├── select_field_bloc_test.dart
│ └── select_field_state_test.dart
│ ├── text_field
│ ├── text_field_bloc_test.dart
│ └── text_field_state_test.dart
│ └── utils
│ ├── my_bloc_delegate.dart
│ ├── states.dart
│ └── when_bloc.dart
├── pubspec.yaml
└── screenshots
├── form_bloc1.gif
├── form_bloc2.gif
├── form_bloc3.gif
├── form_bloc4.gif
├── form_bloc5.gif
└── form_bloc6.gif
/.github/workflows/form_bloc.yml:
--------------------------------------------------------------------------------
1 | name: form_bloc
2 |
3 | on:
4 | push:
5 | paths:
6 | - "packages/form_bloc/**"
7 | - ".github/workflows/form_bloc.yaml"
8 |
9 | pull_request:
10 | paths:
11 | - "packages/form_bloc/**"
12 | - ".github/workflows/form_bloc.yaml"
13 |
14 | jobs:
15 | build:
16 | defaults:
17 | run:
18 | working-directory: packages/form_bloc
19 |
20 | runs-on: ubuntu-latest
21 |
22 | steps:
23 | - name: Checkout
24 | uses: actions/checkout@v3
25 |
26 | - name: Setup Flutter
27 | uses: subosito/flutter-action@v2
28 | with:
29 | flutter-version: '3.13.1'
30 | channel: 'stable'
31 |
32 | - name: Install Dependencies
33 | run: pub get
34 |
35 | - name: Format
36 | run: dart format --set-exit-if-changed .
37 |
38 | - name: Analyze
39 | run: dart analyze --fatal-infos --fatal-warnings .
40 |
41 | - name: Run Tests
42 | run: dart test
43 |
--------------------------------------------------------------------------------
/.github/workflows/form_bloc_web.yml:
--------------------------------------------------------------------------------
1 | name: Form Bloc Web
2 | on:
3 | push:
4 | branches:
5 | - master
6 | # paths:
7 | # - 'form_bloc_web/**'
8 | # - '.github/workflows/**'
9 |
10 | jobs:
11 | build:
12 | runs-on: ubuntu-latest
13 |
14 | env:
15 | working-directory: ./form_bloc_web
16 |
17 | steps:
18 | - name: Checkout
19 | uses: actions/checkout@v3
20 |
21 | - name: Setup Flutter
22 | uses: subosito/flutter-action@v2
23 | with:
24 | flutter-version: '3.13.1'
25 | channel: 'stable'
26 |
27 | - name: Enable Flutter web
28 | run: flutter config --enable-web
29 | working-directory: ${{ env.working-directory }}
30 |
31 | - name: Install dependencies
32 | run: flutter packages get
33 | working-directory: ${{ env.working-directory }}
34 |
35 | - name: Build web
36 | run: flutter build web --web-renderer html
37 | working-directory: ${{ env.working-directory }}
38 |
39 | - name: Deploy
40 | uses: peaceiris/actions-gh-pages@v3
41 | with:
42 | github_token: ${{ secrets.ACCESS_TOKEN }}
43 | publish_dir: ./form_bloc_web/build/web
44 |
--------------------------------------------------------------------------------
/form_bloc_web/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Symbolication related
37 | app.*.symbols
38 |
39 | # Obfuscation related
40 | app.*.map.json
41 |
42 | # Exceptions to above rules.
43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
44 |
--------------------------------------------------------------------------------
/form_bloc_web/.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: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
8 | channel: stable
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
17 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
18 | - platform: android
19 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
20 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
21 | - platform: ios
22 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
23 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
24 | - platform: linux
25 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
26 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
27 | - platform: macos
28 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
29 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
30 | - platform: web
31 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
32 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
33 | - platform: windows
34 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
35 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
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 |
--------------------------------------------------------------------------------
/form_bloc_web/README.md:
--------------------------------------------------------------------------------
1 | # [🔥👉 Documentation and Tutorials 👈🔥](https://giancarlocode.github.io/form_bloc/)
2 |
--------------------------------------------------------------------------------
/form_bloc_web/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
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 | namespace "com.example.form_bloc_web"
30 | compileSdkVersion flutter.compileSdkVersion
31 | ndkVersion flutter.ndkVersion
32 |
33 | compileOptions {
34 | sourceCompatibility JavaVersion.VERSION_1_8
35 | targetCompatibility JavaVersion.VERSION_1_8
36 | }
37 |
38 | kotlinOptions {
39 | jvmTarget = '1.8'
40 | }
41 |
42 | sourceSets {
43 | main.java.srcDirs += 'src/main/kotlin'
44 | }
45 |
46 | defaultConfig {
47 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
48 | applicationId "com.example.form_bloc_web"
49 | // You can update the following values to match your application needs.
50 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
51 | minSdkVersion flutter.minSdkVersion
52 | targetSdkVersion flutter.targetSdkVersion
53 | versionCode flutterVersionCode.toInteger()
54 | versionName flutterVersionName
55 | }
56 |
57 | buildTypes {
58 | release {
59 | // TODO: Add your own signing config for the release build.
60 | // Signing with the debug keys for now, so `flutter run --release` works.
61 | signingConfig signingConfigs.debug
62 | }
63 | }
64 | }
65 |
66 | flutter {
67 | source '../..'
68 | }
69 |
70 | dependencies {
71 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
72 | }
73 |
--------------------------------------------------------------------------------
/form_bloc_web/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/form_bloc_web/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/form_bloc_web/android/app/src/main/kotlin/com/example/form_bloc_web/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.form_bloc_web
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/form_bloc_web/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/form_bloc_web/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/form_bloc_web/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/form_bloc_web/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/form_bloc_web/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/form_bloc_web/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/form_bloc_web/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/form_bloc_web/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/form_bloc_web/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/form_bloc_web/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/form_bloc_web/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 | tasks.register("clean", Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/form_bloc_web/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/assets/fonts/JosefinSans-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/assets/fonts/JosefinSans-Bold.ttf
--------------------------------------------------------------------------------
/form_bloc_web/assets/fonts/JosefinSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/assets/fonts/JosefinSans-Regular.ttf
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/form_bloc_web/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/form_bloc_web/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.
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Form Bloc Web
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | form_bloc_web
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 |
--------------------------------------------------------------------------------
/form_bloc_web/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/form_bloc_web/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/constants/style.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | final colors = [Colors.indigo, Colors.deepPurpleAccent];
4 | final colors2 = [
5 | Colors.white,
6 | Colors.deepPurpleAccent.withAlpha(10),
7 | ];
8 |
9 | final mainGradient = LinearGradient(colors: colors);
10 |
11 | final drawerBodyGradient =
12 | LinearGradient(colors: colors2);
13 |
14 | final scaffoldBodyGradient = LinearGradient(colors: colors);
15 |
16 | bool displayMobileLayout(BuildContext context) =>
17 | MediaQuery.of(context).size.width < 720;
18 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/examples/crud_from.dart:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/lib/examples/crud_from.dart
--------------------------------------------------------------------------------
/form_bloc_web/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_form_bloc/flutter_form_bloc.dart';
3 | import 'package:form_bloc_web/pages/home_page.dart';
4 | import 'package:form_bloc_web/routes.dart';
5 | import 'package:form_bloc_web/super_bloc_delegate.dart';
6 |
7 | void main() {
8 | BlocOverrides.runZoned(
9 | () => BlocOverrides.runZoned(
10 | () => runApp(const App()),
11 | blocObserver: SuperBlocDelegate(),
12 | ),
13 | blocObserver: FormBlocObserver(child: SuperBlocDelegate()),
14 | );
15 | }
16 |
17 | class App extends StatelessWidget {
18 | const App({Key? key}) : super(key: key);
19 |
20 | @override
21 | Widget build(BuildContext context) {
22 | return MaterialApp(
23 | title: 'form_bloc',
24 | theme: ThemeData(
25 | scaffoldBackgroundColor: Colors.transparent,
26 | primaryColor: Colors.deepPurple,
27 | fontFamily: 'JosefinSans',
28 | ),
29 | debugShowCheckedModeBanner: false,
30 | initialRoute: RouteNames.home,
31 | routes: routes,
32 | onUnknownRoute: (settings) =>
33 | MaterialPageRoute(builder: (_) => const HomePage()),
34 | );
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/pages/all_fields_form_example_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:form_bloc_web/examples/all_fields_form.dart';
3 | import 'package:form_bloc_web/widgets/widgets.dart';
4 |
5 | class AllFieldsExamplePage extends StatelessWidget {
6 | const AllFieldsExamplePage({Key? key}) : super(key: key);
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return const ExampleScaffold(
11 | title: 'Built-in Widgets',
12 | demo: DeviceScreen(app: AllFieldsForm()),
13 | code: CodeScreen(codePath: 'lib/examples/all_fields_form.dart'),
14 | );
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/pages/crud_example_page.dart:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/lib/pages/crud_example_page.dart
--------------------------------------------------------------------------------
/form_bloc_web/lib/pages/submission_error_to_field_example_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'package:form_bloc_web/examples/submission_error_to_field_form.dart';
4 | import 'package:form_bloc_web/widgets/widgets.dart';
5 |
6 | class SubmissionErrorToFieldExamplePage extends StatelessWidget {
7 | const SubmissionErrorToFieldExamplePage({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return ExampleScaffold(
12 | title: 'Submission Error to Field',
13 | demo: const DeviceScreen(app: SubmissionErrorToFieldForm()),
14 | code: const CodeScreen(
15 | codePath: 'lib/examples/submission_error_to_field_form.dart'),
16 | tutorial: TutorialScreen(
17 | children: [
18 | const TutorialText('''
19 | You can add an error to field bloc from anywhere using the `addFieldError` method.
20 |
21 | It is usually used to add an error that we get from the server.
22 |
23 | For example when the username is not available and we want to show the error in the field.
24 | '''),
25 | CodeCard.main(
26 | nestedPath: 'MyFormBloc > onSubmitting',
27 | code: '''
28 | @override
29 | void onSubmitting() async {
30 |
31 | username.addFieldError('That username is taken. Try another.');
32 |
33 | }
34 | ''',
35 | ),
36 | TutorialText.sub('''
37 | The `addFieldError` method has the optional parameter `isPermanent`, by default it is `false`, but if you assign `true` the error will be cached, so whenever you set that value the error will be added (like a sync validator).
38 | '''),
39 | CodeCard.main(
40 | nestedPath: 'MyFormBloc > onSubmitting',
41 | code: '''
42 | @override
43 | void onSubmitting() async {
44 |
45 | if (username.value.toLowerCase() == 'dev') {
46 | username.addFieldError(
47 | 'Cached - That username is taken. Try another.',
48 | isPermanent: true,
49 | );
50 | } else {
51 | username.addFieldError('That username is taken. Try another.');
52 | }
53 | }
54 | ''',
55 | ),
56 | ],
57 | ),
58 | );
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/super_bloc_delegate.dart:
--------------------------------------------------------------------------------
1 | import 'package:bloc/bloc.dart';
2 | import 'package:flutter/foundation.dart';
3 |
4 | class SuperBlocDelegate extends BlocObserver {
5 | @override
6 | void onEvent(Bloc bloc, Object? event) {
7 | super.onEvent(bloc, event);
8 | _printWrapped('bloc: ${bloc.runtimeType}, event: $event');
9 | }
10 |
11 | @override
12 | void onTransition(Bloc bloc, Transition transition) {
13 | super.onTransition(bloc, transition);
14 |
15 | var _string =
16 | '\n********************************************************************************\n';
17 | _string +=
18 | '******************************* TRANSITION START *******************************\n';
19 | _string +=
20 | '********************************************************************************\n';
21 | _string += 'BLOC: ${bloc.runtimeType}\n';
22 | _string += 'EVENT: ${transition.event}\n';
23 | _string += 'CURRENT STATE: ${transition.currentState}\n';
24 | _string += 'NEXT STATE: ${transition.nextState}\n';
25 | _string +=
26 | '********************************************************************************\n';
27 | _string +=
28 | '******************************** TRANSITION END ********************************\n';
29 | _string +=
30 | '********************************************************************************\n';
31 |
32 | _printWrapped(_string);
33 | }
34 |
35 | @override
36 | void onError(BlocBase bloc, Object error, StackTrace stackTrace) {
37 | super.onError(bloc, error, stackTrace);
38 | _printWrapped(
39 | 'bloc: ${bloc.runtimeType}, error: $error, stacktrace: $stackTrace',
40 | );
41 | }
42 |
43 | void _printWrapped(String text) {
44 | final pattern = RegExp('.{1,800}'); // 800 is the size of each chunk
45 | debugPrint('\n');
46 | pattern.allMatches(text).forEach((match) => debugPrint('${match.group(0)}'));
47 | debugPrint('\n');
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/widgets/app_scaffold.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:form_bloc_web/constants/style.dart';
3 | import 'package:form_bloc_web/widgets/app_drawer.dart';
4 |
5 | class AppScaffold extends StatelessWidget {
6 | const AppScaffold({
7 | Key? key,
8 | this.showParticlesBackground = false,
9 | required this.appBar,
10 | required this.body,
11 | }) : super(key: key);
12 |
13 | final bool showParticlesBackground;
14 | final AppBar appBar;
15 | final Widget body;
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | return Stack(
20 | children: [
21 | if (showParticlesBackground)
22 | Container(
23 | decoration: BoxDecoration(
24 | gradient: scaffoldBodyGradient,
25 | ),
26 | ),
27 | Row(
28 | children: [
29 | if (!displayMobileLayout(context))
30 | const AppDrawer(permanentlyDisplay: true),
31 | Expanded(
32 | child: Scaffold(
33 | backgroundColor: Colors.transparent,
34 | drawer: displayMobileLayout(context)
35 | ? const AppDrawer(permanentlyDisplay: false)
36 | : null,
37 | appBar: appBar,
38 | body: body,
39 | ),
40 | ),
41 | ],
42 | ),
43 | ],
44 | );
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/widgets/copy_flash.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void showCopyFlash({
4 | required BuildContext context,
5 | required EdgeInsets margin,
6 | }) {
7 | // TODO: Show a flash message when the user copies the code
8 | // context.showToast(
9 | // const Padding(
10 | // padding: EdgeInsets.all(12.0),
11 | // child: DefaultTextStyle(
12 | // style: TextStyle(color: Colors.white),
13 | // child: Text(
14 | // 'Copied to Clipboard',
15 | // ),
16 | // ),
17 | // ),
18 | // duration: const Duration(seconds: 2),
19 | // );
20 | }
21 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/widgets/device_screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class DeviceScreen extends StatelessWidget {
5 | final Widget app;
6 |
7 | const DeviceScreen({
8 | Key? key,
9 | required this.app,
10 | }) : super(key: key);
11 |
12 | @override
13 | Widget build(BuildContext context) {
14 | var height = MediaQuery.of(context).size.height - (kIsWeb ? 135 : 160);
15 | height = height < 480 ? 480 : height;
16 |
17 | final width = MediaQuery.of(context).size.width > 350.0
18 | ? 350.0
19 | : MediaQuery.of(context).size.width;
20 |
21 | return ListView(
22 | shrinkWrap: true,
23 | children: [
24 | Column(
25 | children: [
26 | Container(
27 | alignment: Alignment.center,
28 | child: Transform.scale(
29 | scale: kIsWeb ? 0.95 : 1.0,
30 | child: SizedBox(
31 | height: height,
32 | width: width,
33 | child: Card(
34 | shape: RoundedRectangleBorder(
35 | borderRadius: BorderRadius.circular(10.0)),
36 | elevation: 2.0,
37 | margin: const EdgeInsets.all(kIsWeb ? 0 : 15),
38 | child: MaterialApp(
39 | home: app,
40 | theme: ThemeData(
41 | fontFamily: 'JosefinSans',
42 | ),
43 | debugShowCheckedModeBanner: false,
44 | ),
45 | ),
46 | ),
47 | ),
48 | ),
49 | ],
50 | ),
51 | ],
52 | );
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/widgets/gradient_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:form_bloc_web/constants/style.dart';
3 |
4 | class GradientElevatedButton extends StatelessWidget {
5 | const GradientElevatedButton({
6 | Key? key,
7 | required this.onPressed,
8 | this.height,
9 | this.width,
10 | this.gradient,
11 | this.child,
12 | this.borderRadius,
13 | this.padding,
14 | this.elevation,
15 | }) : super(key: key);
16 |
17 | final VoidCallback? onPressed;
18 | final double? height;
19 | final double? width;
20 | final Gradient? gradient;
21 | final Widget? child;
22 | final BorderRadius? borderRadius;
23 | final EdgeInsets? padding;
24 | final double? elevation;
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | final _borderRadius = borderRadius ?? BorderRadius.circular(2.0);
29 | return Container(
30 | width: width,
31 | height: height,
32 | decoration: BoxDecoration(
33 | gradient: gradient ?? mainGradient,
34 | borderRadius: _borderRadius,
35 | ),
36 | child: Material(
37 | elevation: elevation ?? 2.0,
38 | shape: RoundedRectangleBorder(
39 | borderRadius: _borderRadius,
40 | ),
41 | color: Colors.transparent,
42 | child: InkWell(
43 | onTap: onPressed,
44 | borderRadius: _borderRadius,
45 | child: Container(
46 | padding: padding ?? const EdgeInsets.fromLTRB(24, 14, 24, 10),
47 | child: child,
48 | ),
49 | ),
50 | ),
51 | );
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/widgets/show_all_code_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:form_bloc_web/widgets/widgets.dart';
3 |
4 | class ShowAllCodeButton extends StatelessWidget {
5 | const ShowAllCodeButton({Key? key}) : super(key: key);
6 |
7 | @override
8 | Widget build(BuildContext context) {
9 | return Padding(
10 | padding: const EdgeInsets.only(top: 24.0),
11 | child: GradientElevatedButton(
12 | onPressed: () => DefaultTabController.of(context).animateTo(2),
13 | child: const Text(
14 | 'SHOW ALL CODE',
15 | style: TextStyle(
16 | color: Colors.white,
17 | fontSize: 18,
18 | ),
19 | ),
20 | ),
21 | );
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/widgets/tutorial_screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:form_bloc_web/widgets/widgets.dart';
3 |
4 | class TutorialScreen extends StatelessWidget {
5 | const TutorialScreen({
6 | Key? key,
7 | required this.children,
8 | }) : super(key: key);
9 | final List children;
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return SingleChildScrollView(
14 | child: Container(
15 | padding: const EdgeInsets.all(24.0),
16 | child: Column(
17 | children: [
18 | ...children,
19 | const ShowAllCodeButton(),
20 | ],
21 | ),
22 | ),
23 | );
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/widgets/tutorial_text.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_markdown/flutter_markdown.dart';
3 |
4 | class TutorialText extends StatelessWidget {
5 | final String text;
6 | final EdgeInsets padding;
7 | const TutorialText(
8 | this.text, {
9 | Key? key,
10 | this.padding = const EdgeInsets.fromLTRB(0, 0, 0, 12),
11 | }) : super(key: key);
12 |
13 | factory TutorialText.sub(String text) =>
14 | TutorialText(text, padding: const EdgeInsets.fromLTRB(0, 12, 0, 12));
15 |
16 | factory TutorialText.header(String text) =>
17 | TutorialText(text, padding: const EdgeInsets.fromLTRB(0, 12, 0, 12));
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Markdown(
22 | data: text.trim(),
23 | padding: padding,
24 | shrinkWrap: true,
25 | physics: const NeverScrollableScrollPhysics(),
26 | styleSheet: MarkdownStyleSheet(
27 | h1: const TextStyle(
28 | color: Colors.black87,
29 | fontSize: 24,
30 | fontFamily: 'JosefinSans',
31 | ),
32 | listBullet: const TextStyle(
33 | color: Colors.black87,
34 | fontSize: 18,
35 | fontFamily: 'JosefinSans',
36 | ),
37 | p: const TextStyle(
38 | color: Colors.black87,
39 | fontSize: 18,
40 | fontFamily: 'JosefinSans',
41 | ),
42 | code: TextStyle(
43 | fontSize: 18,
44 | backgroundColor: Colors.grey.shade200,
45 | fontStyle: FontStyle.italic,
46 | ),
47 | ),
48 | );
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/widgets/under_construction.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class UnderConstruction extends StatelessWidget {
4 | const UnderConstruction({Key? key}) : super(key: key);
5 |
6 | @override
7 | Widget build(BuildContext context) {
8 | return Container(
9 | alignment: Alignment.center,
10 | child: Column(
11 | mainAxisSize: MainAxisSize.min,
12 | children: [
13 | Icon(
14 | Icons.sentiment_very_satisfied,
15 | size: 140,
16 | color: Colors.black.withAlpha(180),
17 | ),
18 | const SizedBox(height: 12),
19 | Text(
20 | 'Under Construction',
21 | style: TextStyle(
22 | fontSize: 35,
23 | color: Colors.black.withAlpha(180),
24 | ),
25 | ),
26 | ],
27 | ),
28 | );
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/form_bloc_web/lib/widgets/widgets.dart:
--------------------------------------------------------------------------------
1 | export 'code_screen.dart';
2 | export 'device_screen.dart';
3 | export 'tutorial_screen.dart';
4 | export 'tutorial_stepper_screen.dart';
5 | export 'copy_flash.dart';
6 | export 'tutorial_text.dart';
7 | export 'code_card.dart';
8 | export 'example_scaffold.dart';
9 | export 'gradient_button.dart';
10 | export 'show_all_code_button.dart';
11 |
--------------------------------------------------------------------------------
/form_bloc_web/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import path_provider_foundation
9 | import url_launcher_macos
10 |
11 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
12 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
13 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
14 | }
15 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/form_bloc_web/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 = form_bloc_web
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.formBlocWeb
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved.
15 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController()
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 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/form_bloc_web/macos/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import FlutterMacOS
2 | import Cocoa
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/form_bloc_web/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: form_bloc_web
2 | description: Easy Form State Management using BLoC pattern. Separate the Form State and Business Logic from the User Interface.
3 | version: 1.0.0
4 | publish_to: none
5 |
6 | environment:
7 | sdk: ">=3.0.0 <4.0.0"
8 | flutter: ">=3.7.0"
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 | flutter_form_bloc: ^0.31.0
14 | animations: ^2.0.7
15 | flutter_syntax_view: ^4.0.0
16 | flash: ^3.0.5+1
17 | url_launcher: ^6.1.12
18 | flutter_markdown: ^0.6.17+1
19 | auto_size_text: ^3.0.0-nullsafety.0
20 | liquid_progress_indicator_v2: ^0.5.0
21 | rxdart: ^0.27.7
22 | google_fonts: ^5.1.0
23 |
24 | dev_dependencies:
25 | flutter_test:
26 | sdk: flutter
27 | flutter_lints: ^2.0.0
28 |
29 | flutter:
30 | uses-material-design: true
31 | fonts:
32 | - family: JosefinSans
33 | fonts:
34 | - asset: assets/fonts/JosefinSans-Regular.ttf
35 | - asset: assets/fonts/JosefinSans-Bold.ttf
36 | weight: 700
37 | assets:
38 | - lib/examples/
39 |
--------------------------------------------------------------------------------
/form_bloc_web/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/web/favicon.png
--------------------------------------------------------------------------------
/form_bloc_web/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/form_bloc_web/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/form_bloc_web/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/form_bloc_web/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/form_bloc_web/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | form_bloc_web
33 |
34 |
35 |
39 |
40 |
41 |
42 |
43 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/form_bloc_web/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "form_bloc_web",
3 | "short_name": "form_bloc_web",
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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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"form_bloc_web", 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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/form_bloc_web/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/form_bloc_web/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 | -1; // remove the trailing null character
52 | int input_length = (int)wcslen(utf16_string);
53 | std::string utf8_string;
54 | if (target_length <= 0 || target_length > utf8_string.max_size()) {
55 | return utf8_string;
56 | }
57 | utf8_string.resize(target_length);
58 | int converted_length = ::WideCharToMultiByte(
59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
60 | input_length, utf8_string.data(), target_length, nullptr, nullptr);
61 | if (converted_length == 0) {
62 | return std::string();
63 | }
64 | return utf8_string;
65 | }
66 |
--------------------------------------------------------------------------------
/form_bloc_web/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 |
--------------------------------------------------------------------------------
/melos.yaml:
--------------------------------------------------------------------------------
1 | name: form_bloc_melos
2 |
3 | packages:
4 | - form_bloc_web
5 | - packages/**
6 |
7 | scripts:
8 | analyze:
9 | exec: dart analyze .
10 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 GiancarloCode
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
3 | analyzer:
4 | errors:
5 | avoid_print: warning
6 | annotate_overrides: warning
7 | always_use_package_imports: warning
8 |
9 | linter:
10 | rules:
11 | always_use_package_imports: true
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Exceptions to above rules.
37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
38 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
8 | channel: stable
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
17 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
18 | - platform: android
19 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
20 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
21 | - platform: ios
22 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
23 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
24 | - platform: linux
25 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
26 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
27 | - platform: macos
28 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
29 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
30 | - platform: web
31 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
32 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
33 | - platform: windows
34 | create_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
35 | base_revision: 682aa387cfe4fbd71ccd5418b2c2a075729a1c66
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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/README.md:
--------------------------------------------------------------------------------
1 | # [🔥👉 Documentation and Tutorials 👈🔥](https://giancarlocode.github.io/form_bloc/)
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 | tasks.register("clean", Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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.
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 |
9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
10 | }
11 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 © 2023 com.example. All rights reserved.
15 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController()
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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/macos/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import FlutterMacOS
2 | import Cocoa
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_form_bloc_example
2 | description: flutter_form_bloc example
3 | version: 1.0.0+1
4 | publish_to: 'none'
5 |
6 | environment:
7 | sdk: '>=2.12.0 <4.0.0'
8 |
9 | dependencies:
10 | flutter:
11 | sdk: flutter
12 | flutter_form_bloc: ^0.30.1
13 |
14 | dev_dependencies:
15 | flutter_test:
16 | sdk: flutter
17 |
18 | flutter:
19 | uses-material-design: true
20 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/web/favicon.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/example/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GiancarloCode/form_bloc/a74a63558884f2cac4130c7b1a1455eae46fdca2/packages/flutter_form_bloc/example/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 | -1; // remove the trailing null character
52 | int input_length = (int)wcslen(utf16_string);
53 | std::string utf8_string;
54 | if (target_length <= 0 || target_length > utf8_string.max_size()) {
55 | return utf8_string;
56 | }
57 | utf8_string.resize(target_length);
58 | int converted_length = ::WideCharToMultiByte(
59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
60 | input_length, utf8_string.data(), target_length, nullptr, nullptr);
61 | if (converted_length == 0) {
62 | return std::string();
63 | }
64 | return utf8_string;
65 | }
66 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/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 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/lib/flutter_form_bloc.dart:
--------------------------------------------------------------------------------
1 | library flutter_form_bloc;
2 |
3 | export 'package:flutter_bloc/flutter_bloc.dart';
4 | export 'package:form_bloc/form_bloc.dart';
5 |
6 | export 'src/checkbox_field_bloc_builder.dart';
7 | export 'src/chip/chip_field_item_builder.dart';
8 | export 'src/chip/choice_chip_field_bloc_builder.dart';
9 | export 'src/chip/filter_chip_field_bloc_builder.dart';
10 | export 'src/date_time/date_time_field_bloc_builder.dart';
11 | export 'src/date_time/time_field_bloc_builder.dart';
12 | export 'src/dropdown_field_bloc_builder.dart';
13 | export 'src/features/appear/can_show_field_bloc_builder.dart';
14 | export 'src/features/scroll/scrollable_field_bloc_target.dart';
15 | export 'src/features/scroll/scrollable_form_bloc_manager.dart';
16 | export 'src/field_bloc_builder.dart';
17 | export 'src/fields/simple_field_bloc_builder.dart';
18 | export 'src/form_bloc_listener.dart';
19 | export 'src/groups/fields/checkbox_group_field_bloc_builder.dart';
20 | export 'src/groups/fields/radio_button_group_field_bloc.dart';
21 | export 'src/groups/widgets/group_view.dart';
22 | export 'src/slider/slider_field_bloc_builder.dart';
23 | export 'src/stepper/stepper_form_bloc_builder.dart';
24 | export 'src/suffix_buttons/clear_suffix_button.dart';
25 | export 'src/suffix_buttons/obscure_suffix_button.dart';
26 | export 'src/switch_field_bloc_builder.dart';
27 | export 'src/text_field_bloc_builder.dart';
28 | export 'src/theme/form_bloc_theme.dart';
29 | export 'src/theme/form_bloc_theme_provider.dart';
30 | export 'src/theme/material_states.dart';
31 | export 'src/theme/suffix_button_themes.dart';
32 | export 'src/utils/field_bloc_builder_control_affinity.dart';
33 | export 'src/utils/field_item.dart';
34 | export 'src/utils/style.dart';
35 | export 'src/utils/typedefs.dart';
36 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/lib/src/chip/chip_field_item_builder.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | typedef ChipFieldItemBuilder = ChipFieldItem Function(
4 | BuildContext context, T value);
5 |
6 | class ChipFieldItem {
7 | /// Whether or not a user can select this menu item.
8 | final bool isEnabled;
9 |
10 | /// Called when the item is tapped.
11 | final VoidCallback? onTap;
12 |
13 | /// [RawChip.tooltip]
14 | final String? tooltip;
15 |
16 | /// [RawChip.avatar]
17 | final Widget? avatar;
18 |
19 | /// [RawChip.label]
20 | final Widget label;
21 |
22 | const ChipFieldItem({
23 | this.isEnabled = true,
24 | this.onTap,
25 | this.avatar,
26 | this.tooltip,
27 | required this.label,
28 | });
29 |
30 | @override
31 | String toString() {
32 | return 'ChipFieldItem{isEnabled: $isEnabled, onTap: $onTap, tooltip: $tooltip, avatar: $avatar, label: $label}';
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/lib/src/features/scroll/scrollable_field_bloc_target.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:flutter_bloc/flutter_bloc.dart';
3 | import 'package:form_bloc/form_bloc.dart';
4 |
5 | /// Mark the widget as a possible scroll target
6 | class ScrollableFieldBlocTarget extends StatefulWidget {
7 | final SingleFieldBloc singleFieldBloc;
8 |
9 | /// Enable auto scroll when the field has an error
10 | final bool canScroll;
11 |
12 | /// Force scroll to this target
13 | final bool mustScroll;
14 |
15 | final Widget child;
16 |
17 | const ScrollableFieldBlocTarget({
18 | Key? key,
19 | required this.singleFieldBloc,
20 | this.canScroll = true,
21 | this.mustScroll = false,
22 | required this.child,
23 | }) : super(key: key);
24 |
25 | static ScrollableFieldBlocTargetState? findFirstWrong(BuildContext context) {
26 | ScrollableFieldBlocTargetState? scrollableState;
27 |
28 | void visit(Element element) {
29 | if (element is StatefulElement) {
30 | final state = element.state;
31 | if (state is ScrollableFieldBlocTargetState && state.canTarget) {
32 | scrollableState = state;
33 | }
34 | }
35 | if (scrollableState == null) {
36 | element.visitChildElements(visit);
37 | }
38 | }
39 |
40 | context.visitChildElements(visit);
41 |
42 | return scrollableState;
43 | }
44 |
45 | @override
46 | State createState() =>
47 | ScrollableFieldBlocTargetState();
48 | }
49 |
50 | class ScrollableFieldBlocTargetState extends State {
51 | bool _hasError = false;
52 |
53 | bool get hasError => _hasError;
54 |
55 | bool get canTarget => (hasError && widget.canScroll) || widget.mustScroll;
56 |
57 | @override
58 | Widget build(BuildContext context) {
59 | return BlocListener(
60 | bloc: widget.singleFieldBloc,
61 | listenWhen: (prev, curr) => prev.hasError != curr.hasError,
62 | listener: (context, state) {
63 | _hasError = state.hasError;
64 | },
65 | child: widget.child,
66 | );
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/lib/src/features/scroll/scrollable_form_bloc_manager.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:flutter_bloc/flutter_bloc.dart';
3 | import 'package:flutter_form_bloc/src/features/scroll/scrollable_field_bloc_target.dart';
4 | import 'package:flutter_form_bloc/src/theme/form_bloc_theme.dart';
5 | import 'package:form_bloc/form_bloc.dart';
6 |
7 | /// Allows you to make the first wrong child visible
8 | ///
9 | /// Place it on every page
10 | class ScrollableFormBlocManager extends StatelessWidget {
11 | /// The form bloc instance
12 | final FormBloc formBloc;
13 |
14 | /// See [ScrollPosition.ensureVisible]
15 | final Duration? duration;
16 |
17 | /// See [ScrollPosition.ensureVisible]
18 | final double? alignment;
19 |
20 | /// See [ScrollPosition.ensureVisible]
21 | final Curve? curve;
22 |
23 | /// See [ScrollPosition.ensureVisible]
24 | final ScrollPositionAlignmentPolicy? alignmentPolicy;
25 |
26 | /// The tree
27 | final Widget child;
28 |
29 | const ScrollableFormBlocManager({
30 | Key? key,
31 | required this.formBloc,
32 | this.duration,
33 | this.alignment,
34 | this.curve,
35 | this.alignmentPolicy,
36 | required this.child,
37 | }) : super(key: key);
38 |
39 | /// Search from the context for the first wrong field and make it visible by scrolling
40 | void ensureFieldVisible(BuildContext context) {
41 | final target = ScrollableFieldBlocTarget.findFirstWrong(context);
42 |
43 | if (target == null) return;
44 |
45 | final formTheme = FormTheme.of(context);
46 | final scrollableConfig = formTheme.scrollableFormTheme;
47 |
48 | Scrollable.ensureVisible(
49 | target.context,
50 | duration: duration ?? scrollableConfig.duration,
51 | alignment: alignment ?? scrollableConfig.alignment,
52 | curve: curve ?? scrollableConfig.curve,
53 | alignmentPolicy: alignmentPolicy ?? scrollableConfig.alignmentPolicy,
54 | );
55 | }
56 |
57 | void _onFormBlocState(BuildContext context, FormBlocState state) {
58 | if (state is FormBlocSubmissionFailed) {
59 | ensureFieldVisible(context);
60 | }
61 | }
62 |
63 | @override
64 | Widget build(BuildContext context) {
65 | return BlocListener(
66 | bloc: formBloc,
67 | listenWhen: (prev, curr) => prev.runtimeType != curr.runtimeType,
68 | listener: _onFormBlocState,
69 | child: child,
70 | );
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/lib/src/field_bloc_builder.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:form_bloc/form_bloc.dart';
3 |
4 | typedef DefaultFieldBlocErrorBuilder = String? Function(
5 | BuildContext context,
6 | Object error,
7 | FieldBloc fieldBloc,
8 | );
9 |
10 | class FieldBlocBuilder {
11 | /// It must return a string error to display in the widget
12 | /// when it has an error or null if you don't want to display the error.
13 | static DefaultFieldBlocErrorBuilder defaultErrorBuilder = buildDefaultError;
14 |
15 | static String buildDefaultError(
16 | BuildContext context,
17 | Object error,
18 | FieldBloc fieldBloc,
19 | ) {
20 | switch (error) {
21 | case FieldBlocValidatorsErrors.required:
22 | if (fieldBloc is MultiSelectFieldBloc || fieldBloc is SelectFieldBloc) {
23 | return 'Please select an option';
24 | }
25 | return 'This field is required.';
26 | case FieldBlocValidatorsErrors.email:
27 | return 'The email address is badly formatted.';
28 | case FieldBlocValidatorsErrors.passwordMin6Chars:
29 | return 'The password must contain at least 6 characters.';
30 | case FieldBlocValidatorsErrors.confirmPassword:
31 | return 'Must be equal to password.';
32 | default:
33 | return '$error';
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/lib/src/fields/simple_field_bloc_builder.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_form_bloc/src/features/appear/can_show_field_bloc_builder.dart';
3 | import 'package:flutter_form_bloc/src/features/scroll/scrollable_field_bloc_target.dart';
4 | import 'package:form_bloc/form_bloc.dart';
5 |
6 | /// Use these widgets:
7 | /// - [CanShowFieldBlocBuilder]
8 | /// - [ScrollableFieldBlocTarget]
9 | class SimpleFieldBlocBuilder extends StatelessWidget {
10 | final SingleFieldBloc singleFieldBloc;
11 | final bool animateWhenCanShow;
12 | final bool focusOnValidationFailed;
13 | final Widget Function(BuildContext context, bool canShow) builder;
14 |
15 | const SimpleFieldBlocBuilder({
16 | Key? key,
17 | required this.singleFieldBloc,
18 | this.animateWhenCanShow = true,
19 | this.focusOnValidationFailed = true,
20 | required this.builder,
21 | }) : super(key: key);
22 |
23 | @override
24 | Widget build(BuildContext context) {
25 | return CanShowFieldBlocBuilder(
26 | fieldBloc: singleFieldBloc,
27 | animate: animateWhenCanShow,
28 | builder: (context, canShow) {
29 | final field = builder(context, canShow);
30 |
31 | if (!canShow) {
32 | return field;
33 | }
34 |
35 | return ScrollableFieldBlocTarget(
36 | singleFieldBloc: singleFieldBloc,
37 | canScroll: focusOnValidationFailed,
38 | child: field,
39 | );
40 | },
41 | );
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/lib/src/groups/widgets/item_group_tile.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class ItemGroupTile extends StatelessWidget {
4 | final InputBorder? customBorder;
5 | final VoidCallback? onTap;
6 | final Widget leading;
7 | final Widget content;
8 |
9 | const ItemGroupTile({
10 | Key? key,
11 | this.customBorder,
12 | this.onTap,
13 | required this.leading,
14 | required this.content,
15 | }) : super(key: key);
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | Widget current = Row(
20 | crossAxisAlignment: CrossAxisAlignment.center,
21 | mainAxisSize: MainAxisSize.min,
22 | children: [
23 | ConstrainedBox(
24 | constraints: const BoxConstraints(
25 | minHeight: kMinInteractiveDimension,
26 | minWidth: kMinInteractiveDimension,
27 | ),
28 | child: leading,
29 | ),
30 | content,
31 | const SizedBox(width: 15.0),
32 | ],
33 | );
34 | if (onTap != null) {
35 | current = InkWell(
36 | customBorder: customBorder,
37 | onTap: onTap,
38 | child: current,
39 | );
40 | }
41 | return current;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/lib/src/suffix_buttons/clear_suffix_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_form_bloc/src/suffix_buttons/suffix_button_bloc_builder.dart';
3 | import 'package:flutter_form_bloc/src/theme/form_bloc_theme.dart';
4 | import 'package:flutter_form_bloc/src/theme/suffix_button_themes.dart';
5 | import 'package:form_bloc/form_bloc.dart';
6 |
7 | class ClearSuffixButton extends StatelessWidget {
8 | final SingleFieldBloc singleFieldBloc;
9 | final bool isEnabled;
10 | final bool? visibleWithoutValue;
11 | final Duration? appearDuration;
12 | final Widget? icon;
13 |
14 | const ClearSuffixButton({
15 | Key? key,
16 | required this.singleFieldBloc,
17 | this.visibleWithoutValue,
18 | this.appearDuration,
19 | this.isEnabled = true,
20 | this.icon,
21 | }) : super(key: key);
22 |
23 | ClearSuffixButtonTheme themeOf(BuildContext context) {
24 | final buttonTheme = FormTheme.of(context).clearSuffixButtonTheme;
25 |
26 | return ClearSuffixButtonTheme(
27 | visibleWithoutValue:
28 | visibleWithoutValue ?? buttonTheme.visibleWithoutValue ?? false,
29 | appearDuration: appearDuration ??
30 | buttonTheme.appearDuration ??
31 | const Duration(milliseconds: 300),
32 | icon: icon ?? buttonTheme.icon ?? const Icon(Icons.clear),
33 | );
34 | }
35 |
36 | @override
37 | Widget build(BuildContext context) {
38 | final buttonTheme = themeOf(context);
39 |
40 | return SuffixButtonBuilderBase(
41 | singleFieldBloc: singleFieldBloc,
42 | isEnabled: isEnabled,
43 | visibleWithoutValue: buttonTheme.visibleWithoutValue!,
44 | appearDuration: buttonTheme.appearDuration!,
45 | onTap: singleFieldBloc.clear,
46 | icon: buttonTheme.icon!,
47 | );
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/lib/src/suffix_buttons/obscure_suffix_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_form_bloc/src/suffix_buttons/suffix_button_bloc_builder.dart';
3 | import 'package:flutter_form_bloc/src/theme/form_bloc_theme.dart';
4 | import 'package:flutter_form_bloc/src/theme/suffix_button_themes.dart';
5 | import 'package:form_bloc/form_bloc.dart';
6 |
7 | class ObscureSuffixButton extends StatelessWidget {
8 | final SingleFieldBloc singleFieldBloc;
9 | final bool isEnabled;
10 | final bool value;
11 | final ValueChanged onChanged;
12 | final Widget? falseIcon;
13 | final Widget? trueIcon;
14 |
15 | const ObscureSuffixButton({
16 | Key? key,
17 | required this.singleFieldBloc,
18 | required this.isEnabled,
19 | required this.value,
20 | required this.onChanged,
21 | this.falseIcon,
22 | this.trueIcon,
23 | }) : super(key: key);
24 |
25 | ObscureSuffixButtonTheme themeOf(BuildContext context) {
26 | final buttonTheme = FormTheme.of(context).obscureSuffixButtonTheme;
27 |
28 | return ObscureSuffixButtonTheme(
29 | trueIcon:
30 | trueIcon ?? buttonTheme.trueIcon ?? const Icon(Icons.visibility),
31 | falseIcon: falseIcon ??
32 | buttonTheme.falseIcon ??
33 | const Icon(Icons.visibility_off),
34 | );
35 | }
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | final buttonTheme = themeOf(context);
40 |
41 | return SuffixButtonBuilderBase(
42 | singleFieldBloc: singleFieldBloc,
43 | isEnabled: isEnabled,
44 | onTap: () => onChanged(!value),
45 | icon: value ? buttonTheme.trueIcon! : buttonTheme.falseIcon!,
46 | );
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/lib/src/suffix_buttons/suffix_button_bloc_builder.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_bloc/flutter_bloc.dart';
3 | import 'package:flutter_form_bloc/src/utils/functions.dart';
4 | import 'package:form_bloc/form_bloc.dart';
5 |
6 | typedef BlocChildBuilder = Widget Function(
7 | BuildContext context, FieldBlocState state, Widget child);
8 |
9 | class SuffixButtonBuilderBase extends StatelessWidget {
10 | final SingleFieldBloc singleFieldBloc;
11 | final bool isEnabled;
12 | final bool visibleWithoutValue;
13 | final Duration appearDuration;
14 | final VoidCallback onTap;
15 | final Widget icon;
16 |
17 | const SuffixButtonBuilderBase({
18 | Key? key,
19 | required this.singleFieldBloc,
20 | this.isEnabled = true,
21 | this.visibleWithoutValue = true,
22 | this.appearDuration = const Duration(milliseconds: 300),
23 | required this.onTap,
24 | this.icon = const SizedBox.shrink(),
25 | }) : super(key: key);
26 |
27 | static Widget defaultBuild(
28 | BuildContext context,
29 | FieldBlocState state,
30 | Widget child,
31 | ) {
32 | return child;
33 | }
34 |
35 | Widget _buildButton(BuildContext context, FieldBlocState state) {
36 | final isEnabled = fieldBlocIsEnabled(
37 | isEnabled: this.isEnabled,
38 | fieldBlocState: state,
39 | );
40 |
41 | return InkWell(
42 | borderRadius: const BorderRadius.all(Radius.circular(25.0)),
43 | onTap: isEnabled ? onTap : null,
44 | child: icon,
45 | );
46 | }
47 |
48 | @override
49 | Widget build(BuildContext context) {
50 | return ExcludeFocus(
51 | child: BlocBuilder(
52 | bloc: singleFieldBloc,
53 | builder: (context, state) {
54 | Widget current = _buildButton(context, state);
55 |
56 | if (!visibleWithoutValue) {
57 | current = AnimatedOpacity(
58 | duration: appearDuration,
59 | opacity: state.value == null ? 0.0 : 1.0,
60 | child: current,
61 | );
62 | }
63 | return current;
64 | },
65 | ),
66 | );
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/packages/flutter_form_bloc/lib/src/theme/field_theme_resolver.dart:
--------------------------------------------------------------------------------
1 | import 'package:equatable/equatable.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_form_bloc/src/theme/form_bloc_theme.dart';
4 | import 'package:flutter_form_bloc/src/theme/material_states.dart';
5 | import 'package:flutter_form_bloc/src/utils/to_string.dart';
6 |
7 | /// Resolves looking for the appropriate value to use in the widget
8 | class FieldThemeResolver {
9 | final ThemeData theme;
10 | final FormTheme formTheme;
11 | final FieldTheme? fieldTheme;
12 |
13 | const FieldThemeResolver(this.theme, this.formTheme, [this.fieldTheme]);
14 |
15 | InputDecorationTheme get decorationTheme {
16 | return fieldTheme?.decorationTheme ??
17 | formTheme.decorationTheme ??
18 | theme.inputDecorationTheme;
19 | }
20 |
21 | TextStyle get textStyle {
22 | return fieldTheme?.textStyle ??
23 | formTheme.textStyle ??
24 | theme.textTheme.titleMedium!;
25 | }
26 |
27 | MaterialStateProperty get textColor {
28 | return fieldTheme?.textColor ??
29 | formTheme.textColor ??
30 | SimpleMaterialStateProperty(
31 | normal: theme.textTheme.titleMedium!.color,
32 | disabled: theme.disabledColor,
33 | );
34 | }
35 | }
36 |
37 | /// Represents the basic theme for a field
38 | abstract class FieldTheme extends Equatable {
39 | /// Represents the style of the text within the field
40 | /// If null, defaults to the `subtitle` text style from the current [Theme].
41 | final TextStyle? textStyle;
42 |
43 | /// Resolves the color of the [textStyle].
44 | /// You will receive [MaterialState.disabled]
45 | final MaterialStateProperty? textColor;
46 |
47 | /// The theme for InputDecoration of this field
48 | final InputDecorationTheme? decorationTheme;
49 |
50 | const FieldTheme({
51 | this.textStyle,
52 | this.textColor,
53 | this.decorationTheme,
54 | });
55 |
56 | @override
57 | List