Search packages, repositories and app categories

outline_gradient_button cover
Package detailsv2.0.1+1

outline_gradient_button

OutlineGradientButton package developed to create buttons with gradient outline.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
22
Likes
97
Pub points
150

Install package

flutter pub add outline_gradient_button

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The outline_gradient_button package enables developers to create visually appealing buttons with gradient outlines in Flutter applications. It extends the standard button widgets by adding customizable gradient borders, allowing for modern and dynamic UI designs. Ideal for apps seeking a stylish, eye-catching interface without sacrificing functionality. The package supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux, ensuring consistent appearance across devices. With minimal setup via pub add, it integrates seamlessly into existing projects.

Use cases

  • Creating stylish UI elements
  • Enhancing app visual appeal
  • Designing interactive call-to-action buttons
  • Building modern mobile and web interfaces
  • Adding gradient effects to form buttons

Key features

  • Gradient outline styling
  • Cross-platform compatibility
  • Easy integration with Flutter
  • Customizable border colors and width
  • Supports various button types (e.g., ElevatedButton, TextButton)
  • Lightweight and performant

Suitable for

  • UI designers seeking visual flair
  • Developers building modern Flutter apps
  • Projects requiring gradient-based interactive elements
  • Apps targeting multiple platforms
  • Prototyping and production-ready interfaces

Considerations

  • May require additional styling for complex gradients
  • Limited to outline effects, not fill gradients
  • Performance impact on large numbers of buttons
  • Best used with contrasting background colors for visibility

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

wow

Example

Take a look at the provided example for how to use the OutlineGradientButton.

How to use

demo_button1

OutlineGradientButton(
  child: Text('WOW'),
  gradient: LinearGradient(
    colors: [Colors.purple, Colors.pink],
    begin: Alignment.topCenter,
    end: Alignment.bottomCenter,
  ),
  strokeWidth: 4,
),

demo_button2

OutlineGradientButton(
  child: Text('TEXT'),
  gradient: LinearGradient(colors: [Colors.pink, Colors.purple]),
  strokeWidth: 4,
  radius: Radius.circular(8),
),

demo_button3

OutlineGradientButton(
  child: Text('OMG'),
  gradient: LinearGradient(
    stops: [0, 0.5, 0.5, 1],
    colors: [Colors.green, Colors.green, Colors.red, Colors.red],
  ),
  strokeWidth: 4,
  corners: Corners(topLeft: Radius.elliptical(16, 14), bottomRight: Radius.circular(6)),
),

demo_button4

OutlineGradientButton(
  child: SizedBox(
    width: 52,
    height: 52,
    child: Column(
      mainAxisSize: MainAxisSize.min,
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        Icon(Icons.opacity, color: Colors.grey, size: 24),
        Text('TEXT', style: TextStyle(fontSize: 9)),
      ],
    ),
  ),
  gradient: LinearGradient(
    colors: [Colors.blue, Colors.black],
    begin: Alignment(-1, -1),
    end: Alignment(2, 2),
  ),
  strokeWidth: 4,
  padding: EdgeInsets.zero,
  radius: Radius.circular(26),
),

demo_button5

OutlineGradientButton(
  child: Text('Linear gradient', style: TextStyle(color: Colors.black, fontSize: 10)),
  gradient: LinearGradient(
    colors: List.generate(360, (h) => HSLColor.fromAHSL(1, h.toDouble(), 1, 0.5).toColor()),
  ),
  strokeWidth: 2,
  padding: EdgeInsets.symmetric(horizontal: 24, vertical: 12),
  radius: Radius.circular(8),
),

demo_button6

OutlineGradientButton(
  child: Text('Sweep gradient', style: TextStyle(color: Colors.black, fontSize: 10)),
  gradient: SweepGradient(
    colors: List.generate(360, (h) => HSLColor.fromAHSL(1, h.toDouble(), 1, 0.5).toColor()),
  ),
  strokeWidth: 2,
  padding: EdgeInsets.symmetric(horizontal: 24, vertical: 12),
  radius: Radius.circular(8),
),

demo_button7

OutlineGradientButton(
  child: Text('With background color and elevation', style: TextStyle(color: Colors.white, fontSize: 12)),
  gradient: LinearGradient(colors: [Colors.greenAccent, Colors.yellow]),
  strokeWidth: 2,
  padding: EdgeInsets.symmetric(horizontal: 24, vertical: 12),
  corners: Corners(topRight: Radius.circular(16), bottomRight: Radius.circular(16)),
  backgroundColor: Colors.lightBlue,
  elevation: 4,
  inkWell: true,
  onTap: () => showSnack('onTap'),
  onDoubleTap: () => showSnack('onDoubleTap'),
  onLongPress: () => showSnack('onLongPress'),
),

Categories

Source repository

Projects using this package