lively_generator 1.1.0
lively_generator: ^1.1.0 copied to clipboard
Code generator for the lively reactive Flutter widget package.
1.1.1 #
- Fix:
build<FieldName>()helpers are now declared as concrete stubs on the abstract_$ClassNamebase, so calling them inside the user'sbuild()method passes static analysis without errors. - Fix:
@LiveStore()fields are now recognised asChangeNotifiersubtypes even when their generated base class (_$StoreName) is not yet resolved during the current build step. - Generator now emits
$genand$changed(no leading underscore) for internal local variables to satisfy theno_leading_underscores_for_local_identifierslint rule in the generated output.
1.1.0 #
Future<T>/Stream<T>field support — declare aFuture<T>orStream<T>field and the generator produces an<fieldName>Stateof typeAsyncValue<T>(starts asAsyncLoading), full lifecycle wiring ininitState/dispose, and abuild<FieldName>({required data, loading, error})helper method. Theloadinganderrorparams default toCircularProgressIndicatorandSizedBox.shrink(). Reassigning the field resets toAsyncLoadingand re-subscribes (old stream subscription is cancelled). Works in both@Live()widgets and@LiveStoreclasses. TheAsyncValue<T>sealed type (AsyncLoading,AsyncData,AsyncError) is shipped in thelivelyruntime.@computedfields — annotate a getter with@computedto cache its result and only recompute when any reactive field changes. The generator emits a nullable backing field, a dirty flag (startstrue), and an overridden getter that recomputes lazily. Every reactive setter (scalar, collection, proxy, ChangeNotifier) marks all@computedgetters dirty before scheduling a rebuild. Works in both@Live()widgets and@LiveStoreclasses.- Generator now throws a clear
InvalidGenerationSourceErrorwhen a@Live()class does not extend_$ClassName, or a@LiveStore()class does not extend_$StoreName. The error message includes the exact fix required, so you get an actionable build-time message instead of non-compilable generated code.
1.0.1 #
- Added example demonstrating
@Live()and@LiveStore()annotated classes. - Updated README with full AI agent usage guide and field classification reference.
- Fixed
homepage, addedrepositoryandissue_trackerto pubspec.
1.0.0 #
- Initial release.
LivelyGeneratorprocesses both@Live()and@LiveStore()annotations in a singlegenerate()call per file, ensuring proxy classes are deduplicated across both annotation types.@Live(): emits aStatefulWidgetwrapper, an abstractStatebase, and a concrete impl. Classifies fields into widget params (late final), disposables,ChangeNotifier, owned@LiveStore, proxy objects,LiveList,LiveSet,LiveMap, and reactive scalars.@LiveStore(): emits an abstractChangeNotifierbase (_$StoreName) and a public concrete class (StoreName). Classifies fields identically to@Live()with the addition of DI constructor params fromlate finalfields without initializers.- Generates
_Live<ClassName>proxy subclasses for plain mutable objects, with recursive nesting and cycle detection. - All generated dispose / addListener / removeListener calls use
?.for nullable field types. - Emits
@mustCallSuperon baseinitStateanddisposestubs. - Logs build-time warnings for proxy fallbacks (final/sealed classes, missing default constructor) and map key identity issues.