alexmercerind / flutter_acrylic

Flutter library for window acrylic, mica & transparency effects.
MIT License
605 stars 54 forks source link

Not work after importing flutter_easyloading #77

Closed olers closed 1 year ago

olers commented 1 year ago

I have imported flutter_easyloading in the current MacOS desktop application. The initialization operations of this package are:

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter EasyLoading',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter EasyLoading'),
      builder: EasyLoading.init(),
    );
  }
}

After builder: EasyLoading.init(),,the flutter_acrylic doesn't work.

image
Adrian-Samoticha commented 1 year ago

It appears that flutter_easyloading is drawing a background that covers the transparency effect. To get your transparent background back, you can wrap your MyAppBody widget in a DecoratedBox with backgroundBlendMode: BlendMode.clear like this:

⋮
home: DecoratedBox(
  decoration: BoxDecoration(
    color: Colors.transparent,
    backgroundBlendMode: BlendMode.clear,
  ),
  child: MyAppBody(),
),
builder: EasyLoading.init(),
⋮

It seems that both flutter_acrylic and flutter_easyloading work correctly this way:

image
olers commented 1 year ago

It appears that flutter_easyloading is drawing a background that covers the transparency effect. To get your transparent background back, you can wrap your MyAppBody widget in a DecoreatedBox with backgroundBlendMode: BlendMode.clear like this:

⋮
home: DecoratedBox(
  decoration: BoxDecoration(
    color: Colors.transparent,
    backgroundBlendMode: BlendMode.clear,
  ),
  child: MyAppBody(),
),
builder: EasyLoading.init(),
⋮

It seems that both flutter_acrylic and flutter_easyloading work correctly this way:

image

Yeah! It works. The flutter_acrylic and flutter_easyloading both work correctly! Thank you so much!