@@ -2169,7 +2169,10 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
2169
2169
return border.copyWith (
2170
2170
borderSide: BorderSide (
2171
2171
color: _getDefaultM2BorderColor (themeData),
2172
- width: (decoration.isCollapsed || decoration.border == InputBorder .none || ! decoration.enabled)
2172
+ width: (
2173
+ (decoration.isCollapsed ?? themeData.inputDecorationTheme.isCollapsed)
2174
+ || decoration.border == InputBorder .none
2175
+ || ! decoration.enabled)
2173
2176
? 0.0
2174
2177
: isFocused ? 2.0 : 1.0 ,
2175
2178
),
@@ -2402,7 +2405,8 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
2402
2405
2403
2406
final EdgeInsets contentPadding;
2404
2407
final double floatingLabelHeight;
2405
- if (decoration.isCollapsed) {
2408
+ if (decoration.isCollapsed
2409
+ ?? themeData.inputDecorationTheme.isCollapsed) {
2406
2410
floatingLabelHeight = 0.0 ;
2407
2411
contentPadding = decorationContentPadding ?? EdgeInsets .zero;
2408
2412
} else if (! border.isOutline) {
@@ -2430,7 +2434,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
2430
2434
final _Decorator decorator = _Decorator (
2431
2435
decoration: _Decoration (
2432
2436
contentPadding: contentPadding,
2433
- isCollapsed: decoration.isCollapsed,
2437
+ isCollapsed: decoration.isCollapsed ?? themeData.inputDecorationTheme.isCollapsed ,
2434
2438
floatingLabelHeight: floatingLabelHeight,
2435
2439
floatingLabelAlignment: decoration.floatingLabelAlignment! ,
2436
2440
floatingLabelProgress: _floatingLabelAnimation.value,
@@ -2577,7 +2581,7 @@ class InputDecoration {
2577
2581
this .errorMaxLines,
2578
2582
this .floatingLabelBehavior,
2579
2583
this .floatingLabelAlignment,
2580
- this .isCollapsed = false ,
2584
+ this .isCollapsed,
2581
2585
this .isDense,
2582
2586
this .contentPadding,
2583
2587
this .prefixIcon,
@@ -2976,7 +2980,7 @@ class InputDecoration {
2976
2980
/// A collapsed decoration cannot have [labelText] , [errorText] , an [icon] .
2977
2981
///
2978
2982
/// To create a collapsed input decoration, use [InputDecoration.collapsed] .
2979
- final bool isCollapsed;
2983
+ final bool ? isCollapsed;
2980
2984
2981
2985
/// An icon that appears before the [prefix] or [prefixText] and before
2982
2986
/// the editable part of the text field, within the decoration's container.
@@ -3620,7 +3624,7 @@ class InputDecoration {
3620
3624
floatingLabelAlignment: floatingLabelAlignment ?? theme.floatingLabelAlignment,
3621
3625
isDense: isDense ?? theme.isDense,
3622
3626
contentPadding: contentPadding ?? theme.contentPadding,
3623
- isCollapsed: isCollapsed,
3627
+ isCollapsed: isCollapsed ?? theme.isCollapsed ,
3624
3628
iconColor: iconColor ?? theme.iconColor,
3625
3629
prefixStyle: prefixStyle ?? theme.prefixStyle,
3626
3630
prefixIconColor: prefixIconColor ?? theme.prefixIconColor,
@@ -3782,7 +3786,7 @@ class InputDecoration {
3782
3786
if (floatingLabelAlignment != null ) 'floatingLabelAlignment: $floatingLabelAlignment ' ,
3783
3787
if (isDense ?? false ) 'isDense: $isDense ' ,
3784
3788
if (contentPadding != null ) 'contentPadding: $contentPadding ' ,
3785
- if (isCollapsed) 'isCollapsed: $isCollapsed ' ,
3789
+ if (isCollapsed ?? false ) 'isCollapsed: $isCollapsed ' ,
3786
3790
if (prefixIcon != null ) 'prefixIcon: $prefixIcon ' ,
3787
3791
if (prefixIconColor != null ) 'prefixIconColor: $prefixIconColor ' ,
3788
3792
if (prefix != null ) 'prefix: $prefix ' ,
0 commit comments