@@ -3182,6 +3182,65 @@ void main() {
3182
3182
expect (FloatingLabelAlignment .center.toString (), 'FloatingLabelAlignment.center' );
3183
3183
});
3184
3184
3185
+ group ('inputText width' , () {
3186
+ testWidgets ('outline textField' , (WidgetTester tester) async {
3187
+ await tester.pumpWidget (
3188
+ buildInputDecorator (
3189
+ useMaterial3: useMaterial3,
3190
+ decoration: const InputDecoration (
3191
+ border: OutlineInputBorder (),
3192
+ ),
3193
+ ),
3194
+ );
3195
+ expect (tester.getSize (find.byType (InputDecorator )), const Size (800.0 , 56.0 ));
3196
+ expect (tester.getTopLeft (find.text ('text' )).dx, 12.0 );
3197
+ expect (tester.getTopRight (find.text ('text' )).dx, 788.0 );
3198
+ });
3199
+ testWidgets ('outline textField with prefix and suffix icons' , (WidgetTester tester) async {
3200
+ await tester.pumpWidget (
3201
+ buildInputDecorator (
3202
+ useMaterial3: useMaterial3,
3203
+ decoration: const InputDecoration (
3204
+ border: OutlineInputBorder (),
3205
+ prefixIcon: Icon (Icons .visibility),
3206
+ suffixIcon: Icon (Icons .close),
3207
+ ),
3208
+ ),
3209
+ );
3210
+ expect (tester.getSize (find.byType (InputDecorator )), const Size (800.0 , 56.0 ));
3211
+ expect (tester.getTopLeft (find.text ('text' )).dx, 48.0 );
3212
+ expect (tester.getTopRight (find.text ('text' )).dx, 752.0 );
3213
+ });
3214
+ testWidgets ('filled textField' , (WidgetTester tester) async {
3215
+ await tester.pumpWidget (
3216
+ buildInputDecorator (
3217
+ useMaterial3: useMaterial3,
3218
+ decoration: const InputDecoration (
3219
+ filled: true ,
3220
+ ),
3221
+ ),
3222
+ );
3223
+ expect (tester.getSize (find.byType (InputDecorator )), const Size (800.0 , 48.0 ));
3224
+ expect (tester.getTopLeft (find.text ('text' )).dx, 12.0 );
3225
+ expect (tester.getTopRight (find.text ('text' )).dx, 788.0 );
3226
+ });
3227
+ testWidgets ('filled textField with prefix and suffix icons' , (WidgetTester tester) async {
3228
+ await tester.pumpWidget (
3229
+ buildInputDecorator (
3230
+ useMaterial3: useMaterial3,
3231
+ decoration: const InputDecoration (
3232
+ filled: true ,
3233
+ prefixIcon: Icon (Icons .visibility),
3234
+ suffixIcon: Icon (Icons .close),
3235
+ ),
3236
+ ),
3237
+ );
3238
+ expect (tester.getSize (find.byType (InputDecorator )), const Size (800.0 , 48.0 ));
3239
+ expect (tester.getTopLeft (find.text ('text' )).dx, 48.0 );
3240
+ expect (tester.getTopRight (find.text ('text' )).dx, 752.0 );
3241
+ });
3242
+ });
3243
+
3185
3244
group ('floatingLabelAlignment' , () {
3186
3245
Widget buildInputDecoratorWithFloatingLabel ({required TextDirection textDirection,
3187
3246
required bool hasIcon,
0 commit comments