progressive_button_flutter 1.2.0

SDKflutter
Platformandroidiosmacosweb

A customizable Flutter button widget with built-in loading and progress indicators.

Pub Version

Progressive Button

A customizable Flutter button widget with built-in loading and progress indicators.

Features

  • Customizable width and height
  • Built-in loading animation
  • Progress indicator with percentage
  • Circular progress indicator (optional)
  • Stretches to full width (optional)
  • Estimated time-based progress simulation
  • Success and failure callbacks
  • Completion callback
  • Elevation and shadow color customization
  • Haptic feedback (optional)
  • Custom audio effect on button press

Parameters

ParameterTypeDefault ValueDescription
textStringRequiredThe text to display on the button
onPressedFuture<void> Function()RequiredThe async function to execute when button is pressed
onSuccessFuture<void> Function()?nullCallback function to execute on success
onFailureFuture<void> Function()?nullCallback function to execute on failure
onCompleteFuture<void> Function()?nullCallback function to execute on completion
estimatedTimeDurationRequiredExpected duration of the async operation
widthdouble200Width of the button (ignored if stretched is true)
heightdouble40Height of the button
backgroundColorColorColor(0xFFADD8E6)Background color of the button
progressColorColorColor(0xFF87CEEB)Color of the progress indicator
showCircularIndicatorbooltrueWhether to show the circular loading indicator
progressCapdouble0.9Maximum progress value before completion (0.0 to 1.0)
stretchedboolfalseWhether the button should stretch to full width
textStyleTextStyleTextStyle(...)Text style of the button text
borderRadiusBorderRadiusBorderRadius.all(Radius.circular(20))Border radius of the button
elevationdoubleRequiredElevation of the button
shadowColorColorColors.transparentShadow color of the button
enableHapticFeedbackbooltrueWhether to enable haptic feedback on button press
audioAssetPathString?nullPath for custom audio effect
volumedouble1.0Volume for the audio effect
isEnabledbooltrueWhether the button is enabled or disabled

Usage

// Fixed width button
ProgressiveButtonFlutter(
  text: "Submit",
  onPressed: () async => await submitData(),
  estimatedTime: Duration(seconds: 2),
);

// Full width button
ProgressiveButtonFlutter(
  text: "Submit",
  onPressed: () async => await submitData(),
  estimatedTime: Duration(seconds: 2),
  stretched: true,
);

// Custom styled button
ProgressiveButtonFlutter(
  text: "Submit",
  onPressed: () async => await submitData(),
  estimatedTime: Duration(seconds: 3),
  width: 250,
  height: 50,
  backgroundColor: Colors.blue,
  progressColor: Colors.lightBlue,
  showCircularIndicator: false,
  progressCap: 0.8,
  audioAssetPath: 'assets/audio/pop_effect.wav',
  volume: 0.5,
);

🚀Showcase

demo](https://gifyu.com/image/SelEy)