macos_ui icon indicating copy to clipboard operation
macos_ui copied to clipboard

MacosScaffold get a black background.

Open parcool opened this issue 3 years ago • 8 comments

set backgroundColor don't work but wrap a MacosOverlayFilter. it seems GlobalWallpaperTintingSettings lose control.

parcool avatar May 25 '23 01:05 parcool

@parcool please provide some sample code. Also, please try the latest beta version and see if the issue persists there.

GroovinChip avatar Jul 10 '23 21:07 GroovinChip

Confirmed here too on latest dev branch

nbonamy avatar Jul 17 '23 18:07 nbonamy

Confirmed here too on latest dev branch

Please provide minimum reproducible sample code and output from flutter doctor.

GroovinChip avatar Jul 17 '23 21:07 GroovinChip

@GroovinChip

Hi, same problem.

The version of macos_ui is 2.0.0:

macos_ui:
    dependency: "direct main"
    description:
      name: macos_ui
      sha256: b739149b812c47e5ff10a00c9fdf7315f22ac5cd1fdbd447a6b7ffee31472717
      url: "https://pub.dev"
    source: hosted
    version: "2.0.0"

flutter doctor is here:

fluttter doctor -v

❯ flutter doctor -v
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.4.1 22F770820d darwin-arm64 (Rosetta), locale ja-JP)
    • Flutter version 3.10.6 on channel stable at /Users/tsuruoka/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (13 days ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/tsuruoka/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • ANDROID_SDK_ROOT = /Users/tsuruoka/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.80.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.68.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 13.4.1 22F770820d darwin-arm64 (Rosetta)
    • Chrome (web)    • chrome • web-javascript • Google Chrome 114.0.5735.198

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Minimum reproducible sample code is here:

void main() {
  runApp(const App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return MacosApp(
      theme: MacosThemeData.light(),
      home: MacosWindow(
        // not working
        backgroundColor: MacosColors.appleGreen,
        child: MacosScaffold(
          // not working
          backgroundColor: MacosColors.appleGreen,
          children: [
            ContentArea(
              builder: (context, scrollController) => const Center(
                child: Text(
                  'text',
                  style: TextStyle(color: Colors.white),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Screenshot SCR-20230725-srer-2

htsuruo avatar Jul 25 '23 12:07 htsuruo

you maybe have to apply MacosWindowUtilsConfig

hyperion2144 avatar Aug 10 '23 06:08 hyperion2144

@hyperion2144

It means this example code, right? Yes, it seems that the example code works fine. https://github.com/macosui/macos_ui/blob/dev/example/lib/main.dart#L25-L26

But, we cannot find the MacosWindowUtilsConfig setup in in the official documents.

Since it is not written in the document, it is unclear whether this configuration is necessary for all applications or optional. What doesMacosWindowUtilsConfig configuration, if required setup?

htsuruo avatar Aug 10 '23 15:08 htsuruo

const MacosWindowUtilsConfig({
    this.toolbarStyle = NSWindowToolbarStyle.unified,
    this.enableFullSizeContentView = true,
    this.makeTitlebarTransparent = true,
    this.hideTitle = true,
    this.removeMenubarInFullScreenMode = true,
    this.autoHideToolbarAndMenuBarInFullScreenMode = true,
  });

this is the config define, maybe use the default config is ok.

hyperion2144 avatar Aug 11 '23 03:08 hyperion2144

Solved by example/lib/main.dart - MacosWindowUtilsConfig

parcool avatar Sep 26 '23 03:09 parcool