Skip to content

Current Text Controller - #19

Merged
jshep23 merged 21 commits into
3.0.0from
CurrentTextController
Apr 19, 2026
Merged

jshep23 merged 21 commits into
3.0.0from
CurrentTextController

Conversation

@jshep23

@jshep23 jshep23 commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces the new CurrentTextController integration to the example counter app and adds comprehensive exception handling for text controller usage. It also improves the synchronization between UI text fields and the underlying CurrentProperty values, and clarifies the distinction between standard and current-aware text controllers in the UI. Additionally, internal changes enhance property change tracking and ViewModel reset behavior.

CurrentTextController Integration & UI Enhancements:

  • Added CurrentTextController.string() for the name field in CounterPage, binding it to the name property in the ViewModel using the CurrentTextControllersLifecycleMixin. This keeps the text field in sync with the property automatically. (example/lib/counter_page.dart [1] [2]
  • Updated the UI to include a name input field and a dynamic greeting, and added an explanatory message highlighting the difference between CurrentTextController and standard TextEditingController. (example/lib/counter_page.dart [1] [2]
  • Exported current_text_controller.dart from the main library so it can be used externally. (lib/current.dart lib/current.dartR9)

ViewModel and Property Improvements:

Exception Handling for CurrentTextController:

  • Introduced several new exception classes for CurrentTextController to handle initialization, type mismatch, and usage errors, improving developer feedback and robustness. (lib/src/current_exceptions.dart [1] [2] [3]

Property Change Tracking:

  • Each CurrentProperty now has a unique sourceHashCode to better track the origin of changes, and this is included in all change notifications. (lib/src/current_property.dart [1] [2] [3] lib/src/current_view_model.dart [4] [5]

ViewModel Reset Improvements:

@jshep23 jshep23 added the 3.0.0 label Apr 19, 2026
@jshep23
jshep23 merged commit 4663570 into 3.0.0 Apr 19, 2026
3 checks passed
@jshep23
jshep23 deleted the CurrentTextController branch April 19, 2026 21:03
jshep23 added a commit that referenced this pull request Apr 28, 2026
* Support ViewModel Reassignment on CurrentWidget Rebuilds (#17)

* Added option to allow reassigning an existing view model to an new instance of a widget

* Assign the ViewModel to the hash of the state instead of the CurrentWidget

* Fix assignedTo check in ViewModel

* Update the already assigned exception to explain steps the user can take to support reassignment of view models

* Grammar...

* Grammar...

* Format exception message

* Add documentation to CurrentState

* Allow setting CurrentProperty by directly setting the value

* Enhance State Change Handling (#18)

* Changed StateChanged Stream to a single Event broadcaster

Added listenable support to busy status changes

* Updated example app to use new state changes

* Expand ErrorEvent handling options. Allow specific subscribing, and handling internal errors

* Add error handling example to example application

* Added isDirty property. Added factory shorthands for current specific primary property types

* Export CurrentClonable

* Update example view model to use new shorthand factory

* Added calculated isDirty getter to CurrentViewModel

* Add tests for isDirty prop

* Add docs to new BusyStatusChanged event

* Current Text Controller (#19)

* Implemented controller. Fixed vm reset not clearing busy status.

* Added CurrentTextController to Example project

* Fix type check on date time controller

* Fix default value, and hash equality assignments and checks

* Updated text field carrot snapback to select text when backspacing on a non-null field

* Fix date time asString when cant be parsed. added tests for other supported types

* Fix issue when resetting view model or using setMultiple manually. add test

* Update example. Added missing test.

* Clean up

* Make example page scrollable

* Add seperate custom and any state change listener

* Add seperate custom and any error event listeners

* Fix issue where lists and maps marked as dirty on initial set.

* Fixed an issue where calling resetAll on the view model behaved differently for lists and maps

* Report prop name and hash on list/map change. report inserted item instead of whole list. added tests

* Optionally allow external / parent widget to handle viewmodel lifecycle.

* Fix issue where setMultiple always issued notifications, even if nothing actually changed.

* Update value equality implementation. This fixes issues with map keys, and odd comparison results. Updated stale test descriptions.

* deprecated math functions on int property (generics were odd since you can't impl num)

* added tests for the new int property functions.

* added tests to cover null scenarios in double property math functions

* Current Validation & Revamp Example App (#20)

* Clean up statle documentation

* added current validation state. added additive extension (nonbreaking).

* add docs to new current validation classes. fix docs in view model. export current validation

* add some docs around the _omitted internal variable. added unit tests

* progress on integrating current validation with new current text controller.

* Add option to localize default validation errors

* Add additional docs to the current text controller

* update core web files for example app

* Progress on new space themed example app. added logos. removed old example page

* added flight forms page. redfactored app view model

* added launch missing, map and telemetry examples

* added widget tests

* add third version branding

* Move viewmodels out of widget pages

* clean up

* clean up

* clean up

* add code examples to example app. add link to third version website

* Restructure validation results to produce typed issues. This is to support localization without coupling ui to view models

* Update Readmes

* Change current validation to explicit opt in. Reduces footguns. Update docs and examples.

* clean up example propery initialization

* Clean up validation registration. better support context based localization

* Remove unused mixin. Remove tests

* Tie validation execution to TextFormFields. Added convenience Current text widgets without losing native support

* Added tests for text form field integration

* Update readme

* add convenience setter functions for various properties

* Rename factories on CurrentTextController for consistency

* 3.0.0 Beta 1 (#21)

* bump version, generate docs

* Add changelog entry

* Improve DX When Binding CurrentTextControllers (#23)

* Add type specific controllers to tighten api around binding

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant