Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
  • Sign in
F
Front-End
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • abdullh.alsoleman
  • Front-End
  • Repository

Switch branch/tag
  • front-end
  • examples
  • api
  • test
  • material
  • input_decorator
History Find file
Download source code
zip tar.gz tar.bz2 tar
Download this directory
zip tar.gz tar.bz2 tar
  • Bruno Leroux's avatar
    Fix M3 text field height + initial step for input decorator M3 test migration (#142981) · 6a7baf57
    Bruno Leroux authored Feb 07, 2024
    ## 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
    6a7baf57
Name
Last commit
Last update
..
input_decoration.floating_label_style_error.0_test.dart Loading commit data...
input_decoration.label_style_error.0_test.dart Loading commit data...
input_decoration.prefix_icon.0_test.dart Loading commit data...
input_decoration.suffix_icon.0_test.dart Loading commit data...

HIAST - GitLab