Changes already applied in this pass are listed first. Items below that are suggestions: they improve the package but change behavior, pub constraints, or the public API enough to confirm before shipping.
- Start infinite loops with
AnimationController.repeat()instead of oneforward()cycle thenrepeat(). - Update
controller.durationwhenperiodchanges. - Restart cleanly when
enabledgoes fromfalsetotrue, including after a finiteloophas finished. directioncallsmarkNeedsPaint()rather thanmarkNeedsLayout().- Extract
shimmerHighlightRectso highlight travel can be unit-tested. - Remove leftover
lib/main.dart(default Flutter counter, not part of the package API).
- One shimmer per screen, not per row. The example already does this.
Document it in app code reviews: each
Shimmerowns a ticker and a compositing layer. - Optional
RepaintBoundaryaroundShimmer. Isolates the shader animation from ancestors. Apps can wrap it; adding it inside the package can surprise layout that relies on parent layer merging. - Reuse the
Shaderwhen onlypercentis unchanged. TodaycreateShaderruns every paint, which is required because the rect moves. Ifpercentandsizeare unchanged, skip shader creation (the existing setters already avoid extra paints). - Avoid
saveLayerelsewhere in the child.BlendMode.srcInalready composites; extra opacity/save layers on the child increase GPU cost.
loop == 1vsloop == 0. Finite loops still useforwardplus a status listener. That is correct; do not switch finite loops torepeatwith a counter unless you also handleenabledmid-cycle.- Reset
_countwhenloopshrinks while the widget is still mounted and enabled. Current code only restarts when the controller is idle. - Honor
Duration.zero/ negativeloop. Guard with asserts so bad values fail in debug instead of hanging a ticker.
- Theme-aware defaults. A
Shimmer.theme(context)helper that readsColorSchemewould reduce boilerplate for skeleton screens, but it is a new constructor. Semantics/ accessibility. Announce “Loading” whileenabledis true. Must be opt-in so existing trees do not get duplicate semantics.fromColorsdiagonal gradient.begin: topLeftandend: centerRightis slightly diagonal. A true horizontal band would useAlignment.centerLeft→Alignment.centerRight. Changing it would visually break apps that depend on the current slant.
- CI still used
actions/checkout@v1, Java 12, and the Flutter beta channel. Unit tests for this package do not need Android toolchains. analysis_options.yamlis a dated Flutter-repo snapshot. Rules such asiterable_contains_unrelated_typewere removed from the linter. Preferpackage:flutter_lintsonce you are ready to fix new findings.examplepubspec is still namednew_examplewith a default description. Rename for pub.dev example scoring if you republish.- LICENSE text is the Dart project BSD header (Google Inc., 2013), not a project-specific copyright. Confirm with the maintainer before editing.
- Minimum Flutter SDK was raised to
>=3.44.0(Dart^3.12.0) with thematerial_ui4.0.0 migration.