gradient_elevated_button 0.0.3 copy "gradient_elevated_button: ^0.0.3" to clipboard
gradient_elevated_button: ^0.0.3 copied to clipboard

Custom Flutter button with gradient background for visually appealing UI.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:gradient_elevated_button/gradient_elevated_button.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Gradient Elevated Button',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({
    super.key,
  });
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Gradient Elevated Button'),
      ),
      body: Center(
        child: GradientElevatedButton(
          onPressed: () {},
          style: GradientElevatedButton.styleFrom(
            gradient: const LinearGradient(
              colors: [
                Color.fromARGB(255, 166, 206, 57),
                Color.fromARGB(255, 0, 175, 173),
              ],
              begin: Alignment.topCenter,
              end: Alignment.bottomCenter,
            ),
          ),
          child: const Text("This is Gradient Elevated Button"),
        ),
      ),
    );
  }
}
8
likes
0
pub points
84%
popularity

Publisher

unverified uploader

Custom Flutter button with gradient background for visually appealing UI.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on gradient_elevated_button