AppFlowy-IO / appflowy-editor

A highly customizable rich-text editor for Flutter. The AppFlowy Editor project for AppFlowy and beyond.
https://pub.dev/packages/appflowy_editor
Other
473 stars 201 forks source link

feat: select multiple lines with block selection style #936

Closed LucasXu0 closed 1 month ago

LucasXu0 commented 1 month ago

Use the API below to select multiple lines with block selection style.

      final selection = Selection.collapsed(
        Position(path: path),
      );
      editorState.updateSelectionWithReason(
        selection,
        customSelectionType: SelectionType.block,
      );
      value.configuration = value.configuration.copyWith(
        padding: (_) => const EdgeInsets.symmetric(vertical: 8.0),
        blockSelectionAreaMargin: (_) => const EdgeInsets.symmetric(
          vertical: 1.0,
        ),
      );
Screenshot 2024-10-16 at 15 07 51
codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 72.03%. Comparing base (8ae43d4) to head (95821be). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/src/editor_state.dart 50.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #936 +/- ## ========================================== + Coverage 72.02% 72.03% +0.01% ========================================== Files 318 318 Lines 15036 15046 +10 ========================================== + Hits 10829 10838 +9 - Misses 4207 4208 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.