Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Adjust Material 3 textfield padding to align with specs (#116225)
Browse files Browse the repository at this point in the history
* Adjust textfield padding

* lint

* lint
  • Loading branch information
hangyujin committed Nov 30, 2022
1 parent fa063eb commit afda815
Show file tree
Hide file tree
Showing 2 changed files with 216 additions and 218 deletions.
8 changes: 2 additions & 6 deletions packages/flutter/lib/src/material/input_decorator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2345,18 +2345,14 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
if (decoration.filled ?? false) {
contentPadding = decorationContentPadding ?? (decorationIsDense
? const EdgeInsets.fromLTRB(12.0, 8.0, 12.0, 8.0)
: themeData.useMaterial3
? const EdgeInsets.fromLTRB(12.0, 12.75, 12.0, 12.75)
: const EdgeInsets.fromLTRB(12.0, 12.0, 12.0, 12.0));
: const EdgeInsets.fromLTRB(12.0, 12.0, 12.0, 12.0));
} else {
// Not left or right padding for underline borders that aren't filled
// is a small concession to backwards compatibility. This eliminates
// the most noticeable layout change introduced by #13734.
contentPadding = decorationContentPadding ?? (decorationIsDense
? const EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0)
: themeData.useMaterial3
? const EdgeInsets.fromLTRB(0.0, 12.75, 0.0, 12.75)
: const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 12.0));
: const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 12.0));
}
} else {
floatingLabelHeight = 0.0;
Expand Down

0 comments on commit afda815

Please sign in to comment.