Unverified Commit 8a8b3617 authored by Justin McCandless's avatar Justin McCandless Committed by GitHub

Use hintText's TextStyle overflow (#114378)

hinText's overflow can now be set via hintStyle (in InputDecoration)
parent 0d65b630
......@@ -2150,7 +2150,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
hintText,
style: hintStyle,
textDirection: decoration.hintTextDirection,
overflow: TextOverflow.ellipsis,
overflow: hintStyle.overflow ?? TextOverflow.ellipsis,
textAlign: textAlign,
maxLines: decoration.hintMaxLines,
),
......
......@@ -6050,7 +6050,33 @@ void main() {
await tester.pumpWidget(buildFrame(true));
await tester.pumpAndSettle();
expect(tester.getTopLeft(find.text('label')).dy, useMaterial3 ? -4.75 : -5.5);
});
testWidgets('hint style overflow works', (WidgetTester tester) async {
final String hintText = 'hint text' * 20;
const TextStyle hintStyle = TextStyle(
fontFamily: 'Ahem',
fontSize: 14.0,
overflow: TextOverflow.fade,
);
final InputDecoration decoration = InputDecoration(
hintText: hintText,
hintStyle: hintStyle,
);
await tester.pumpWidget(
buildInputDecorator(
useMaterial3: useMaterial3,
// isEmpty: false (default)
// isFocused: false (default)
decoration: decoration,
),
);
await tester.pumpAndSettle();
final Finder hintTextFinder = find.text(hintText);
final Text hintTextWidget = tester.widget(hintTextFinder);
expect(hintTextWidget.style!.overflow, decoration.hintStyle!.overflow);
});
}
}
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