Unverified Commit 772bd438 authored by fzyzcjy's avatar fzyzcjy Committed by GitHub

Fix RenderEditable not able to update backgroundCursorColor when the user...

Fix RenderEditable not able to update backgroundCursorColor when the user provides a new one (#112045)

Pass through backgroundCursorColor parameter
parent a24b50ba
......@@ -4052,6 +4052,7 @@ class _Editable extends MultiChildRenderObjectWidget {
..cursorColor = cursorColor
..startHandleLayerLink = startHandleLayerLink
..endHandleLayerLink = endHandleLayerLink
..backgroundCursorColor = backgroundCursorColor
..showCursor = showCursor
..forceLine = forceLine
..readOnly = readOnly
......
......@@ -262,6 +262,30 @@ void main() {
expect(editableText.textHeightBehavior, isNull);
});
testWidgets('when backgroundCursorColor is updated, RenderEditable should be updated', (WidgetTester tester) async {
Widget buildWidget(Color backgroundCursorColor) {
return MediaQuery(
data: const MediaQueryData(),
child: Directionality(
textDirection: TextDirection.ltr,
child: EditableText(
controller: controller,
backgroundCursorColor: backgroundCursorColor,
focusNode: focusNode,
style: textStyle,
cursorColor: cursorColor,
),
),
);
}
await tester.pumpWidget(buildWidget(Colors.red));
await tester.pumpWidget(buildWidget(Colors.green));
final RenderEditable render = tester.allRenderObjects.whereType<RenderEditable>().first;
expect(render.backgroundCursorColor, Colors.green);
});
testWidgets('text keyboard is requested when maxLines is default', (WidgetTester tester) async {
await tester.pumpWidget(
MediaQuery(
......
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