How to solve it
How to solve it
Windows 11 shows problem but web is fine.
MacosScaffold get a black background.
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
`Future
Future
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(), ); }, ); } }`
I face same issue.
I face same issue.
did you have any solution?
I Can reproduce the bug on linux (6.5.0-kali3-amd64).
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());
}
Keep in mind that we do not officially support Windows or Linux platforms.
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