Commit 8b6b3b62 authored by Prerak Mann's avatar Prerak Mann Committed by Flutter GitHub Bot

Passes scrollPhysics (#48342)

parent ef62092b
...@@ -124,6 +124,7 @@ class TextFormField extends FormField<String> { ...@@ -124,6 +124,7 @@ class TextFormField extends FormField<String> {
EdgeInsets scrollPadding = const EdgeInsets.all(20.0), EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
bool enableInteractiveSelection = true, bool enableInteractiveSelection = true,
InputCounterWidgetBuilder buildCounter, InputCounterWidgetBuilder buildCounter,
ScrollPhysics scrollPhysics,
}) : assert(initialValue == null || controller == null), }) : assert(initialValue == null || controller == null),
assert(textAlign != null), assert(textAlign != null),
assert(autofocus != null), assert(autofocus != null),
...@@ -201,6 +202,7 @@ class TextFormField extends FormField<String> { ...@@ -201,6 +202,7 @@ class TextFormField extends FormField<String> {
cursorRadius: cursorRadius, cursorRadius: cursorRadius,
cursorColor: cursorColor, cursorColor: cursorColor,
scrollPadding: scrollPadding, scrollPadding: scrollPadding,
scrollPhysics: scrollPhysics,
keyboardAppearance: keyboardAppearance, keyboardAppearance: keyboardAppearance,
enableInteractiveSelection: enableInteractiveSelection, enableInteractiveSelection: enableInteractiveSelection,
buildCounter: buildCounter, buildCounter: buildCounter,
......
...@@ -32,6 +32,28 @@ void main() { ...@@ -32,6 +32,28 @@ void main() {
expect(textFieldWidget.textAlign, alignment); expect(textFieldWidget.textAlign, alignment);
}); });
testWidgets('Passes scrollPhysics to underlying TextField', (WidgetTester tester) async {
const ScrollPhysics scrollPhysics = ScrollPhysics();
await tester.pumpWidget(
MaterialApp(
home: Material(
child: Center(
child: TextFormField(
scrollPhysics: scrollPhysics,
),
),
),
),
);
final Finder textFieldFinder = find.byType(TextField);
expect(textFieldFinder, findsOneWidget);
final TextField textFieldWidget = tester.widget(textFieldFinder);
expect(textFieldWidget.scrollPhysics, scrollPhysics);
});
testWidgets('Passes textAlignVertical to underlying TextField', (WidgetTester tester) async { testWidgets('Passes textAlignVertical to underlying TextField', (WidgetTester tester) async {
const TextAlignVertical textAlignVertical = TextAlignVertical.bottom; const TextAlignVertical textAlignVertical = TextAlignVertical.bottom;
......
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