vikum_buttons 0.1.0 copy "vikum_buttons: ^0.1.0" to clipboard
vikum_buttons: ^0.1.0 copied to clipboard

Beautiful Liquid Glass UI buttons for Flutter with glassmorphism effects. Create stunning, modern buttons with blur, transparency, and smooth animations.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Vikum Buttons Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  String _lastPressed = 'None';

  void _onButtonPressed(String buttonName) {
    setState(() {
      _lastPressed = buttonName;
    });
    ScaffoldMessenger.of(context).showSnackBar(
      SnackBar(
        content: Text('$buttonName pressed!'),
        duration: const Duration(seconds: 1),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        decoration: BoxDecoration(
          gradient: LinearGradient(
            begin: Alignment.topLeft,
            end: Alignment.bottomRight,
            colors: [
              Colors.purple.shade400,
              Colors.pink.shade300,
              Colors.blue.shade400,
            ],
          ),
        ),
        child: SafeArea(
          child: SingleChildScrollView(
            padding: const EdgeInsets.all(20),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                const SizedBox(height: 20),
                const Text(
                  'Vikum Buttons',
                  style: TextStyle(
                    color: Colors.white,
                    fontSize: 36,
                    fontWeight: FontWeight.bold,
                    shadows: [
                      Shadow(
                        blurRadius: 10,
                        color: Colors.black26,
                        offset: Offset(0, 4),
                      ),
                    ],
                  ),
                ),
                const SizedBox(height: 10),
                const Text(
                  'Liquid Glass UI Buttons',
                  style: TextStyle(
                    color: Colors.white70,
                    fontSize: 18,
                    letterSpacing: 1.2,
                  ),
                ),
                const SizedBox(height: 10),
                Container(
                  padding: const EdgeInsets.symmetric(
                    horizontal: 20,
                    vertical: 10,
                  ),
                  decoration: BoxDecoration(
                    color: Colors.white.withOpacity(0.2),
                    borderRadius: BorderRadius.circular(20),
                    border: Border.all(
                      color: Colors.white.withOpacity(0.3),
                    ),
                  ),
                  child: Text(
                    'Last Pressed: $_lastPressed',
                    style: const TextStyle(
                      color: Colors.white,
                      fontSize: 14,
                    ),
                  ),
                ),
                const SizedBox(height: 40),

                // Basic Button
                _buildSection(
                  'Basic Button',
                  LiquidGlassButton(
                    onPressed: () => _onButtonPressed('Basic'),
                    text: 'Liquid Glass',
                  ),
                ),

                // Custom Size Button
                _buildSection(
                  'Custom Size',
                  LiquidGlassButton(
                    onPressed: () => _onButtonPressed('Custom Size'),
                    text: 'Larger Button',
                    width: 250,
                    height: 70,
                  ),
                ),

                // With Icon
                _buildSection(
                  'With Icon',
                  LiquidGlassButton(
                    onPressed: () => _onButtonPressed('Icon Button'),
                    text: 'Favorite',
                    icon: Icons.favorite,
                    iconSize: 28,
                  ),
                ),

                // Custom Colors
                _buildSection(
                  'Custom Colors',
                  LiquidGlassButton(
                    onPressed: () => _onButtonPressed('Custom Colors'),
                    text: 'Blue Accent',
                    backgroundColor: Colors.blue.withOpacity(0.3),
                    borderColor: Colors.lightBlueAccent.withOpacity(0.6),
                  ),
                ),

                // High Blur
                _buildSection(
                  'High Blur Effect',
                  LiquidGlassButton(
                    onPressed: () => _onButtonPressed('High Blur'),
                    text: 'Maximum Blur',
                    blurAmount: 20,
                  ),
                ),

                // Gradient Button
                _buildSection(
                  'With Gradient',
                  LiquidGlassButton(
                    onPressed: () => _onButtonPressed('Gradient'),
                    text: 'Gradient Style',
                    gradient: LinearGradient(
                      colors: [
                        Colors.purple.withOpacity(0.4),
                        Colors.pink.withOpacity(0.3),
                      ],
                      begin: Alignment.topLeft,
                      end: Alignment.bottomRight,
                    ),
                  ),
                ),

                // Different Border Radius
                _buildSection(
                  'Rounded Square',
                  LiquidGlassButton(
                    onPressed: () => _onButtonPressed('Rounded Square'),
                    text: 'Square Shape',
                    borderRadius: 15,
                    width: 200,
                  ),
                ),

                // With Icon - Star
                _buildSection(
                  'Star Button',
                  LiquidGlassButton(
                    onPressed: () => _onButtonPressed('Star'),
                    text: 'Rate Us',
                    icon: Icons.star,
                    iconSize: 24,
                    backgroundColor: Colors.amber.withOpacity(0.2),
                    borderColor: Colors.amberAccent.withOpacity(0.5),
                  ),
                ),

                // With Icon - Send
                _buildSection(
                  'Send Button',
                  LiquidGlassButton(
                    onPressed: () => _onButtonPressed('Send'),
                    text: 'Send Message',
                    icon: Icons.send,
                    iconSize: 22,
                    backgroundColor: Colors.green.withOpacity(0.2),
                    borderColor: Colors.greenAccent.withOpacity(0.5),
                  ),
                ),

                // Thick Border
                _buildSection(
                  'Thick Border',
                  LiquidGlassButton(
                    onPressed: () => _onButtonPressed('Thick Border'),
                    text: 'Bold Outline',
                    borderWidth: 3,
                    borderColor: Colors.white.withOpacity(0.8),
                  ),
                ),

                const SizedBox(height: 40),
                Container(
                  padding: const EdgeInsets.all(20),
                  decoration: BoxDecoration(
                    color: Colors.white.withOpacity(0.1),
                    borderRadius: BorderRadius.circular(20),
                    border: Border.all(
                      color: Colors.white.withOpacity(0.2),
                    ),
                  ),
                  child: Column(
                    children: [
                      const Text(
                        '✨ Made with vikum_buttons',
                        style: TextStyle(
                          color: Colors.white,
                          fontSize: 16,
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                      const SizedBox(height: 8),
                      Text(
                        'vikumkalhara.shop',
                        style: TextStyle(
                          color: Colors.white.withOpacity(0.7),
                          fontSize: 14,
                        ),
                      ),
                    ],
                  ),
                ),
                const SizedBox(height: 20),
              ],
            ),
          ),
        ),
      ),
    );
  }

  Widget _buildSection(String title, Widget button) {
    return Padding(
      padding: const EdgeInsets.only(bottom: 30),
      child: Column(
        children: [
          Text(
            title,
            style: const TextStyle(
              color: Colors.white,
              fontSize: 16,
              fontWeight: FontWeight.w500,
              letterSpacing: 0.5,
            ),
          ),
          const SizedBox(height: 12),
          button,
        ],
      ),
    );
  }
}
2
likes
150
points
18
downloads

Publisher

unverified uploader

Weekly Downloads

Beautiful Liquid Glass UI buttons for Flutter with glassmorphism effects. Create stunning, modern buttons with blur, transparency, and smooth animations.

Homepage
Repository (GitHub)
View/report issues

Topics

#ui #button #glassmorphism #liquid-glass #widget

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on vikum_buttons