new_loading_indicator

A fork of the loading_indicator package, providing a rich collection of loading animations for Flutter applications. The original package is unmaintained, has outdated dependencies, poor documentation, and was written without a single test. This fork aims to:

  • Modernize the codebase for compatibility with the latest Flutter/Dart SDK versions
  • Update outdated dependencies
  • Add comprehensive test coverage
  • Provide detailed documentation for maintainability
  • Ensure ongoing maintenance and active development

Visit the example on GitLab Pages for a live demo.

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  new_loading_indicator: ^latest_version

Usage

import 'package:new_loading_indicator/new_loading_indicator.dart';

// Basic usage
LoadingIndicator(
  indicatorType: Indicator.ballPulse, // Choose your animation
  colors: const [Colors.white],        // Customize colors
  strokeWidth: 2,                      // Customize the stroke width
  backgroundColor: Colors.black,       // Optional background color
);

// With custom size
SizedBox(
  width: 100,
  height: 100,
  child: LoadingIndicator(
    indicatorType: Indicator.ballSpinFadeLoader,
    colors: const [Colors.white],
  ),
);

Available Indicators

The package includes 34 indicators, each customizable to match your app's design:

  • Ball Pulse
  • Ball Grid Pulse
  • Ball Clip Rotate
  • Square Spin
  • Ball Clip Rotate Pulse
  • Ball Clip Rotate Multiple
  • Ball Pulse Rise
  • Ball Rotate
  • Cube Transition
  • Ball Zig Zag
  • Ball Zig Zag Deflect
  • Ball Triangle Path
  • Ball Triangle Path Colored
  • Ball Triangle Path Colored Filled
  • Ball Scale
  • Line Scale
  • Line Scale Party
  • Ball Scale Multiple
  • Ball Pulse Sync
  • Ball Beat
  • Line Scale Pulse Out
  • Line Scale Pulse Out Rapid
  • Ball Scale Ripple
  • Ball Scale Ripple Multiple
  • Ball Spin Fade Loader
  • Line Spin Fade Loader
  • Triangle Skew Spin
  • Pacman
  • Ball Grid Beat
  • Semi Circle Spin
  • Ball Rotate Chase
  • Orbit
  • Audio Equalizer
  • Circle Stroke Spin

Pausing

Set pause: true to freeze an indicator in place; set it back to false to resume from the same frame.

LoadingIndicator(
  indicatorType: Indicator.ballPulse,
  pause: isPaused,
);

Indicator.circleStrokeSpin wraps Flutter's CircularProgressIndicator and can't be paused.

Colors

When colors is null or empty, the indicator uses Theme.of(context).colorScheme.primary. Indicators with several shapes cycle through the list, so [Colors.red, Colors.blue] alternates the two.

Test Coverage Report

$ flutter test --coverage && lcov --summary coverage/lcov.info
00:12 +368: All tests passed!
Reading tracefile coverage/lcov.info.
Summary coverage rate:
  source files: 39
  lines.......: 100.0% (1479 of 1479 lines)
  functions...: no data found

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the Apache License 2.0. The original work is copyrighted by its respective owners and continues to be licensed under the Apache License 2.0. Refer to the NOTICE file for more details.