Skip to content

Refactor/cubit to notifier migration#42

Open
aydinguven-leancode wants to merge 23 commits into
refactor/forms-reworkfrom
refactor/cubit-to-notifier-migration
Open

Refactor/cubit to notifier migration#42
aydinguven-leancode wants to merge 23 commits into
refactor/forms-reworkfrom
refactor/cubit-to-notifier-migration

Conversation

@aydinguven-leancode

Copy link
Copy Markdown

LMG-394

  • Migration from Cubit to a Value Notifier based state management
  • Dropped dependencies: flutter_bloc, rx_dart, flutter_hooks, equatable`
  • Name changes for relevant classes
  • Relevant changes on tests and example project

LMG-404

  • Partially modified Readme.md and Changelog.md files about the above migration
  • Introduced Migration.md file
  • Added a few more examples as well as short descriptions to each example page

aydinguven-leancode and others added 4 commits June 19, 2026 09:57
…nagement

Migrated from Cubit (Bloc) to value notifier.
Removed dependencies: flutter_bloc, rx_dart, equatable,
Changes are reflected on examples
Changes are reflected on tests
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread example/lib/controllers/focusable_text_field_controller.dart Outdated
Comment thread example/lib/controllers/focusable_text_field_controller.dart Outdated
Comment thread EXAMPLES.md Outdated
Comment thread EXAMPLES.md Outdated
Comment thread EXAMPLES.md Outdated
FieldBuilder<String, ValidationError>(
field: context.read<SignupController>().email,
builder: (context, state) => TextFormField(
controller: context.read<SignupController>().email.textController,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already passed the field controller, why fetch it again? Please just add the field controller itself into the builder callback params.

@aydinguven-leancode aydinguven-leancode Jun 24, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, while the examples changed drastically, the point having the fieldController as a part of builder params makes sense. I have prepared a PoC on how this could work, here is the PR about that: #43

the PR is breaking things and having a conflict but if you could share your opinion on the core idea of using instead of <T, E> that would be already great.

Comment thread EXAMPLES.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread pubspec.yaml Outdated
Comment thread lib/src/field/field_controller.dart Outdated
Comment thread lib/src/form_group/form_group_controller.dart Outdated
Comment thread lib/src/field/field_controller.dart Outdated
Comment thread lib/src/field/field_controller.dart Outdated
Comment thread example/lib/screens/delivery_form.dart Outdated
Comment thread example/lib/screens/optimized_rendering_form.dart Outdated
Comment thread example/pubspec.yaml Outdated
Comment thread lib/src/form_group/form_group_controller.dart Outdated
Comment thread EXAMPLES.md
Comment thread example/test/screens/simple_form_test.dart
Comment thread lib/src/form_group/form_group_controller.dart Outdated
Removed unnecessary //ignore commands
Reverted version change on leancode_lint in example project
Added debugLabel
Removed the bits about previous versions from EXAMPLES.md
Added `child` param to fieldBuilder class to fully support builder closures
Various minor fixes
Examples modified
FormGroupState is renamed into FormState
Examples and tests modified accordingly
Comment thread lib/src/field/advanced_field_controller.dart Outdated
aydinguven-leancode and others added 8 commits June 23, 2026 18:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Added isDisposed flag to the FormController class + tests
…ld-subscription-fix

Added an example with autoValidation + subscribeToFields combo
* Added FocusNode support in AdvancedTextFieldController

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread example/lib/screens/complex_form.dart Outdated
Comment thread lib/src/field/advanced_text_field_controller.dart Outdated
Comment thread lib/src/form/advanced_form_controller.dart Outdated
Comment thread lib/src/form/advanced_form_controller.dart Outdated
Comment thread lib/src/form/advanced_form_controller.dart Outdated
Comment on lines +37 to +40
/// Optional name for the field. Useful for debugging, logging, and
/// serialization. Not used for identity — fields are still identified by
/// reference.
final String? name;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that maybe an example with these names would be useful; I'm still not sure how to use this field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants