https://github.com/leoncolt/gradient_loading_button
https://github.com/leoncolt/gradient_loading_button
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/leoncolt/gradient_loading_button
- Owner: LeonColt
- License: mit
- Created: 2021-01-16T00:15:35.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-15T04:44:19.000Z (almost 2 years ago)
- Last Synced: 2025-01-15T10:59:58.627Z (over 1 year ago)
- Language: Dart
- Size: 348 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Loading Button
A simple button that gives you the possibility to
transform into a circular one and shows a progress indicator and with success and error state.

## How to use
```dart
Container(
width: 200,
height: 60,
child: LoadingButton(
gradient: new LinearGradient(
colors: [
Colors.red,
Colors.blue,
]
),
style: new ButtonStyle(
shape: MaterialStateProperty.all(new RoundedRectangleBorder(
borderRadius:
const BorderRadius.all(const Radius.circular(15.0)),
)),
),
strokeWidth: 2,
child: Text(
"Sample",
style: TextStyle(
color: Colors.white,
fontSize: 24,
),
),
errorChild: const Icon( Icons.close_sharp, color: Colors.white, ),
successChild: const Icon( Icons.check_sharp, color: Colors.white, ),
onPressed: ( controller ) async {
await controller.loading();
await new Future.delayed( const Duration( seconds: 3 ) );
if ( Random.secure().nextBool() )
await controller.success();
else await controller.error();
},
),
),
```
Please check the example folder for a simple implementation.
## Changelog
Please see the [Changelog](CHANGELOG.md) page to know what's recently changed.
## Contributions
Feel free to contribute to this project.
If you find a bug or want a feature, but don't know how to fix/implement it, please fill an [issue](https://github.com/LeonColt/gradient_loading_button/issues).
If you fixed a bug or implemented a new feature, please send a [pull request](https://github.com/LeonColt/gradient_loading_button/pulls).
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details