macosui / macos_ui

Flutter widgets and themes implementing the current macOS design language.
https://macosui.github.io/macos_ui/#/
MIT License
1.87k stars 182 forks source link

Can't run the main demo #324

Closed kirill-grouchnikov closed 1 year ago

kirill-grouchnikov commented 1 year ago

The latest clone of the project. Run flutter run from the example folder and choose to run on macOS (my version is 13.0.1):

lib/main.dart:110:7: Error: No named parameter with the name 'child'.
      child: MacosWindow(
      ^^^^^
../../../flutter/packages/flutter/lib/src/widgets/platform_menu_bar.dart:462:9: Context: Found this candidate, but the arguments don't match.
  const PlatformMenuBar({
        ^^^^^^^^^^^^^^^
kirill-grouchnikov commented 1 year ago

Opening example/lib/main.dart in IntelliJ shows this:

image
kirill-grouchnikov commented 1 year ago

Replacing child with body in line 110 fixes the issue and makes the app run successfully

GroovinChip commented 1 year ago

@kirill-grouchnikov I believe you encountered this issue because you were using an older version of Flutter on the stable channel at the time. PlatformMenuBar changed body to child in the latest version by that time.