-
-
Notifications
You must be signed in to change notification settings - Fork 186
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 solve it #500
Comments
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 Sidebar fix to macos_ui: The macos_ui codepath is choosing TransparentMacOSSidebar instead of ColoredBox, change line 268 of window.dart:
to
Suggest you checkout the current dev branch of macos_ui and reference it locally from your pubspec.yaml like this:
to:
|
How to solve it
Windows 11 shows problem but web is fine.
MacosScaffold get a black background.
2023-12-04-23-43-48.mp4
2023-12-05-00-24-39.mp4
`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();
return MacosApp(
title: 'Widget Gallery',
theme: MacosThemeData.light(),
darkTheme: MacosThemeData.dark(),
themeMode: appTheme.mode,
debugShowCheckedModeBanner: false,
home: const MyHomePage(),
);
},
);
}
}`
The text was updated successfully, but these errors were encountered: