creative_ui_button 0.0.2 copy "creative_ui_button: ^0.0.2" to clipboard
creative_ui_button: ^0.0.2 copied to clipboard

Theme-aware, animated buttons for Flutter: contained, outlined, text, and animated variants with async and smart back.

pub package likes pub points Flutter

🎨 Creative UI Button #

A beautifully animated, theme-aware, and highly customizable button library for Flutter.
It supports multiple variants, async actions, built-in sound and haptic feedback, and smart navigation helpers β€” all with Material-3-ready design.


image

✨ Features #

βœ… Multiple button variants:

  • Contained
  • Outlined
  • Text
  • Animated

βœ… Built-in animations:

  • Pulse
  • Floating
  • Scale-Tap feedback

βœ… Async support:

  • AsyncButton automatically handles loading states and disables double taps.

βœ… Smart navigation:

  • CreativeUIBackButton pops from the stack, or auto-redirects to a fallback route if the stack is empty.

βœ… Theme-aware defaults:

  • Automatically adapts to Theme.of(context).colorScheme (light or dark).

βœ… Plug-and-play customization:

  • Gradients, borders, shadows, haptics, SFX, and more.

πŸš€ Installation #

Add to your project:

flutter pub add creative_ui_button

or manually include in pubspec.yaml:

dependencies:
  creative_ui_button: ^1.0.0

Then import it:

import 'package:creative_ui_button/creative_ui_button.dart';

🧱 Usage #

🟦 Contained Button #

CreativeUIButton(
  options: CreativeUIButtonOptions(
    variant: ButtonVariant.contained,
    labelText: 'Play',
    icon: const Icon(Icons.play_arrow, color: Colors.white),
    style: const CreativeUIButtonStyle(
      backgroundColor: Colors.blue,
      borderRadius: 12,
      textStyle: TextStyle(
        color: Colors.white,
        fontWeight: FontWeight.bold,
      ),
    ),
    onPressed: () => print('Play tapped'),
  ),
);

🟧 Outlined Button #

CreativeUIButton(
  options: CreativeUIButtonOptions(
    variant: ButtonVariant.outlined,
    labelText: 'Cancel',
    style: CreativeUIButtonStyle(
      borderColor: Colors.orange,
      borderWidth: 2,
      textStyle: const TextStyle(color: Colors.orange),
    ),
    onPressed: () => print('Cancelled'),
  ),
);

πŸ” Async Button #

AsyncButton(
  options: CreativeUIButtonOptions(
    labelText: 'Submit',
    variant: ButtonVariant.contained,
    style: const CreativeUIButtonStyle(
      backgroundColor: Colors.green,
      textStyle: TextStyle(color: Colors.white),
    ),
  ),
  onAsyncSubmit: () async {
    await Future.delayed(const Duration(seconds: 2));
    print('Submitted');
  },
);

The button will show a spinner and disable itself until the async task completes.


⬅️ Smart Back Button #

CreativeUIBackButton(
  fallbackRoute: '/home', // If stack is empty, navigates to home
  options: CreativeUIButtonOptions(
    variant: ButtonVariant.text,
    style: const CreativeUIButtonStyle(
      textStyle: TextStyle(color: Colors.blue),
    ),
  ),
);

βš™οΈ Button Variants #

Variant Description
contained Filled button (default)
outlined Border-only button
text Minimal text-only button
animated Pulse & floating animations with gradient support

πŸͺ„ Advanced Configuration #

Animation Options

CreativeUIButtonOptions(
  animationOptions: CreativeUIButtonAnimationOptions(
    animationOptions: {
      AnimationType.pulsing: AnimationOptions(
        duration: const Duration(milliseconds: 800),
        pause: const Duration(seconds: 1),
      ),
      AnimationType.floating: AnimationOptions(
        from: -5.0,
        to: 5.0,
        duration: const Duration(seconds: 2),
      ),
    },
  ),
);

Sound & Haptics

CreativeUIButtonOptions(
  soundOptions: const CreativeUIButtonSoundOptions(
    sfxPath: 'assets/click.mp3',
    enableSFX: true,
    disableVibration: false,
  ),
);

🧩 Example #

A complete example app lives in /example.

Run it:

cd example
flutter run

🧠 Architecture Highlights #

  • No theme access in initState β†’ safe in all build phases
  • Adaptive to ThemeData changes and dark mode
  • Ripple + hover + focus layers follow Material guidelines
  • Easily extendable for new variants or shapes

πŸ§ͺ Testing #

Run widget tests:

flutter test

You’ll find test coverage for:

  • CreativeUIButton
  • AsyncButton
  • CreativeUIBackButton

🧰 Requirements #

Platform Minimum
Flutter 3.13+
Dart 3.2+

πŸ§‘β€πŸ’» Author #

Ollie Ogunlade
Flutter & Node.js Engineer
GitHub β€’ LinkedIn


πŸ“„ License #

MIT Β© 2025 Ollie Ogunlade

1
likes
120
points
141
downloads

Publisher

unverified uploader

Weekly Downloads

Theme-aware, animated buttons for Flutter: contained, outlined, text, and animated variants with async and smart back.

Repository (GitHub)
View/report issues

Topics

#buttons #creative #flutter #widget

Documentation

API reference

License

unknown (license)

Dependencies

audioplayers, auto_size_text, flutter, flutter_animator, golden_toolkit, haptic_feedback, simple_animations, vibration

More

Packages that depend on creative_ui_button