Replace `View.of` with `MediaQuery.of`

pull/1315/head
Adil Hanney 2 years ago
parent 47bd3faaa9
commit 020e669a4d
No known key found for this signature in database
GPG Key ID: 27A0885BC5740457
  1. 4
      lib/src/widgets/editor.dart
  2. 2
      lib/src/widgets/raw_editor.dart
  3. 2
      lib/src/widgets/text_block.dart
  4. 2
      test/widgets/controller_test.dart

@ -478,8 +478,8 @@ class QuillEditorState extends State<QuillEditor>
selectionColor = selectionTheme.selectionColor ??
cupertinoTheme.primaryColor.withOpacity(0.40);
cursorRadius ??= const Radius.circular(2);
cursorOffset =
Offset(iOSHorizontalOffset / View.of(context).devicePixelRatio, 0);
cursorOffset = Offset(
iOSHorizontalOffset / MediaQuery.of(context).devicePixelRatio, 0);
} else {
textSelectionControls = materialTextSelectionControls;
paintCursorAboveText = false;

@ -973,7 +973,7 @@ class RawEditorState extends EditorState
widget.selectionColor,
widget.enableInteractiveSelection,
_hasFocus,
View.of(context).devicePixelRatio,
MediaQuery.of(context).devicePixelRatio,
_cursorCont);
return editableTextLine;
}

@ -159,7 +159,7 @@ class EditableTextBlock extends StatelessWidget {
color,
enableInteractiveSelection,
hasFocus,
View.of(context).devicePixelRatio,
MediaQuery.of(context).devicePixelRatio,
cursorCont);
final nodeTextDirection = getDirectionOfNode(line);
children.add(Directionality(

@ -104,7 +104,7 @@ void main() {
test('getAllIndividualSelectionStylesAndEmbed', () {
controller
..formatText(0, 2, Attribute.bold)
..replaceText(2, 2, BlockEmbed.image('/test'),null)
..replaceText(2, 2, BlockEmbed.image('/test'), null)
..updateSelection(const TextSelection(baseOffset: 0, extentOffset: 4),
ChangeSource.REMOTE);
final result = controller.getAllIndividualSelectionStylesAndEmbed();

Loading…
Cancel
Save