This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -2150,7 +2150,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
2150
2150
hintText,
2151
2151
style: hintStyle,
2152
2152
textDirection: decoration.hintTextDirection,
2153
- overflow: TextOverflow .ellipsis,
2153
+ overflow: hintStyle.overflow ?? TextOverflow .ellipsis,
2154
2154
textAlign: textAlign,
2155
2155
maxLines: decoration.hintMaxLines,
2156
2156
),
Original file line number Diff line number Diff line change @@ -6050,7 +6050,33 @@ void main() {
6050
6050
await tester.pumpWidget (buildFrame (true ));
6051
6051
await tester.pumpAndSettle ();
6052
6052
expect (tester.getTopLeft (find.text ('label' )).dy, useMaterial3 ? - 4.75 : - 5.5 );
6053
+ });
6054
+
6055
+ testWidgets ('hint style overflow works' , (WidgetTester tester) async {
6056
+ final String hintText = 'hint text' * 20 ;
6057
+ const TextStyle hintStyle = TextStyle (
6058
+ fontFamily: 'Ahem' ,
6059
+ fontSize: 14.0 ,
6060
+ overflow: TextOverflow .fade,
6061
+ );
6062
+ final InputDecoration decoration = InputDecoration (
6063
+ hintText: hintText,
6064
+ hintStyle: hintStyle,
6065
+ );
6066
+
6067
+ await tester.pumpWidget (
6068
+ buildInputDecorator (
6069
+ useMaterial3: useMaterial3,
6070
+ // isEmpty: false (default)
6071
+ // isFocused: false (default)
6072
+ decoration: decoration,
6073
+ ),
6074
+ );
6075
+ await tester.pumpAndSettle ();
6053
6076
6077
+ final Finder hintTextFinder = find.text (hintText);
6078
+ final Text hintTextWidget = tester.widget (hintTextFinder);
6079
+ expect (hintTextWidget.style! .overflow, decoration.hintStyle! .overflow);
6054
6080
});
6055
6081
}
6056
6082
}
You can’t perform that action at this time.
0 commit comments