flutter_floaty 0.2.0 copy "flutter_floaty: ^0.2.0" to clipboard
flutter_floaty: ^0.2.0 copied to clipboard

This plugin provides a customizable Floating button to drag on screen in flutter. This package is light and easy to use

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomePage(),
    );
  }
}

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

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  static const backgroundColor = Color(0xFFF1EFE7);
  double progress = 0;
  double width = 200;
  double height = 50;

  void _resolveHeight() {
    setState(() {
      width = 400;
      height = 100;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: backgroundColor,
      appBar: AppBar(
        centerTitle: true,
        title: const Text('FlutterFloaty Example'),
        backgroundColor: backgroundColor,
      ),
      body: Stack(
        children: [
          FlutterFloaty(
            onTap: _resolveHeight,
            width: width,
            height: height,
            initialY: 100,
            initialX: 100,
            pinned: true,
            enableAnimation: false,
            builder: (context) => const Text(
              'Pinned Flutter Floaty 🎉',
              style: TextStyle(color: Colors.white),
            ),
            backgroundColor: Colors.blue,
            onDragBackgroundColor: Colors.blueAccent,
          ),
        ],
      ),
    );
  }
}
8
likes
160
pub points
24%
popularity

Publisher

verified publisherjordyhers.com

This plugin provides a customizable Floating button to drag on screen in flutter. This package is light and easy to use

Repository (GitHub)
View/report issues

Documentation

API reference

Funding

Consider supporting this project:

patreon.com

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_floaty