floaty_chatheads_android 1.0.7
floaty_chatheads_android: ^1.0.7 copied to clipboard
Android implementation of floaty_chatheads with SYSTEM_ALERT_WINDOW, foreground service, spring physics, theming, and TalkBack accessibility.
Floaty Chatheads Android Example #
This package is the Android implementation of
floaty_chatheads.
It is not intended for direct use — add floaty_chatheads to your
pubspec.yaml instead.
import 'package:floaty_chatheads/floaty_chatheads.dart';
import 'package:flutter/material.dart';
void main() => runApp(const MaterialApp(home: BasicExample()));
@pragma('vm:entry-point')
void overlayMain() => FloatyOverlayApp.run(const OverlayContent());
class BasicExample extends StatelessWidget {
const BasicExample({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: ElevatedButton(
onPressed: () async {
await FloatyChatheads.requestPermission();
await FloatyChatheads.showChatHead(
ChatHeadConfig(
entryPoint: 'overlayMain',
contentWidth: 300,
contentHeight: 400,
),
);
},
child: const Text('Show Chathead'),
),
),
);
}
}
class OverlayContent extends StatelessWidget {
const OverlayContent({super.key});
@override
Widget build(BuildContext context) {
return const Material(child: Center(child: Text('Hello from overlay!')));
}
}
See the full gallery app for complete examples.