@@ -133,7 +133,7 @@ class DecoratedPlatformTextField extends StatelessWidget {
133133 /// If not set, select all and paste will default to be enabled. Copy and cut
134134 /// will be disabled if [obscureText] is true. If [readOnly] is true,
135135 /// paste and cut will be disabled regardless.
136- final ToolbarOptions ? toolbarOptions ;
136+ final Widget Function ( BuildContext , EditableTextState ) ? contextMenuBuilder ;
137137
138138 /// {@macro flutter.widgets.editableText.showCursor}
139139 final bool ? showCursor;
@@ -395,7 +395,7 @@ class DecoratedPlatformTextField extends StatelessWidget {
395395 this .textAlignVertical,
396396 this .textDirection,
397397 this .readOnly = false ,
398- this .toolbarOptions ,
398+ this .contextMenuBuilder ,
399399 this .showCursor,
400400 this .autofocus = false ,
401401 this .obscuringCharacter = '•' ,
@@ -463,7 +463,7 @@ class DecoratedPlatformTextField extends StatelessWidget {
463463 textAlignVertical: textAlignVertical,
464464 textDirection: textDirection,
465465 readOnly: readOnly,
466- toolbarOptions : toolbarOptions ,
466+ contextMenuBuilder : contextMenuBuilder ,
467467 showCursor: showCursor,
468468 obscuringCharacter: obscuringCharacter,
469469 smartDashesType: smartDashesType,
@@ -506,12 +506,8 @@ class DecoratedPlatformTextField extends StatelessWidget {
506506 obscureText: obscureText,
507507 onChanged: onChanged,
508508 keyboardAppearance: keyboardAppearance,
509- placeholder: cupertinoShowLabel
510- ? decoration? .hintText
511- : decoration? .labelText ?? decoration? .hintText,
512- prefix: decoration? .prefix ??
513- decoration? .prefixIcon ??
514- (cupertinoShowLabel ? null : icon),
509+ placeholder: cupertinoShowLabel ? decoration? .hintText : decoration? .labelText ?? decoration? .hintText,
510+ prefix: decoration? .prefix ?? decoration? .prefixIcon ?? (cupertinoShowLabel ? null : icon),
515511 suffix: decoration? .suffix ?? decoration? .suffixIcon,
516512 suffixMode: cupertinoSuffixMode,
517513 clearButtonMode: OverlayVisibilityMode .editing,
@@ -525,7 +521,7 @@ class DecoratedPlatformTextField extends StatelessWidget {
525521 textAlign: textAlign,
526522 textAlignVertical: textAlignVertical,
527523 readOnly: readOnly,
528- toolbarOptions : toolbarOptions ,
524+ contextMenuBuilder : contextMenuBuilder ,
529525 showCursor: showCursor,
530526 obscuringCharacter: obscuringCharacter,
531527 smartDashesType: smartDashesType,
@@ -552,9 +548,7 @@ class DecoratedPlatformTextField extends StatelessWidget {
552548 restorationId: restorationId,
553549 );
554550 final labelText = decoration? .labelText;
555- if (cupertinoShowLabel &&
556- cupertinoAlignLabelOnTop &&
557- labelText != null ) {
551+ if (cupertinoShowLabel && cupertinoAlignLabelOnTop && labelText != null ) {
558552 if (icon != null ) {
559553 content = Row (
560554 mainAxisAlignment: MainAxisAlignment .start,
0 commit comments