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

flutter version upgraded: Flutter 1.14.7-pre.19 #16

Merged
merged 1 commit into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions lib/code_editor/widgets/code_editable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ class RenderEditableCode extends RenderBox {
case TargetPlatform.android:
break;
case TargetPlatform.iOS:
case TargetPlatform.macOS:
case TargetPlatform.fuchsia:
return;
}
Expand Down
16 changes: 15 additions & 1 deletion lib/code_editor/widgets/code_editable_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'dart:math' as math;
import 'dart:ui' as ui;

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:flutter/rendering.dart' show ViewportOffset, RenderEditable;
import 'package:flutter/scheduler.dart';
Expand Down Expand Up @@ -1460,7 +1461,7 @@ class CodeEditableTextState extends State<CodeEditableText>
.height;
final double interactiveHandleHeight = math.max(
handleHeight,
kMinInteractiveSize,
kMinInteractiveDimension,
);
final Offset anchor =
_selectionOverlay.selectionControls.getHandleAnchor(
Expand Down Expand Up @@ -1764,6 +1765,19 @@ class CodeEditableTextState extends State<CodeEditableText>
selection: cs.TextSelection.fromPosition(
cs.TextPosition(offset: value.text.length)));
}

@override
void connectionClosed() {
if (_hasInputConnection) {
_textInputConnection.connectionClosedReceived();
_textInputConnection = null;
_lastKnownRemoteCodeEditingValue = null;
_finalizeEditing(true);
}
}

@override
TextEditingValue get currentTextEditingValue => _toTextEditingValue(_value);
}

class _Editable extends LeafRenderObjectWidget {
Expand Down
5 changes: 5 additions & 0 deletions lib/code_editor/widgets/code_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ class CodeTextFieldState extends State<CodeTextField>

switch (Theme.of(context).platform) {
case TargetPlatform.iOS:
case TargetPlatform.macOS:
if (cause == SelectionChangedCause.longPress) {
_codeEditableText?.bringIntoView(selection.base);
}
Expand Down Expand Up @@ -769,6 +770,7 @@ class CodeTextFieldState extends State<CodeTextField>
if (widget.selectionEnabled) {
switch (Theme.of(context).platform) {
case TargetPlatform.iOS:
case TargetPlatform.macOS:
_renderEditable.selectWordEdge(cause: ce.SelectionChangedCause.tap);
break;
case TargetPlatform.android:
Expand All @@ -788,6 +790,7 @@ class CodeTextFieldState extends State<CodeTextField>
if (widget.selectionEnabled) {
switch (Theme.of(context).platform) {
case TargetPlatform.iOS:
case TargetPlatform.macOS:
_renderEditable.selectPositionAt(
from: details.globalPosition,
cause: ce.SelectionChangedCause.longPress,
Expand All @@ -806,6 +809,7 @@ class CodeTextFieldState extends State<CodeTextField>
if (widget.selectionEnabled) {
switch (Theme.of(context).platform) {
case TargetPlatform.iOS:
case TargetPlatform.macOS:
_renderEditable.selectPositionAt(
from: details.globalPosition,
cause: ce.SelectionChangedCause.longPress,
Expand Down Expand Up @@ -929,6 +933,7 @@ class CodeTextFieldState extends State<CodeTextField>

switch (themeData.platform) {
case TargetPlatform.iOS:
case TargetPlatform.macOS:
forcePressEnabled = true;
textSelectionControls = textSelectionControls;
paintCursorAboveText = true;
Expand Down