monkey_button 1.0.3
monkey_button: ^1.0.3 copied to clipboard
An interactive, animated Floating Action Button (FAB) canvas overlay styled like a cute monkey or high-tech robot that runs, jumps, waves, sits, and climbs walls dynamically.
Animated Companions (monkey_button) #
Add animated, interactive Floating Action Button (FAB) companion characters (Monkey or Robot) to your Flutter application. They walk, run, jump, wave, sit, and climb walls dynamically across the screen viewport.
Preview #

Demo Recording #

Features #
- Decoupled Architecture: Overlay a background page with
CharacterCanvasand spawn multiple independent characters (CharacterFAB) that stay within the canvas constraints. - Two Unique Character Companions:
- Monkey: Animates with custom-painted breathing shifts, blinking eyes, wiggling limbs, and playful gestures.
- Robot: Stiffer mechanical movements, digital oscillating waveform mouth, glowing pulsing reactor core chest, flashing LED antenna, and active rocket boosters that ignite fire under its body when leaping!
- Playful Animation Machine:
- Idle states: Breathing, blinking, head-scratching, waving hello, and hopping.
- Movement states: Alternating walking cycles, fast running cycles with wide arm swings, and realistic parabolic jumping/leaping arcs (complete with stretch, air physics, landing squash, and elevation shadow fade).
- Climbing: Double-tap a companion or wait for it to walk to the nearest screen edge, rotate 90 degrees, crawl up/down, and step back inward.
- Material 3 Speed Dial Menu: Expand custom actions relative to each character's positions (auto-adjusts expansion direction depending on the screen clearance). Tapping outside dismisses the menu seamlessly without tinting the screen.
- Real-Time Size Scaling: Customize the size of each character dynamically using a
scalemultiplier.
Installation #
Add the dependency to your pubspec.yaml:
dependencies:
monkey_button: ^1.0.0
Or run:
flutter pub add monkey_button
Usage #
Using monkey_button is incredibly simple. Wrap your main page content in a CharacterCanvas and add one or more CharacterFAB overlays:
import 'package:flutter/material.dart';
import 'package:monkey_button/monkey_button.dart';
class MyInteractivePage extends StatelessWidget {
const MyInteractivePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: CharacterCanvas(
characters: [
// Chippy the Monkey
CharacterFAB(
character: FloatingCharacter.monkey,
scale: 1.0, // Set character size (default is 1.0)
initialX: 50.0,
initialY: 150.0,
menuItems: [
MonkeyMenuItem(
icon: Icons.restaurant,
label: 'Feed Banana',
onTap: () => print('Fed Chippy a banana! 🍌'),
),
MonkeyMenuItem(
icon: Icons.sports_gymnastics,
label: 'Gymnastic Jump',
onTap: () => print('Chippy flipped! 🤸'),
),
],
),
// Robo the Robot
CharacterFAB(
character: FloatingCharacter.robot,
scale: 0.8, // Make Robo slightly smaller
initialX: 200.0,
initialY: 300.0,
menuItems: [
MonkeyMenuItem(
icon: Icons.electric_bolt,
label: 'Charge Core',
onTap: () => print('Robo charged up! ⚡'),
),
],
),
],
child: Center(
child: Text(
'My Main Application Content',
style: Theme.of(context).textTheme.headlineMedium,
),
),
),
);
}
}
Customizing Behaviors #
| Property | Type | Description | Default |
|---|---|---|---|
character |
FloatingCharacter |
Select rendering skin (monkey or robot) |
FloatingCharacter.monkey |
scale |
double |
Scaling factor for visual size (0.5 to 1.5 recommended) | 1.0 |
speedMultiplier |
double |
Speeds up or slows down movements | 1.0 |
autoMovementEnabled |
bool |
Whether character moves randomly by itself | true |
menuItems |
List<MonkeyMenuItem> |
Custom action button speed dial list | (Required) |
onWalkStarted |
Function(double, double)? |
Callback when walking/running starts | null |
onWalkCompleted |
VoidCallback? |
Callback when target destination is reached | null |
onIdleAction |
Function(String)? |
Callback for specific playful actions played | null |
LICENSE #
This package is licensed under the MIT License. See the LICENSE file for details.