flutter/packages
Bruno Leroux 6a7baf573e
Fix M3 text field height + initial step for input decorator M3 test migration (#142981)
## Description

This PR main purpose is to make progress on the M3 test migration for `InputDecorator` (see https://github.com/flutter/flutter/issues/139076).

Before this PR more than 80 of the 156 tests defined in `input_decorator_test.dart` fail on M3.
Migrating all those tests in one shot is not easy at all because many failures are related to wrong positionning due to M3 typography changes. Another reason is that several M3 specific changes are required in order to get a proper M3 compliant text field, for instance:
- https://github.com/flutter/flutter/issues/142972
- https://github.com/flutter/flutter/issues/141354

Most of the tests were relying on an helper function (`buildInputDecorator`) which had a `useMaterial3` parameter. Unfortunately when `useMaterial3: true `was passed to this function it forced `useMaterial3: false` at the top level but overrided it at a lower level, which was very misleading because people could assume that the tests are ok with M3 (but in fact they were run using M2 typography but have some M3 logic in use).
I considered various way to make this change and I finally decided to run all existing tests only on M2 for the moment. Next step will be to move most of those tests to M3. In this PR, I migrated two of these existing tests for illustration.

Because many of the existing tests are checking input decorator height, I think it would also make sense to fix https://github.com/flutter/flutter/issues/142972 first. That's why I choosed to include a fix to https://github.com/flutter/flutter/issues/142972 in this PR.

A M3 filled `TextField` on Android:

| Before this PR | After this PR |
|--------|--------|
| ![image](https://github.com/flutter/flutter/assets/840911/403225b7-4c91-4aee-b19c-0490447ae7e3) | ![image](https://github.com/flutter/flutter/assets/840911/e96cf786-a9f5-4e15-bcdd-078350ff1608) | 

## Related Issue

Fixes https://github.com/flutter/flutter/issues/142972
Related to https://github.com/flutter/flutter/issues/139076

## Tests

Updates many existing tests 
+ adds 2 tests related to the fix for https://github.com/flutter/flutter/issues/142972
+ adds 1 tests for the M3 migration
+ move 1 tests related to M3
2024-02-07 13:57:21 +00:00
..
flutter Fix M3 text field height + initial step for input decorator M3 test migration (#142981) 2024-02-07 13:57:21 +00:00
flutter_driver Unpin test (#141427) 2024-02-01 18:53:23 +00:00
flutter_goldens Unpin test (#141427) 2024-02-01 18:53:23 +00:00
flutter_localizations Unpin test (#141427) 2024-02-01 18:53:23 +00:00
flutter_test Update _goldens_io.dart to generate failure images during a size mism… (#142177) 2024-02-07 03:23:29 +00:00
flutter_tools Copy the flutter version JSON file into the simulated Flutter SDK used by update_packages (#143035) 2024-02-06 20:00:08 -08:00
flutter_web_plugins Unpin test (#141427) 2024-02-01 18:53:23 +00:00
fuchsia_remote_debug_protocol Unpin test (#141427) 2024-02-01 18:53:23 +00:00
integration_test Reverts "Update gradle lockfiles template" (#142889) 2024-02-04 14:28:18 +00:00
analysis_options.yaml Unify analysis options (#108462) 2022-07-28 09:07:49 -07:00