Last updated:
0 purchases
progress alert
progress_alert #
Progress Alert is customizable alert for showing process which is progressing in background
Features #
Single line basic alert
Customizable Features
Change all button texts
Change height
Change position as top/bottom
Change icons
Change display time of failed process alert
Getting started #
You must add the library as a dependency to your project.
dependencies:
progress_alert: ^latest
copied to clipboard
Then run flutter packages get
Example Project #
There is a detailed example project in the example folder. You can directly run and play on it. There are code snippets from example project below.
Basic Setup #
Add ProgressAlert() to Material App's builder as example
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
builder: (context, child) => Stack(
children: [child!, ProgressAlert()],
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
copied to clipboard
Start controller
final controller = ProgressPanel();
copied to clipboard
Create progress
Future<void> func() async {
await Future.delayed(const Duration(seconds: 3));
setState(() {
_counter++;
});
}
ProgressItem progress = ProgressItem(
process: func,
processText: "Counter Incrementing",
errorText: "Counter Incrementing Failed!",
onCancel: () {
print("Progress Cancelled");
},
onDone: () {
print("Progress Done");
},
onError: (e) {
print("Progress Failed:$e");
});
copied to clipboard
Add and start process
controller.addProcess(progress);
copied to clipboard
Customizable Features #
ProgressAlert
ProgressAlert(
redoText: "Redi",
height: 50,
hideText: "Hide",
cancelText: "Cancel",
errorIcon: const Icon(Icons.error),
progressIcon: const CircularProgressIndicator(),
isTop: true,
)
copied to clipboard
ProgressItem
ProgressItem progress = ProgressItem(
process: func,
processText: "Counter Incrementing",
errorText: "Counter Incrementing Failed!",
onCancel: () {
print("Progress Cancelled");
},
onDone: () {
print("Progress Done");
},
onError: (e) {
print("Progress Failed:$e");
});
copied to clipboard
Displaying Fail
final controller = ProgressPanel();
controller.setFailDuration=const Duration(seconds: 10);
//If you want the error not to be cleared from the screen turn false
controller.changeRemoveFailAfterDuration=true;
copied to clipboard
Contributions #
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.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.