bdlukaa / fluent_ui

Implements Microsoft's WinUI3 in Flutter.
https://bdlukaa.github.io/fluent_ui/
BSD 3-Clause "New" or "Revised" License
2.98k stars 465 forks source link

How to use Mica #1122

Closed florinsdistortedvision closed 2 months ago

florinsdistortedvision commented 2 months ago

Hello, awesome library. I am new to flutter and was trying to use fluent_ui with Mica but I can't seem to make it work. Is this library emulating actual Mica transparency or making a sort of effect that looks like Mica but not transparent?

Do I need to use something like flutter_acrylic with this project to get mica working ? Does it need to be compiled first to be seen?

Sorry for wasting your time and thank you.

bdlukaa commented 2 months ago

Our Mica widget just emulates the mica effect when there is no transparency enabled in the system. The fluent_ui library does not have access to the Window, so it can not apply transparency effects. You need to use flutter_acrylic and make the background of the app transparent to achieve that effect.

You can sse it working in our example app:

https://github.com/bdlukaa/fluent_ui/blob/23f32e8f61bf43ed4356ecb80e0bbaf14ddd0fe9/example/lib/main.dart#L108-L119

https://github.com/bdlukaa/fluent_ui/blob/23f32e8f61bf43ed4356ecb80e0bbaf14ddd0fe9/example/lib/theme.dart#L38-L56

florinsdistortedvision commented 2 months ago

Thank you! Felt like going insane (a bit lol) that it simply didnt work for me. Thank you for clearing it up.