Skip to content
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

chore: address Dart 3.6.0 analysis warnings #2417

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: address warnings of unreachable_switch_default instead of igno…
…ring them
  • Loading branch information
EchoEllet committed Dec 13, 2024
commit 527b82182ebc88cb6646e741ac6891bd153e4b10
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Address warnings of `unreachable_switch_default` (introduced in Dart 3.6).

## [11.0.0-dev.15] - 2024-12-13

### Added
Expand Down
4 changes: 0 additions & 4 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
include: package:flutter_lints/flutter.yaml

analyzer:
# TODO: Included for backward compatibility, remove when the minimum Dart SDK is 3.6.0
errors:
unreachable_switch_default: ignore
linter:
rules:
always_declare_return_types: true
Expand Down
5 changes: 0 additions & 5 deletions lib/src/editor/raw_editor/raw_editor_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,6 @@ class QuillRawEditorState extends EditorState
case TargetPlatform.windows:
widget.config.focusNode.unfocus();
break;
default:
throw UnsupportedError(
'The platform ${defaultTargetPlatform.name} is not supported in the'
' _defaultOnTapOutside()',
);
}
}

Expand Down
6 changes: 0 additions & 6 deletions lib/src/editor/widgets/text/text_selection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,6 @@ class EditorTextSelectionOverlay {
? newSelection.extent
: const TextPosition(offset: 0);
break;
default:
throw ArgumentError('Invalid position');
}

final currSelection = newSelection != null
Expand Down Expand Up @@ -456,8 +454,6 @@ class _TextSelectionHandleOverlay extends StatefulWidget {
return renderObject.selectionStartInViewport;
case _TextSelectionHandlePosition.end:
return renderObject.selectionEndInViewport;
default:
throw ArgumentError('Invalid position');
}
}
}
Expand Down Expand Up @@ -547,8 +543,6 @@ class _TextSelectionHandleOverlayState
isNormalized ? position.offset : widget.selection.extentOffset,
);
break;
default:
throw ArgumentError('Invalid widget.position');
}

if (newSelection.baseOffset >= newSelection.extentOffset) {
Expand Down
Loading