floating_bar 0.0.3 copy "floating_bar: ^0.0.3" to clipboard
floating_bar: ^0.0.3 copied to clipboard

A Draggable Floating Bar.When tapped, the children expand to be visible, draggable via drag, and upon onPanEnd, designed to reattach to the left or right based on the given screen center.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          backgroundColor: Colors.red,
          body: Center(
            child: Container(
              color: Colors.blue,
              width: 500,
              height: 500,
              child: FloatingBar(
                isOnLeft: false,
                collapsedBackgroundColor: Colors.green,
                expandedBackgroundColor: Colors.black,
                collapsedOpacity: 1,
                expansionWidthPercentage: 0.5,
                floatingBarSize: 100,
                children: [
                  Container(
                      color: Colors.red,
                      width: 400,
                      child: const Center(child: Text('Hello'))),
                  const Center(child: Text('World')),
                  const Center(child: Text('Flutter')),
                ],
              ),
            ),
          )),
    );
  }
}
7
likes
140
points
41
downloads

Publisher

unverified uploader

Weekly Downloads

A Draggable Floating Bar.When tapped, the children expand to be visible, draggable via drag, and upon onPanEnd, designed to reattach to the left or right based on the given screen center.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on floating_bar