jelly_animation 0.0.1 copy "jelly_animation: ^0.0.1" to clipboard
jelly_animation: ^0.0.1 copied to clipboard

A lightweight Flutter widget that wraps any child with a smooth, continuous jelly-like breathing animation using sine curves and scale transforms.

example/lib/main.dart

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

void main() => runApp(const JellyExampleApp());

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData.dark(useMaterial3: true),
      home: const JellyPlayground(),
    );
  }
}

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

  @override
  State<JellyPlayground> createState() => _JellyPlaygroundState();
}

class _JellyPlaygroundState extends State<JellyPlayground> {
  bool _enabled = true;
  double _scaleAmount = 0.08;
  double _durationMs = 1000;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Jelly Animation Example')),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          const Spacer(),

          // Basic usage — wrap any widget with JellyWidget
          JellyWidget(
            enabled: _enabled,
            scaleAmount: _scaleAmount,
            duration: Duration(milliseconds: _durationMs.round()),
            child: Container(
              width: 140,
              height: 140,
              decoration: BoxDecoration(
                gradient: const LinearGradient(
                  colors: [Colors.deepOrange, Colors.amber],
                ),
                borderRadius: BorderRadius.circular(32),
              ),
              child: const Icon(Icons.favorite, size: 56, color: Colors.white),
            ),
          ),

          const Spacer(),

          // Controls
          SwitchListTile(
            title: const Text('Enabled'),
            value: _enabled,
            onChanged: (v) => setState(() => _enabled = v),
          ),
          ListTile(
            title: Text('Scale: ${_scaleAmount.toStringAsFixed(2)}'),
            subtitle: Slider(
              value: _scaleAmount,
              min: 0.01,
              max: 0.25,
              onChanged: (v) => setState(() => _scaleAmount = v),
            ),
          ),
          ListTile(
            title: Text('Duration: ${_durationMs.round()} ms'),
            subtitle: Slider(
              value: _durationMs,
              min: 200,
              max: 3000,
              onChanged: (v) => setState(() => _durationMs = v),
            ),
          ),
          const SizedBox(height: 24),
        ],
      ),
    );
  }
}
2
likes
160
points
99
downloads

Documentation

API reference

Publisher

verified publisherspeakblend.com

Weekly Downloads

A lightweight Flutter widget that wraps any child with a smooth, continuous jelly-like breathing animation using sine curves and scale transforms.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on jelly_animation