android_window 0.0.1-3 android_window: ^0.0.1-3 copied to clipboard
A flutter plugin allows you to create native android floating window.
android_window #
A flutter plugin allows you to create native android floating window.
Usage #
main.dart:
import 'package:android_window/main.dart' as window;
import 'android_window.dart';
@pragma('vm:entry-point')
void androidWindow() {
runApp(const AndroidWindowApp());
}
// run in main app
window.open(
entryPoint: 'androidWindow',
size: const Size(600, 800),
position: const Offset(200, 200),
);
android_window.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.grey.withOpacity(0.8),
body: const Center(child: Text('Hello android window')),
),
);
}
}
MainActivity.kt:
import qiuxiang.android_window.AndroidWindowActivity
class MainActivity : AndroidWindowActivity()
Create MainApplication.kt:
import qiuxiang.android_window.AndroidWindowApplication
class MainApplication : AndroidWindowApplication()
Add android:name=".MainApplication"
to AndroidManifest.xml:
<application android:name=".MainApplication">