Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
64765d86
Unverified
Commit
64765d86
authored
May 13, 2021
by
YeungKC
Committed by
GitHub
May 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
done (#82286)
parent
79709605
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
editable.dart
packages/flutter/lib/src/rendering/editable.dart
+1
-1
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+3
-2
editable_test.dart
packages/flutter/test/rendering/editable_test.dart
+1
-1
No files found.
packages/flutter/lib/src/rendering/editable.dart
View file @
64765d86
...
...
@@ -3194,7 +3194,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
@override
double
computeMaxIntrinsicWidth
(
double
height
)
{
_layoutText
(
maxWidth:
double
.
infinity
);
return
_textPainter
.
maxIntrinsicWidth
+
cursorWidth
;
return
_textPainter
.
maxIntrinsicWidth
+
_caretMargin
;
}
/// An estimate of the height of a line in the text. See [TextPainter.preferredLineHeight].
...
...
packages/flutter/test/material/text_field_test.dart
View file @
64765d86
...
...
@@ -6611,6 +6611,7 @@ void main() {
// the cursor regardless of alignment.
stepWidth
=
null
;
const
double
WIDTH_OF_CHAR
=
16.0
;
const
double
CARET_GAP
=
1.0
;
await
tester
.
pumpWidget
(
buildFrame
(
stepWidth:
stepWidth
,
cursorWidth:
18.0
,
...
...
@@ -6618,7 +6619,7 @@ void main() {
));
await
tester
.
enterText
(
find
.
byType
(
TextField
),
text
);
await
tester
.
pumpAndSettle
();
expect
(
tester
.
getSize
(
find
.
byType
(
TextField
)).
width
,
WIDTH_OF_CHAR
*
text
.
length
+
18.0
);
expect
(
tester
.
getSize
(
find
.
byType
(
TextField
)).
width
,
WIDTH_OF_CHAR
*
text
.
length
+
18.0
+
CARET_GAP
);
await
tester
.
pumpWidget
(
buildFrame
(
stepWidth:
stepWidth
,
cursorWidth:
18.0
,
...
...
@@ -6626,7 +6627,7 @@ void main() {
));
await
tester
.
enterText
(
find
.
byType
(
TextField
),
text
);
await
tester
.
pumpAndSettle
();
expect
(
tester
.
getSize
(
find
.
byType
(
TextField
)).
width
,
WIDTH_OF_CHAR
*
text
.
length
+
18.0
);
expect
(
tester
.
getSize
(
find
.
byType
(
TextField
)).
width
,
WIDTH_OF_CHAR
*
text
.
length
+
18.0
+
CARET_GAP
);
});
testWidgets
(
'TextField style is merged with theme'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/rendering/editable_test.dart
View file @
64765d86
...
...
@@ -85,7 +85,7 @@ void main() {
);
expect
(
editable
.
getMinIntrinsicWidth
(
double
.
infinity
),
50.0
);
// The width includes the width of the cursor (1.0).
expect
(
editable
.
getMaxIntrinsicWidth
(
double
.
infinity
),
5
1
.0
);
expect
(
editable
.
getMaxIntrinsicWidth
(
double
.
infinity
),
5
2
.0
);
expect
(
editable
.
getMinIntrinsicHeight
(
double
.
infinity
),
10.0
);
expect
(
editable
.
getMaxIntrinsicHeight
(
double
.
infinity
),
10.0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment