hz_loading_button

A simple, customizable loading button widget for Flutter.
It wraps an ElevatedButton and automatically shows a CircularProgressIndicator when performing async tasks.
The button width remains stable while loading, avoiding layout shifts.


✨ Features

  • Async-safe: disables itself while running onPressed.
  • Smooth loading indicator swap with AnimatedSwitcher.
  • Preserves button width during loading.
  • Fully customizable colors, padding, border radius, and elevation.
  • Optionally expand to full width.
  • Supports minimum width to prevent shrinking on load.

🚀 Getting started

Add this to your app’s pubspec.yaml:

dependencies:
  hz_loading_button: ^0.0.1