gradient_elevated_button
2.0.1, released 2 days ago by an unverified publisher
Custom elevated button with gradient background for Flutter apps
What it does
Provides a GradientElevatedButton widget that supports gradient backgrounds, custom foreground colors, padding, shape, elevation, and theming via ThemeExtension. It works with both Flutter's material and the standalone material_ui package.
AI-written summary of version 2.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a button with a gradient background
- You want to theme all gradient buttons consistently across the app
- You are using material_ui or Flutter 3.47+
Skip it when
- You are targeting Flutter versions below 3.27 and cannot use material_ui
- You need a button that supports complex animations beyond simple gradients
Strengths
- Easy to use API with styleFrom
- Supports theming via ThemeExtension
- Works with both material and material_ui
- Includes widget tests and migration guide
Weaknesses
- Requires Flutter 3.27+ or material_ui 3.47+
- Not compatible with older Flutter versions
- Limited to elevated button style only
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add dependency to pubspec, import package, use GradientElevatedButton widget
GradientElevatedButton(
onPressed: () {},
style: GradientElevatedButton.styleFrom(
backgroundGradient: LinearGradient(
colors: [Colors.blue, Colors.green],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
foregroundColor: Colors.white,
),
child: const Text('Gradient Button'),
)Alternatives
Packages that do the same job and could replace gradient_elevated_button.
- extended_text
An extension of Flutter's official Text widget for special inline content and custom overflow.
60Compare - flutter_moving_background
Flutter package for animated moving backgrounds like gradients, particles, waves and rain.
65Compare - group_button
Flutter custom widget to make a group buttons. Included Radio and CheckBox buttons.
50Compare - gradient_circular_progress_indicator
A customizable circular progress widget with gradient progress value color.
50Compare
Works with
Packages commonly used together with gradient_elevated_button: ones it builds on, ones built on it, and its own family.