drag_ball
2.0.1, released 2 years ago by farhanfadila.site
A Flutter package to create a draggable floating ball similar to AssistiveTouch.
WASM-ready
What it does
Provides a Dragball widget that can be placed on top of a Scaffold to create a floating, draggable element similar to iPhone's AssistiveTouch or floating UI components. It supports taps, position changes, and custom child widgets.
AI-written summary of version 2.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a floating, draggable button or ball overlay on top of your app screens.
- You want to replicate an AssistiveTouch or floating shortcut menu style.
Skip it when
- You need a complex state management or navigation system.
- You are looking for core Dart utilities or non-UI features.
Strengths
- Easy to integrate by placing on top of the Scaffold.
- Supports custom ball widgets, initial positions, and position change callbacks.
Weaknesses
- Limited documentation beyond basic examples.
- Specific to a single floating ball UI pattern.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Put DragBall on top of the Scaffold as documented in the README.
Dragball(
ball: const FlutterLogo(
size: 70,
),
initialPosition: DragballPosition.defaultPosition(),
onTap: () => debugPrint('Dragball Tapped'),
child: Scaffold(
appBar: AppBar(
title: const Text('Dragball Example'),
),
body: Container(),
),
)