Commit 2767d37c authored by Ian Hickson's avatar Ian Hickson Committed by Michael Goderbauer

RTL caret in text fields (#33461)

parent f7bfd549
...@@ -173,7 +173,7 @@ if [[ ! -e "$FLUTTER_ROOT/.git" ]]; then ...@@ -173,7 +173,7 @@ if [[ ! -e "$FLUTTER_ROOT/.git" ]]; then
fi fi
# To debug the tool, you can uncomment the following lines to enable checked mode and set an observatory port: # To debug the tool, you can uncomment the following lines to enable checked mode and set an observatory port:
# FLUTTER_TOOL_ARGS="--checked $FLUTTER_TOOL_ARGS" # FLUTTER_TOOL_ARGS="--enable-asserts $FLUTTER_TOOL_ARGS"
# FLUTTER_TOOL_ARGS="$FLUTTER_TOOL_ARGS --observe=65432" # FLUTTER_TOOL_ARGS="$FLUTTER_TOOL_ARGS --observe=65432"
(upgrade_flutter) 3< "$PROG_NAME" (upgrade_flutter) 3< "$PROG_NAME"
......
...@@ -637,17 +637,17 @@ Future<void> _runFlutterTest(String workingDirectory, { ...@@ -637,17 +637,17 @@ Future<void> _runFlutterTest(String workingDirectory, {
} }
if (useFlutterTestFormatter) { if (useFlutterTestFormatter) {
final FlutterCompactFormatter formatter = FlutterCompactFormatter(); final FlutterCompactFormatter formatter = FlutterCompactFormatter();
final Stream<String> testOutput = runAndGetStdout( final Stream<String> testOutput = runAndGetStdout(
flutter, flutter,
args, args,
workingDirectory: workingDirectory, workingDirectory: workingDirectory,
expectNonZeroExit: expectFailure, expectNonZeroExit: expectFailure,
timeout: timeout, timeout: timeout,
beforeExit: formatter.finish, beforeExit: formatter.finish,
environment: environment, environment: environment,
); );
await _processTestOutput(formatter, testOutput, tableData); await _processTestOutput(formatter, testOutput, tableData);
} else { } else {
await runCommand( await runCommand(
flutter, flutter,
......
...@@ -19,7 +19,7 @@ void main() { ...@@ -19,7 +19,7 @@ void main() {
File template; File template;
setUp(() { setUp(() {
tmpDir = Directory.systemTemp.createTempSync('snippets_test'); tmpDir = Directory.systemTemp.createTempSync('flutter_snippets_test.');
configuration = Configuration(flutterRoot: Directory(path.join( configuration = Configuration(flutterRoot: Directory(path.join(
tmpDir.absolute.path, 'flutter'))); tmpDir.absolute.path, 'flutter')));
configuration.createOutputDirectory(); configuration.createOutputDirectory();
......
...@@ -1191,7 +1191,7 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien ...@@ -1191,7 +1191,7 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
if (_currentCaretRect == null || !_scrollController.hasClients) { if (_currentCaretRect == null || !_scrollController.hasClients) {
return; return;
} }
final double scrollOffsetForCaret = _getScrollOffsetForCaret(_currentCaretRect); final double scrollOffsetForCaret = _getScrollOffsetForCaret(_currentCaretRect);
_scrollController.animateTo( _scrollController.animateTo(
scrollOffsetForCaret, scrollOffsetForCaret,
duration: _caretAnimationDuration, duration: _caretAnimationDuration,
......
...@@ -104,6 +104,7 @@ abstract class ScrollMetrics { ...@@ -104,6 +104,7 @@ abstract class ScrollMetrics {
/// ///
/// The value is always non-negative, and less than or equal to [viewportDimension]. /// The value is always non-negative, and less than or equal to [viewportDimension].
double get extentInside { double get extentInside {
assert(minScrollExtent <= maxScrollExtent);
return viewportDimension return viewportDimension
// "above" overscroll value // "above" overscroll value
- (minScrollExtent - pixels).clamp(0, viewportDimension) - (minScrollExtent - pixels).clamp(0, viewportDimension)
......
...@@ -447,6 +447,8 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics { ...@@ -447,6 +447,8 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics {
@override @override
bool applyContentDimensions(double minScrollExtent, double maxScrollExtent) { bool applyContentDimensions(double minScrollExtent, double maxScrollExtent) {
assert(minScrollExtent != null);
assert(maxScrollExtent != null);
if (!nearEqual(_minScrollExtent, minScrollExtent, Tolerance.defaultTolerance.distance) || if (!nearEqual(_minScrollExtent, minScrollExtent, Tolerance.defaultTolerance.distance) ||
!nearEqual(_maxScrollExtent, maxScrollExtent, Tolerance.defaultTolerance.distance) || !nearEqual(_maxScrollExtent, maxScrollExtent, Tolerance.defaultTolerance.distance) ||
_didChangeViewportDimensionOrReceiveCorrection) { _didChangeViewportDimensionOrReceiveCorrection) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment