macos_ui icon indicating copy to clipboard operation
macos_ui copied to clipboard

How to solve it

Open HasanGaffar opened this issue 2 years ago • 6 comments

How to solve it

Windows 11 shows problem but web is fine.

MacosScaffold get a black background.

image

https://github.com/macosui/macos_ui/assets/14864126/cbd2de32-4b10-4ab6-93ed-e8367839caf7

https://github.com/macosui/macos_ui/assets/14864126/b411b5df-ec67-4daf-bb3a-5e3af2c4c8b3

image

`Future _configureMacosWindowUtils() async { const config = MacosWindowUtilsConfig( toolbarStyle: NSWindowToolbarStyle.unified, enableFullSizeContentView: true, makeTitlebarTransparent: true, hideTitle: true, removeMenubarInFullScreenMode: true, autoHideToolbarAndMenuBarInFullScreenMode: true, ); await config.apply(); }

Future main() async { if (!kIsWeb) { if (Platform.isMacOS) { await _configureMacosWindowUtils(); } }

runApp(const MyApp()); }

class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key);

@override Widget build(BuildContext context) { return ChangeNotifierProvider( create: (_) => AppTheme(), builder: (context, _) { final appTheme = context.watch<AppTheme>(); return MacosApp( title: 'Widget Gallery', theme: MacosThemeData.light(), darkTheme: MacosThemeData.dark(), themeMode: appTheme.mode, debugShowCheckedModeBanner: false, home: const MyHomePage(), ); }, ); } }`

HasanGaffar avatar Dec 04 '23 19:12 HasanGaffar

I face same issue.

mhgsalim-office avatar Dec 05 '23 05:12 mhgsalim-office

I face same issue.

did you have any solution?

HasanGaffar avatar Dec 05 '23 17:12 HasanGaffar

I Can reproduce the bug on linux (6.5.0-kali3-amd64).

stMerlHin avatar Dec 06 '23 22:12 stMerlHin

Not a bug, you need to apply MacosWindowUtilsConfig in the main, as shown here

Future<void> _configureMacosWindowUtils() async {
  const config = MacosWindowUtilsConfig();
  await config.apply();
}

Future<void> main() async {
  if (!kIsWeb) {
    if (Platform.isMacOS) {
      await _configureMacosWindowUtils();
    }
  }

  runApp(const MyApp());
}

sb2bg avatar Jan 18 '24 08:01 sb2bg

Keep in mind that we do not officially support Windows or Linux platforms.

Adrian-Samoticha avatar Apr 02 '24 14:04 Adrian-Samoticha

As a workaround, on Windows, the following fixes are required in order for your app to stop appearing with a black background.

Content fix to your app:

To stop the content appearing black, add disableWallpaperTinting: true property to your MacosWindow.

Sidebar fix to macos_ui:

The macos_ui codepath is choosing TransparentMacOSSidebar instead of ColoredBox, change line 268 of window.dart: from:

child: kIsWeb

to

child: !isMac

Suggest you checkout the current dev branch of macos_ui and reference it locally from your pubspec.yaml like this: from:

macos_ui: ^2.0.7

to:

macos_ui:
    path: macos_ui

electricbolt avatar Jun 03 '24 21:06 electricbolt