This example demonstrates the core features of flutter_floatwing plugin.
| Demo | Description |
|---|---|
| Normal | Basic draggable floating window |
| Assistive Touch | iOS-style assistive touch button |
| Night Mode | Full-screen non-clickable overlay filter |
- Flutter SDK (>=1.20.0)
- Android device or emulator (API 21+)
- USB debugging enabled
# Clone the repository
git clone https://github.com/jiusanzhou/flutter_floatwing.git
cd flutter_floatwing/example
# Install dependencies
flutter pub get
# Run on connected device
flutter runWhen you first run the app, you'll need to grant the "Display over other apps" permission:
- Click "Start" button in the app
- System will redirect to permission settings
- Enable the permission for the example app
- Return to the app
example/
├── lib/
│ ├── main.dart # App entry & home page
│ └── views/
│ ├── normal.dart # Basic floating window
│ ├── assistive_touch.dart # Assistive touch demo
│ └── night.dart # Night mode overlay
└── android/
└── app/src/main/
└── AndroidManifest.xml # Permission declaration
var _configs = [
WindowConfig(id: "normal", route: "/normal", draggable: true),
WindowConfig(id: "assistive", route: "/assistive", draggable: true),
WindowConfig(
id: "night",
route: "/night",
width: WindowSize.MatchParent,
height: WindowSize.MatchParent,
clickable: false, // Touch passes through
),
];// Register routes with .floatwing() wrapper
Map<String, Widget Function(BuildContext)> _routes = {
"/": (_) => HomePage(),
"/normal": (_) => NormalView().floatwing(),
"/assistive": (_) => AssistiveTouch().floatwing(),
"/night": (_) => NightView().floatwing(),
};Window not appearing?
- Ensure permission is granted
- Check if service is running:
FloatwingPlugin().isServiceRunning()
MissingPluginException?
- Clean rebuild:
flutter clean && flutter pub get && flutter run
Debug mode issues?
- Use route-based entry points for easier debugging
- Navigate to the route directly to test your overlay widget