new_loading_indicator 4.0.0 copy "new_loading_indicator: ^4.0.0" to clipboard
new_loading_indicator: ^4.0.0 copied to clipboard

A fork of the loading_indicator package, providing a rich collection of loading animations for Flutter applications.

4.0.0 #

Brings the package up to date with upstream loading_indicator 4.0.2. See "Migrating from 3.x" in the README.

Breaking changes

  • LoadingIndicator.pause is removed. Pass a LoadingIndicatorController to the new LoadingIndicator.controller and call pause() and resume() on it instead.
  • When strokeWidth is set, the five line indicators (lineScale, lineScaleParty, lineScalePulseOut, lineScalePulseOutRapid and lineSpinFadeLoader) draw their bars at that width, centred in the space they used to fill. Without strokeWidth they look as before.
  • Indicator.circleStrokeSpin no longer wraps CircularProgressIndicator. It draws a three-quarter ring that turns once every 1200 ms, honours strokeWidth and pathBackgroundColor, and no longer needs a package:material_ui theme.

New

  • LoadingIndicatorController, a ChangeNotifier that controls one indicator:
    • pause() freezes it on the current frame and resume() carries on from there.
    • pauseAt(progress) pauses at a point in the animation cycle, either by playing on to it (LoadingIndicatorPauseBehavior.waitUntilTarget, the default) or by jumping there at once (jumpToTarget). The returned future completes once the indicator has paused, or fails with LoadingIndicatorCommandCanceled if another command replaces it first.
    • status (LoadingIndicatorPlaybackStatus), progress and isAttached report its state, and listeners are notified whenever they change.
    • Commands given before the indicator is built are applied when it is, and the latest command is applied again to each new indicator the controller is given.
  • All 34 indicators, including circleStrokeSpin, can be paused, resumed and moved to any point. Indicators made of several animations keep their relative timing, and reversing animations keep their direction.

Improvements over upstream 4.0.2

  • Adding or removing an indicator no longer notifies listeners in the middle of a build. Upstream throws "setState() or markNeedsBuild() called during build" when a ListenableBuilder outside the indicator listens to its controller and the indicator is added or removed.
  • pauseAt(..., behavior: waitUntilTarget) stops every animation exactly on the target frame, instead of letting them overshoot and snapping them back. Resuming or re-targeting during the wait does not restart the animations, so they do not hitch.
  • A canceled pauseAt future that nothing listens to is not reported as an unhandled error.
  • An indicator moved with a GlobalKey from under a controller to a place without one starts playing on its own, instead of staying paused.
  • A line bar whose height animates below its configured width keeps that width. Upstream widens it to fill its whole slot for as long as it is that short.

Internal

  • The IndicatorController mixin moved to lib/src/control/loading_indicator_controller.dart and now starts every indicator's animation controllers. Indicators declare reversing animations with repeatsInReverse instead of calling repeat() themselves.
  • Tests: 369 to 434, line coverage stays at 100%. Upstream's controller tests are ported, plus tests for each improvement above.
  • The example shows the controller's status and progress and demonstrates pausing, pauseAt and stroke widths.

3.0.0 #

Breaking changes

  • Requires Dart 3.13.5 and Flutter 3.47.6 or newer.
  • The package uses package:material_ui instead of package:flutter/material.dart. Host apps must provide a Theme from package:material_ui (typically by using that package's MaterialApp). A legacy MaterialApp from package:flutter/material.dart does not satisfy the colour fallback.
  • Indicator.circleStrokeSpin wraps CircularProgressIndicator from package:material_ui, which also requires that theme.

2.0.0 #

Breaking changes

  • Requires Dart 3.13.3 and Flutter 3.47.3 or newer.
  • When colors is null or empty, the indicator now falls back to ColorScheme.primary instead of ThemeData.primaryColor. In a Material 3 dark theme the old value resolved to grey[900] and was hard to see.
  • Indicator.ballPulseSync now assigns colour indices 0, 1, 2 to its three balls (previously 0, 2, 4), matching every other indicator.
  • The debugPrint warning emitted on each build when pause: true was combined with Indicator.circleStrokeSpin is gone. The limitation is documented on LoadingIndicator.pause instead.

Fixes

  • A pause change that happened while an indicator element was deactivated (for example during GlobalKey reparenting) was never applied to its animation controllers.
  • DecorateData.hashCode did not agree with its == for equal colour lists that were distinct objects.
  • BallRotateChase called repeat() once per ball on its single controller.

Internal

  • Removed the unused async and collection dependencies.
  • All indicator widgets are final class; controllers and animations are late final; enum arguments use dot shorthands.
  • Placeholder List.filled(n, Container()) lists replaced with collection for; Spacer and Row.spacing replace hand-built spacers.
  • Tests: 169 to 368, line coverage 97.3% to 100%. The public LoadingIndicator is now exercised for every Indicator value (build, animate, pause/resume, dispose), every Shape is checked against real canvas calls, and the controller lifecycle is covered.
  • Enabled prefer_final_locals, prefer_final_in_for_each, unnecessary_lambdas, avoid_redundant_argument_values and prefer_single_quotes.
  • CI installs the pinned Flutter release from the official tarball (checksum verified) and runs dart format and flutter analyze --fatal-infos before tests.

1.2.2 #

  • Update dependencies and Dart/Flutter SDK constraints.

1.2.1 #

Update Dart and Flutter SDK version constraints. Fix failing tests. Replace GitHub repository URL with GitLab.

1.1.0 #

Update version numbers, dependencies, and analysis options. Adjusted code formatting for consistency and improved animation handling in various indicators.

1.0.2 #

  • Bump Dart and Flutter SDK constraints.
  • Change the repository URL.

1.0.1 #

  • Created an example application to showcase the loading indicator animations.
  • Added the link to the example application running on GitLab Pages to README.md.

1.0.0 #

  • Initial release of the new_loading_indicator package.
  • Added 169 tests with 97.3% coverage ensuring reliability.
  • Added comprehensive documentation for all animations and usage scenarios.
12
likes
160
points
733
downloads

Documentation

API reference

Publisher

verified publisherbizjak.dev

Weekly Downloads

A fork of the loading_indicator package, providing a rich collection of loading animations for Flutter applications.

Repository (GitLab)
View/report issues

Topics

#loading-indicator

License

Apache-2.0 (license)

Dependencies

flutter, material_ui

More

Packages that depend on new_loading_indicator