flutter_colored_progress_indicators 1.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 53

flutter_colored_progress_indicators | flutter flutter #


example

An alternate animated progress indicator widget for flutter's CircularProgressIndicator, LinearProgressIndicator and RefreshIndicator with Google color accents.

Features #

  • Colorful CircularProgressIndicator
  • Colorful LinearProgressIndicator
  • Colorful RefreshIndicator yes that's it.

Getting Started #

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  flutter_colored_progress_indicators: ^1.2.0

In your library add the following import:

import 'package:flutter_colored_progress_indicators/flutter_colored_progress_indicators.dart';

After that run flutter pub get

For help getting started with Flutter, view the online documentation.

Usage #

For Circular Progress Indicator -

...
child: ColoredCircularProgressIndicator()
...

For Linear Progress Indicator -

...
child: ColoredLinearProgressIndicator()
...

For Refresh Indicator -

...
child: ColoredRefreshIndicator(
  child: SingleChildScrollView(
    physics: AlwaysScrollableScrollPhysics(),
    child: ...
  )
)
...

Properties #

Same as that of Flutter's official CircularProgressIndicator, LinearProgressIndicator and RefreshIndicator but without the valueColor/color property (because it changes with the color animation).

Changelog #

See CHANGELOG.md for recent changes.

TO-DO #

  • [x] Merge changes from official flutter dev branch
  • [ ] Shorter names for indicators
  • [x] Google color accents
  • [ ] Animation speed control factor
  • [x] Refactoring

Contributions #

You can be of great help if you want to improve or add anything !

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

License #

Package licensed under the MIT License.

[1.2.0] - 2020-06-13 #

[1.1.0] - 2020-05-04 #

  • Added ColoredRefreshIndicator and a modified refresh progress indicator from flutter's source.
  • Updated example app.

[1.0.1] - 2020-04-25 #

  • Added example app.

[1.0.0] - 2020-04-25 #

  • Initial release.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:flutter_colored_progress_indicators/flutter_colored_progress_indicators.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: ColoredProgressDemo(),
    );
  }
}

class ColoredProgressDemo extends StatefulWidget {
  @override
  _ColoredProgressDemoState createState() => _ColoredProgressDemoState();
}

class _ColoredProgressDemoState extends State<ColoredProgressDemo> {
  Future<void> _refreshState() async {
    await Future.delayed(Duration(seconds: 7));
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: Text("Scroll from top for Refresh Indicator"),
      ),
      body: ColoredRefreshIndicator(
        onRefresh: () => _refreshState(),
        child: SingleChildScrollView(
          padding: EdgeInsets.symmetric(vertical: 20.0),
          physics: AlwaysScrollableScrollPhysics(),
          child: Center(
            child: Column(
              children: [
                Text(
                  "Without Colorful Accents (default)",
                  textScaleFactor: 2.0,
                  textAlign: TextAlign.center,
                  style: TextStyle(decoration: TextDecoration.underline),
                ),
                SizedBox(height: 50.0),
                SizedBox(
                  height: 100.0,
                  width: 100.0,
                  child: CircularProgressIndicator(strokeWidth: 8.0),
                ),
                SizedBox(height: 50.0),
                SizedBox(
                  width: 400.0,
                  child: LinearProgressIndicator(),
                ),
                SizedBox(height: 80.0),
                Text(
                  "With Colorful Accents",
                  textScaleFactor: 2.0,
                  textAlign: TextAlign.center,
                  style: TextStyle(decoration: TextDecoration.underline),
                ),
                SizedBox(height: 50.0),
                SizedBox(
                  width: 100.0,
                  height: 100.0,
                  child: ColoredCircularProgressIndicator(strokeWidth: 8.0),
                ),
                SizedBox(height: 50.0),
                SizedBox(
                  width: 400.0,
                  child: ColoredLinearProgressIndicator(),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_colored_progress_indicators: ^1.2.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_colored_progress_indicators/flutter_colored_progress_indicators.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
29
Health:
Code health derived from static analysis. [more]
75
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
53
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Health issues and suggestions

Fix lib/src/ColoredLinearProgressIndicator.dart. (-25 points)

Analysis of lib/src/ColoredLinearProgressIndicator.dart failed with 1 error:

line 67 col 13: The named parameter 'minHeight' isn't defined.

Format lib/flutter_colored_progress_indicators.dart.

Run flutter format to format lib/flutter_colored_progress_indicators.dart.

Format lib/src/ColoredCircularProgressIndicator.dart.

Run flutter format to format lib/src/ColoredCircularProgressIndicator.dart.

Format lib/src/ColoredRefreshIndicator.dart.

Run flutter format to format lib/src/ColoredRefreshIndicator.dart.

Format lib/src/ColoredRefreshProgressIndicator.dart.

Run flutter format to format lib/src/ColoredRefreshProgressIndicator.dart.

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test