You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to run a simple test, where I show an overlay with the entry-point. But the window doesn't start/create, instead null is returned. The followings are the logs -
Logs
Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart:1
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:61440/5XyFBiJrhLk=/ws
D/FloatwingPlugin( 9392): [plugin] pixel radio already exits
D/FloatwingPlugin( 9392): [plugin] system config already exits: {"pixelRadio":2,"screen":{"width":1080,"height":2208}}
[log] [plugin] initialize result: {permission_grated: true, pixel_radio_updated: false, system_config_updated: false, service_running: false, windows: null}
[log] [plugin] there are 0 windows already started
D/FloatwingService( 9392): [service] wait for service created
I/FloatwingService( 9392): [service] create a window: default {entry=myOverlayMain}
D/FloatwingService( 9392): [service] wait for service created
I/flutter ( 9392): [ DEBUG ]: window null
I also noticed that awaiting the openPermissionSetting() doesn't actually wait for permission from the user/settings.
awaitFloatwingPlugin().openPermissionSetting();
Steps to reproduce:
Run the following code -
main.dart
import'package:flutter/material.dart';
import'package:flutter_floatwing/flutter_floatwing.dart';
voidmain() {
WidgetsFlutterBinding.ensureInitialized();
FloatwingPlugin().initialize();
runApp(constRootApp());
}
@pragma("vm:entry-point")
voidmyOverlayMain() {
WidgetsFlutterBinding.ensureInitialized();
runApp(
MaterialApp(
debugShowCheckedModeBanner:false,
home:Material(
color:Colors.transparent,
elevation:0.0,
child:Container(
width:100,
height:100,
color:Colors.black,
),
),
),
);
}
classRootAppextendsStatelessWidget {
constRootApp({super.key});
@overrideWidgetbuild(BuildContext context) {
returnMaterialApp(
debugShowCheckedModeBanner:false,
home:Scaffold(
appBar:AppBar(
title:constText("Floatwing Test"),
),
body:Center(
child:TextButton(
onPressed: _startWindow,
child:constText("Start"),
),
),
),
);
}
void_startWindow() async {
// check permission and service statusfinalbool hasPermission =awaitFloatwingPlugin().checkPermission();
finalbool serviceStarted =awaitFloatwingPlugin().isServiceRunning();
if (!hasPermission) {
awaitFloatwingPlugin().openPermissionSetting();
// ☝️ it doesn't wait for the value returned by permissions
}
if (!serviceStarted) {
awaitFloatwingPlugin().startService();
}
// start overlay windowfinalWindow? window =awaitWindowConfig(
entry:"myOverlayMain",
).to().create(start:true);
debugPrint("[ DEBUG ]: window $window");
}
}
The text was updated successfully, but these errors were encountered:
Thanks for the great package!
Specs:
Flutter: 3.3.10 (stable)
Android SDK: 31.0.0-rc4
flutter_floatwing: ^0.2.1
Issue:
I'm trying to run a simple test, where I show an overlay with the
entry-point
. But the window doesn't start/create, insteadnull
is returned. The followings are the logs -Logs
I also noticed that awaiting the
openPermissionSetting()
doesn't actually wait for permission from the user/settings.Steps to reproduce:
Run the following code -
main.dart
The text was updated successfully, but these errors were encountered: