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
9307a83f
Unverified
Commit
9307a83f
authored
Nov 11, 2019
by
Mouad Debbar
Committed by
GitHub
Nov 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changing RenderEditable.textAlign doesn't break hot reload anymore (#44605)
parent
23d1ae0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
editable.dart
packages/flutter/lib/src/rendering/editable.dart
+1
-1
editable_test.dart
packages/flutter/test/rendering/editable_test.dart
+24
-0
No files found.
packages/flutter/lib/src/rendering/editable.dart
View file @
9307a83f
...
@@ -637,7 +637,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
...
@@ -637,7 +637,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
if
(
_textPainter
.
textAlign
==
value
)
if
(
_textPainter
.
textAlign
==
value
)
return
;
return
;
_textPainter
.
textAlign
=
value
;
_textPainter
.
textAlign
=
value
;
markNeeds
Pain
t
();
markNeeds
TextLayou
t
();
}
}
/// The directionality of the text.
/// The directionality of the text.
...
...
packages/flutter/test/rendering/editable_test.dart
View file @
9307a83f
...
@@ -179,6 +179,30 @@ void main() {
...
@@ -179,6 +179,30 @@ void main() {
expect
(
editable
,
paintsExactlyCountTimes
(
#drawRRect
,
0
));
expect
(
editable
,
paintsExactlyCountTimes
(
#drawRRect
,
0
));
},
skip:
isBrowser
);
},
skip:
isBrowser
);
test
(
'Can change textAlign'
,
()
{
final
TextSelectionDelegate
delegate
=
FakeEditableTextState
();
final
RenderEditable
editable
=
RenderEditable
(
textAlign:
TextAlign
.
start
,
textDirection:
TextDirection
.
ltr
,
offset:
ViewportOffset
.
zero
(),
textSelectionDelegate:
delegate
,
text:
const
TextSpan
(
text:
'test'
),
startHandleLayerLink:
LayerLink
(),
endHandleLayerLink:
LayerLink
(),
);
layout
(
editable
);
editable
.
layout
(
BoxConstraints
.
loose
(
const
Size
(
100
,
100
)));
expect
(
editable
.
textAlign
,
TextAlign
.
start
);
expect
(
editable
.
debugNeedsLayout
,
isFalse
);
editable
.
textAlign
=
TextAlign
.
center
;
expect
(
editable
.
textAlign
,
TextAlign
.
center
);
expect
(
editable
.
debugNeedsLayout
,
isTrue
);
});
test
(
'Cursor with ideographic script'
,
()
{
test
(
'Cursor with ideographic script'
,
()
{
final
TextSelectionDelegate
delegate
=
FakeEditableTextState
();
final
TextSelectionDelegate
delegate
=
FakeEditableTextState
();
final
ValueNotifier
<
bool
>
showCursor
=
ValueNotifier
<
bool
>(
true
);
final
ValueNotifier
<
bool
>
showCursor
=
ValueNotifier
<
bool
>(
true
);
...
...
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