showSafaehTextInput function
Future<String?>
showSafaehTextInput({
- required BuildContext context,
- required String title,
- required String doneLabel,
- String? hint,
- String initialValue = '',
- int maxLines = 1,
- int? maxLength,
- bool obscureText = false,
- TextInputType? keyboardType,
- TextInputAction? textInputAction,
- List<
TextInputFormatter> ? inputFormatters, - bool autocorrect = true,
- bool enableSuggestions = true,
- ValueChanged<
String> ? onChanged, - String? cancelLabel,
- SafaehTitleBuilder? titleBuilder,
- double railWidthOf(
- BuildContext context
- SafaehTransition? fadeScale,
- SafaehTransition? slideUp,
- SafaehPhoneSheetPlacement phonePlacement = SafaehPhoneSheetPlacement.bottom,
- double? tabletBreakpoint,
- Duration? motion,
- Curve? enterCurve,
- Curve? exitCurve,
- double? maxWidth,
- double? maxHeight,
- bool barrierDismissible = true,
- bool showTitleInBody = true,
- SafaehRouteOptions? route,
Adaptive text field. Returns the trimmed value, or null if dismissed.
Hosts pass doneLabel / cancelLabel — no .tr() here.
Implementation
Future<String?> showSafaehTextInput({
required BuildContext context,
required String title,
required String doneLabel,
String? hint,
String initialValue = '',
int maxLines = 1,
int? maxLength,
bool obscureText = false,
TextInputType? keyboardType,
TextInputAction? textInputAction,
List<TextInputFormatter>? inputFormatters,
bool autocorrect = true,
bool enableSuggestions = true,
ValueChanged<String>? onChanged,
String? cancelLabel,
SafaehTitleBuilder? titleBuilder,
double Function(BuildContext context)? railWidthOf,
SafaehTransition? fadeScale,
SafaehTransition? slideUp,
SafaehPhoneSheetPlacement phonePlacement = SafaehPhoneSheetPlacement.bottom,
double? tabletBreakpoint,
Duration? motion,
Curve? enterCurve,
Curve? exitCurve,
double? maxWidth,
double? maxHeight,
bool barrierDismissible = true,
bool useRootNavigator = true,
bool showTitleInBody = true,
SafaehRouteOptions? route,
}) {
return showSafaeh<String?>(
context: context,
title: title,
titleBuilder: titleBuilder,
maxWidth: maxWidth,
maxHeight: maxHeight,
barrierDismissible: barrierDismissible,
tabletBreakpoint: tabletBreakpoint,
motion: motion,
enterCurve: enterCurve,
exitCurve: exitCurve,
railWidthOf: railWidthOf,
fadeScale: fadeScale,
slideUp: slideUp,
phonePlacement: phonePlacement,
useRootNavigator: useRootNavigator,
paintPhoneTitle: !showTitleInBody,
route: route,
child: SafaehTextInputSheet(
title: title,
doneLabel: doneLabel,
hint: hint,
initialValue: initialValue,
maxLines: maxLines,
maxLength: maxLength,
obscureText: obscureText,
keyboardType: keyboardType,
textInputAction: textInputAction,
inputFormatters: inputFormatters,
autocorrect: autocorrect,
enableSuggestions: enableSuggestions,
onChanged: onChanged,
cancelLabel: cancelLabel,
showTitleInBody: showTitleInBody,
titleBuilder: titleBuilder,
tabletBreakpoint: tabletBreakpoint,
),
);
}