Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to dynamic set effect based on system version? #40

Open
lucasjinreal opened this issue Nov 3, 2022 · 3 comments
Open

How to dynamic set effect based on system version? #40

lucasjinreal opened this issue Nov 3, 2022 · 3 comments

Comments

@lucasjinreal
Copy link

Hello, I using this to dynamic set window effect, but have no reasponse:


  DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();

  void getWindowEffect() async {
    if (Platform.isWindows) {
      var sysProductName = await deviceInfo.windowsInfo;
      var pn = sysProductName.productName;
      print("--- windows information:::: ${pn}");
      if (pn.contains("Windows 10")) {
        setState(() {
          this.effect = WindowEffect.disabled;
        });

        print("effect set to: ${this.effect}");
      } else {
        this.effect = WindowEffect.acrylic;
      }
    } else {
      this.effect = WindowEffect.acrylic;
    }
  }

Am using Windowefffect.acrylic as default, but this should change if on windows 10, since it has bug when mouse dragging on window.

How should I do properly? thanks

@lucasjinreal
Copy link
Author

Also, I got a white line above window, why? (no such thing on arcylic effect)

image

@Adrian-Samoticha
Copy link
Collaborator

I haven't tried it out myself, but the os_detect package does provide a way to get the operating system version as a string. Maybe you could use that to check which version of Windows your app is running on.

@Adrian-Samoticha
Copy link
Collaborator

Also, check out Platform.operatingSystemVersion from the dart:io library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants