diff --git a/tdesign-component/lib/src/components/dropdown_menu/td_dropdown_item.dart b/tdesign-component/lib/src/components/dropdown_menu/td_dropdown_item.dart index 997ee33ce..258e408f9 100644 --- a/tdesign-component/lib/src/components/dropdown_menu/td_dropdown_item.dart +++ b/tdesign-component/lib/src/components/dropdown_menu/td_dropdown_item.dart @@ -80,9 +80,9 @@ class TDDropdownItem extends StatefulWidget { static const double operateHeight = 73; - double? get minContenHeight => + double? get minContentHeight => multiple == true ? (minHeight != null ? minHeight! + TDDropdownItem.operateHeight : null) : minHeight; - double? get maxContenHeight => + double? get maxContentHeight => multiple == true ? (maxHeight != null ? maxHeight! + TDDropdownItem.operateHeight : null) : maxHeight; @override @@ -117,15 +117,15 @@ class _TDDropdownItemState extends State { Widget _getCheckboxList() { var paddingNum = TDTheme.of(context).spacer16; var groupCunck = _groupChunkOptions(); - var maxContentHeight = widget.maxContenHeight != null - ? widget.maxContenHeight! + var maxContentHeight = widget.maxContentHeight != null + ? widget.maxContentHeight! : directionListenable.value == TDDropdownMenuDirection.auto ? double.infinity : max(popupState.maxContentHeight - TDDropdownItem.operateHeight, 0); return Column( children: [ ConstrainedBox( - constraints: BoxConstraints(minHeight: widget.minContenHeight ?? 0.0, maxHeight: maxContentHeight), + constraints: BoxConstraints(minHeight: widget.minContentHeight ?? 0.0, maxHeight: maxContentHeight), child: SingleChildScrollView( child: Column( children: List.generate(groupCunck.length, (index) { @@ -197,11 +197,11 @@ class _TDDropdownItemState extends State { ), ), ); - return widget.minContenHeight != null || widget.maxContenHeight != null + return widget.minContentHeight != null || widget.maxContentHeight != null ? ConstrainedBox( constraints: BoxConstraints( - minHeight: widget.minContenHeight ?? 0.0, maxHeight: widget.maxContenHeight ?? double.infinity), - child: widget.maxContenHeight != null ? SingleChildScrollView(child: radios) : radios, + minHeight: widget.minContentHeight ?? 0.0, maxHeight: widget.maxContentHeight ?? double.infinity), + child: widget.maxContentHeight != null ? SingleChildScrollView(child: radios) : radios, ) : radios; }