Comments (4)
@jijormathew Could you put it in a code block?
By the way, is there any example of using & communicating between multiple of windows?
from flutter_overlay_window.
Please try to add minimal example of the code that you're using. As it says in the docs and sample example creating a new overlay should be as simple as simply calling showOverlay
from flutter_overlay_window.
import 'dart:async';
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:flutter_overlay_window/flutter_overlay_window.dart';
import 'news_data.dart';
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@OverRide
State createState() => _MyHomePageState();
}
class _MyHomePageState extends State {
@OverRide
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Top Stories'),
centerTitle: false,
titleTextStyle: const TextStyle(
fontSize: 30,
color: Colors.black)),
body: ListView.separated(
shrinkWrap: true,
separatorBuilder: (context, idx) {
return const Divider();
},
itemCount: getNewsStories().length,
itemBuilder: (context, idx) {
final article = getNewsStories()[idx];
return ListTile(
onLongPress: (){
_closeOverlayWindow();
},
key: Key('$idx ${article.hashCode}'),
title: Text(article.title),
subtitle: Text(article.description),
onTap: () {
_showOverlayWindow();
},
);
},
));
}
_showOverlayWindow() async {
bool status = await FlutterOverlayWindow.isPermissionGranted();
if(!status){
status = await FlutterOverlayWindow.requestPermission() ?? false;
setState(() {
});
}else{
await FlutterOverlayWindow.showOverlay(alignment: OverlayAlignment.centerLeft,height: 200,width: 300,enableDrag: true,flag: OverlayFlag.defaultFlag,positionGravity: PositionGravity.auto);
}
}
_closeOverlayWindow() async {
await FlutterOverlayWindow.closeOverlay();
}
} This is the example code that I'm attempting to run. I want to launch an overlay window as I press each article, not replace the one that's already open.
from flutter_overlay_window.
For the moment this package works only on displaying single overlay
from flutter_overlay_window.
Related Issues (20)
- Does it use Google Play services? HOT 1
- You can use the resize overlay and pass the enableDrag params HOT 2
- Could not run the example
- Android API 33 crashes HOT 3
- Values in resizeOverlay not coherent with values in showOverlay HOT 2
- Crached when close overlay in android 12 HOT 5
- Wrong size when switching between portrait and landscape mode.
- Can flutter_web be used in Windows?
- TextFormField not supported HOT 2
- Not able to add any other plugin into the overlay screen
- Not able to receive message from flutter_background_service HOT 1
- when call Function showOverlay() nothing action HOT 2
- add ios support HOT 5
- Unable to create service flutter.overlay.window.flutter_overlay_window.OverlayService: HOT 4
- Add support for android API 34 HOT 1
- Height doesn't account for status bar
- Use of `FlutterEngineGroup` instead of simply using `FlutterEngine` HOT 1
- Overlay stops sending messages to UI when it's turned on after previously being closed after app termination
- Please add more flags to show when phone is looked HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_overlay_window.