From 3ebbcd319e5d8fb66087f517938306072e8133a4 Mon Sep 17 00:00:00 2001 From: Vasiliy Ditsyak Date: Fri, 13 Dec 2024 11:00:01 +0100 Subject: [PATCH] allow to pass more props to text widget --- lib/src/base_dropdown_search.dart | 5 +++++ lib/src/properties/dropdown_props.dart | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/lib/src/base_dropdown_search.dart b/lib/src/base_dropdown_search.dart index 5256bf0..ae8fb4c 100644 --- a/lib/src/base_dropdown_search.dart +++ b/lib/src/base_dropdown_search.dart @@ -488,6 +488,11 @@ class DropdownSearchState extends State> { _itemAsString(item), style: _getBaseTextStyle(), textAlign: widget.decoratorProps.textAlign, + softWrap: widget.decoratorProps.softWrap, + overflow: widget.decoratorProps.overflow, + maxLines: widget.decoratorProps.maxLines, + textWidthBasis: widget.decoratorProps.textWidthBasis, + textHeightBehavior: widget.decoratorProps.textHeightBehavior, ); } diff --git a/lib/src/properties/dropdown_props.dart b/lib/src/properties/dropdown_props.dart index e53a0a6..81cfdc7 100644 --- a/lib/src/properties/dropdown_props.dart +++ b/lib/src/properties/dropdown_props.dart @@ -1,6 +1,7 @@ import 'package:dropdown_search/dropdown_search.dart'; import 'package:dropdown_search/src/widgets/props/icon_button_props.dart'; import 'package:flutter/material.dart'; +import 'dart:ui' as ui show TextHeightBehavior; typedef DropdownButtonAnimationBuilder = Widget Function( Widget child, bool isOpen); @@ -44,11 +45,21 @@ class DropDownDecoratorProps { final TextAlignVertical? textAlignVertical; final bool expands; final bool isHovering; + final bool softWrap; + final TextOverflow overflow; + final int? maxLines; + final TextWidthBasis textWidthBasis; + final ui.TextHeightBehavior? textHeightBehavior; const DropDownDecoratorProps({ this.decoration, this.baseStyle, this.textAlign, + this.softWrap = true, + this.overflow = TextOverflow.clip, + this.maxLines, + this.textWidthBasis = TextWidthBasis.parent, + this.textHeightBehavior, this.textAlignVertical, this.expands = false, this.isHovering = false,