loading_provider 0.0.1 copy "loading_provider: ^0.0.1" to clipboard
loading_provider: ^0.0.1 copied to clipboard

Self defined overlay loadings

# loading_provider

Amit's Flutter package for easily displaying loading overlays with customizable configurations.

## Installation

Add the following dependency to your `pubspec.yaml` file:

```yaml
dependencies:
  loading_provider: ^1.0.0

Usage #

  1. Import the package:
import 'package:loading_provider/loading_provider.dart';
  1. Wrap your MaterialApp or root widget with LoadingProvider:
void main() {
  runApp(
    LoadingProvider(
      appBuilder: (context, child) {
        return MaterialApp(
          title: 'My App',
          home: MyHomePage(),
        );
      },
    ),
  );
}
  1. Use the LoadingBuilder widget to show loading overlays:
LoadingBuilder(
  builder: (context, setLoading) {
    return ElevatedButton(
      onPressed: () async {
        setLoading(true); // Show loading overlay
        await Future.delayed(Duration(seconds: 2));
        setLoading(false); // Hide loading overlay
      },
      child: Text('Show Loading'),
    );
  },
);

Customization #

You can customize the loading overlay by providing a LoadingConfig object with your desired configurations:

LoadingConfig(
  backgroundColor: Colors.blue.withOpacity(0.5),
  widget: CircularProgressIndicator(
    valueColor: AlwaysStoppedAnimation(Colors.white),
  ),
)

Author #

Amit's Picture

GitHub: Amit Hasan

3
likes
0
points
69
downloads

Publisher

unverified uploader

Weekly Downloads

Self defined overlay loadings

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, provider

More

Packages that depend on loading_provider