Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to pass more props to text widget #727

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/src/base_dropdown_search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,11 @@ class DropdownSearchState<T> extends State<BaseDropdownSearch<T>> {
_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,
);
}

Expand Down
11 changes: 11 additions & 0 deletions lib/src/properties/dropdown_props.dart
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -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,
Expand Down