https://github.com/qiuxiang/flutter-android-window
A flutter plugin allows you to create native android floating window.
https://github.com/qiuxiang/flutter-android-window
android flutter flutter-plugin
Last synced: about 1 year ago
JSON representation
A flutter plugin allows you to create native android floating window.
- Host: GitHub
- URL: https://github.com/qiuxiang/flutter-android-window
- Owner: qiuxiang
- License: mit
- Created: 2021-09-30T10:33:26.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-23T00:57:09.000Z (almost 2 years ago)
- Last Synced: 2025-03-27T01:46:51.936Z (over 1 year ago)
- Topics: android, flutter, flutter-plugin
- Language: Kotlin
- Homepage:
- Size: 61.5 KB
- Stars: 69
- Watchers: 2
- Forks: 22
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# android_window [![pub-badge]][pub]
A flutter plugin allows you to create native android floating window.
## Install
```
flutter pub add android_window
```
## Example
main.dart:
```dart
import 'package:android_window/main.dart' as android_window;
import 'package:flutter/material.dart';
import 'android_window.dart';
@pragma('vm:entry-point')
void androidWindow() {
runApp(const AndroidWindowApp());
}
void main() {
runApp(const App());
}
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const MaterialApp(title: 'Flutter Demo', home: HomePage());
}
}
class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
floatingActionButton: FloatingActionButton(
onPressed: () => android_window.open(size: const Size(300, 200)),
child: const Icon(Icons.add),
),
);
}
}
```
android_window.dart:
```dart
import 'package:android_window/android_window.dart';
import 'package:flutter/material.dart';
class AndroidWindowApp extends StatelessWidget {
const AndroidWindowApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: HomePage(),
debugShowCheckedModeBanner: false,
);
}
}
class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return AndroidWindow(
child: Scaffold(
backgroundColor: Colors.lightGreen.withOpacity(0.9),
body: const Padding(
padding: EdgeInsets.all(8),
child: Text('Hello android window'),
),
),
);
}
}
```
Screenshot:

### More examples
- [Full example](https://github.com/qiuxiang/flutter-android-window/tree/main/example)
- [example.apk](https://github.com/qiuxiang/flutter-android-window/releases/download/latest/example.apk)
[](https://user-images.githubusercontent.com/1709072/136388895-4b576f60-f00e-4188-ae74-dd4a3da9beca.mp4)
[pub]: https://pub.dartlang.org/packages/android_window
[pub-badge]: https://img.shields.io/pub/v/android_window.svg
## Build
```
mkdir -p android/src/main/java/qiuxiang/android_window
flutter pub run pigeon --input lib/pigeon.dart
```