macosui / macos_ui

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

Migrate to Flutter 3.10 and dart 3 #424

Closed stMerlHin closed 1 year ago

stMerlHin commented 1 year ago

Use case

I migrated my flutter project to flutter 3.10 and I've got an error when I tried to run the app.

ERROR:  - 'TapUpDetails' is from 'package:flutter/src/gestures/tap.dart' ('/opt/flutter/packages/flutter/lib/src/gestures/tap.dart').
ERROR:  - 'TapDragUpDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/opt/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
ERROR: Change to a supertype of 'TapDragUpDetails', or, for a covariant parameter, a subtype.
ERROR:   void onSingleTapUp(TapUpDetails details) {
ERROR:                                   ^
ERROR: /opt/flutter/packages/flutter/lib/src/widgets/text_selection.dart:2161:8: Context: This is the overridden method ('onSingleTapUp').
ERROR:   void onSingleTapUp(TapDragUpDetails details) {
ERROR:        ^
ERROR: ../../../.pub-cache/hosted/pub.dev/macos_ui-1.12.2/lib/src/fields/text_field.dart:130:42: Error: The parameter 'details' of the method '_TextFieldSelectionGestureDetectorBuilder.onDragSelectionEnd' has type 'DragEndDetails', which does not match the corresponding type, 'TapDragEndDetails', in the overridden method, 'TextSelectionGestureDetectorBuilder.onDragSelectionEnd'.
ERROR:  - 'DragEndDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('/opt/flutter/packages/flutter/lib/src/gestures/drag_details.dart').
ERROR:  - 'TapDragEndDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/opt/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
ERROR: Change to a supertype of 'TapDragEndDetails', or, for a covariant parameter, a subtype.
ERROR:   void onDragSelectionEnd(DragEndDetails details) {
ERROR:                                          ^
ERROR: /opt/flutter/packages/flutter/lib/src/widgets/text_selection.dart:2839:8: Context: This is the overridden method ('onDragSelectionEnd').
ERROR:   void onDragSelectionEnd(TapDragEndDetails details) {
ERROR:        ^
ERROR: Target kernel_snapshot failed: Exception
Exception: Build process failed```

Proposal

Migrate this package to flutter 3.10 and dart 3.0.0

jschaeken commented 1 year ago

Has anyone got a workaround for the meantime? I am also having this issue

stMerlHin commented 1 year ago

I think I will submit a pull request today. I just hope @GroovinChip will review it as fast as possible.

theniceboy commented 1 year ago
dependency_overrides:
  macos_ui:
    git:
      url: https://github.com/Mayb3Nots/macos_ui.git
      ref: dev

This worked for me.

kekko7072 commented 1 year ago
dependency_overrides:
  macos_ui:
    git:
      url: https://github.com/Mayb3Nots/macos_ui.git
      ref: dev

This worked for me.

In web i'm having this issue that i wasn't having with original branch

The following UnsupportedError was thrown building MacosWindow(dirty, dependencies: [_InheritedMacosTheme], state: _MacosWindowState#db1dc):
Unsupported operation: Platform._operatingSystem
zeucxb commented 1 year ago

I just add Grab on the parameter type and works for me.

stMerlHin commented 1 year ago

Duplicate #423