Comments (2)
Hi, 你可能需要一些初始化才能获取window对象。
In your window engine, you can access the window object in 2 ways:
Directly access the cache field of plugin: FloatwingPlugin().currentWindow.
If widget injected by .floatwing(), you can take window with Window.of(context).
可以提供一下你的window的代码吗?
from flutter_floatwing.
获取对象相关代码已删除,目前解决方案是通过Android广播机制来传值。
初始化悬浮窗(main.dart中)
@pragma("vm:entry-point")
void overlayPlayer() {
runApp(const OverlayApp(
child: OverlayPlayerView(),
));
}
@pragma("vm:entry-point")
void overlayDestroyer() {
runApp(const OverlayApp(
child: OverlayDestroyer(),
));
}
显示悬浮窗
await WindowConfig(
entry: "overlayPlayer",
draggable: true,
clickable: true,
focusable: false,
height: (_playerSize * _pxRatio).round(),
width: (_playerSize * _pxRatio).round(),
id: "overlayPlayer",
x: (_screenSize.width - _playerSize * _pxRatio).round(),
y: (_screenSize.height / 2 + 100).round(),
immersion: true,
).to().create(start: true)
await WindowConfig(
entry: "overlayDestroyer",
draggable: false,
clickable: false,
focusable: false,
height: (100 * _pxRatio).round(),
width: (_screenSize.width).round(),
y: (_screenSize.height - 100 * _pxRatio).round(),
id: "overlayDestroyer",
immersion: true,
).to().create(start: true);
from flutter_floatwing.
Related Issues (20)
- issues when developing
- After a while `launchMainActivity` starts failed HOT 4
- 在window里start一个新的window不成功
- MissingPluginException while running Demo HOT 2
- open kiosk mode in overlay windpw HOT 2
- EventType.WindowDestroy returned data is null
- Cannot `start` Window with `entry-point` HOT 2
- 使用flutter 3.7.5运行example点击assitive_touch出现异常。 HOT 1
- Compiling error HOT 4
- Open is not clickable "nulled"
- Need support for higher Kotlin Gradle version HOT 3
- Open window with data shared from parent app
- Can't run example app HOT 15
- inactive button HOT 1
- Determine whether the current thread is a float ? HOT 12
- flutter_floatwing 与 amap_map_fluttify 插件存在冲突 HOT 7
- In release mode, an error occurs while using `non-main` entry HOT 4
- Can not work fine with some plugin which calling dart from Android. HOT 2
- Error in debug mode and no response to anything HOT 1
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_floatwing.