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 am developing an app that can run in two different ways, depending on args passed to it. One way has a GUI for configuring the app, the other way is supposed to be run as a Windows service and does its things depending on how it has been configured on the GUI side (this is just to give some context).
So, I basically have a flag set at runtime that depends on the args passed, and the last lines of the main method are this:
void main() {
runApp(const MyApp());
doWhenWindowReady(() {
if (isService) {
appWindow.hide();
//sets up the service and stuff...
} else {
//sets the windows properties...
appWindow.show();
}
});
}
I continued developing the app without worries, because in Android Studio everything worked fine: when it was supposed to show the GUI, it showed the GUI, and when it was started as a service, there was no thing on the screen ever.
The problem appeared when I started preparing to deploy it: I noticed that the hide() method seemed to be ignored because when I started it as a service, I got a total black GUI with nothing on it (and that was right, since the only widget is an empty container when it's a service). Everything else worked as intended, though.
I narrowed down the variables (used the same PC, changed some lines of code to be sure, etc), and now I am at this point: the app's code is a copy-paste of the example, except for this part:
In Android Studio, it works as intended: nothing is shown until I uncomment the hide() and return lines. But, if I build the app with the code shown above and then run it, I still get the example's orange window, but with a size different from 600x450, meaning that the return gets executed but not the hide().
Any hints on why the hide() command is working differently?
Plugin version: 0.1.5
Flutter doctor:
[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Versione 10.0.19045.3086], locale it-IT)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.0)
[√] Android Studio (version 2022.2)
The text was updated successfully, but these errors were encountered:
I am developing an app that can run in two different ways, depending on args passed to it. One way has a GUI for configuring the app, the other way is supposed to be run as a Windows service and does its things depending on how it has been configured on the GUI side (this is just to give some context).
So, I basically have a flag set at runtime that depends on the args passed, and the last lines of the main method are this:
I continued developing the app without worries, because in Android Studio everything worked fine: when it was supposed to show the GUI, it showed the GUI, and when it was started as a service, there was no thing on the screen ever.
The problem appeared when I started preparing to deploy it: I noticed that the
hide()
method seemed to be ignored because when I started it as a service, I got a total black GUI with nothing on it (and that was right, since the only widget is an empty container when it's a service). Everything else worked as intended, though.I narrowed down the variables (used the same PC, changed some lines of code to be sure, etc), and now I am at this point: the app's code is a copy-paste of the example, except for this part:
In Android Studio, it works as intended: nothing is shown until I uncomment the
hide()
andreturn
lines. But, if I build the app with the code shown above and then run it, I still get the example's orange window, but with a size different from 600x450, meaning that thereturn
gets executed but not thehide()
.Any hints on why the
hide()
command is working differently?Plugin version: 0.1.5
Flutter doctor:
The text was updated successfully, but these errors were encountered: