An open API service indexing awesome lists of open source software.

https://github.com/programmerhasan/easyloading

A simple and customizable Flutter package for showing loading indicators.
https://github.com/programmerhasan/easyloading

easy-loading flutter loading

Last synced: 5 months ago
JSON representation

A simple and customizable Flutter package for showing loading indicators.

Awesome Lists containing this project

README

          

Easy Loading.


A simple and customizable Flutter package for showing loading indicator. It helps developers display smooth and responsive loading overlays with minimal setup and easy-to-use APIs.
.




Loading for Flutter

---

## Features
- Normal loading overlay with blur effect
- Customizable `CircularProgressIndicator`
- Progress loader with percentage display
- Easy to show and dismiss

---

## Quickstart

### Add dependency to your pubspec file

Add this to your `pubspec.yaml`:

```yaml
dependencies:
easyloading_plus: ^1.0.0
```
Then run:
```
flutter pub get
```

### Usage

Show normal loader
```agsl
EasyLoading.show(context);
```
Show progress loader
```agsl
EasyLoading.showProgress(context, 50); // 50% complete
```
Dismiss loader
```agsl
EasyLoading.dismiss();
```

### Example

See example/main.dart for a full working example.

```dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:easyloading_plus/easyloading_plus.dart';

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

class MyApp extends StatelessWidget {
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'EasyLoading Example',
home: const HomePage(),
);
}
}

class HomePage extends StatelessWidget {
const HomePage({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text("EasyLoading Example")),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
EasyLoading.show(context);
Future.delayed(const Duration(seconds: 3), () {
EasyLoading.dismiss();
});
},
child: const Text("Show Loader"),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
double percent = 0;
EasyLoading.showProgress(context, percent);

// simulate progress using Timer.periodic
Timer.periodic(const Duration(milliseconds: 300), (timer) {
percent += 10;
if (percent > 100) {
EasyLoading.dismiss();
timer.cancel();
} else {
EasyLoading.showProgress(context, percent);
}
});
},
child: const Text("Show Progress Loader"),
),
],
),
),
);
}
}
```