showTextInputDialog function
Future<List<String> ?>
showTextInputDialog({
- required BuildContext context,
- required List<
DialogTextField> textFields, - String? title,
- String? message,
- String? okLabel,
- String? cancelLabel,
- bool isDestructiveAction = false,
- bool barrierDismissible = true,
- AdaptiveStyle style = AdaptiveStyle.adaptive,
- VerticalDirection actionsOverflowDirection = VerticalDirection.up,
- bool fullyCapitalizedForMaterial = true,
Implementation
Future<List<String>?> showTextInputDialog({
required BuildContext context,
required List<DialogTextField> textFields,
String? title,
String? message,
String? okLabel,
String? cancelLabel,
bool isDestructiveAction = false,
bool barrierDismissible = true,
AdaptiveStyle style = AdaptiveStyle.adaptive,
bool useRootNavigator = true,
VerticalDirection actionsOverflowDirection = VerticalDirection.up,
bool fullyCapitalizedForMaterial = true,
}) {
final theme = Theme.of(context);
return style.isCupertinoStyle(theme)
? showCupertinoDialog(
context: context,
useRootNavigator: useRootNavigator,
builder: (context) => CupertinoTextInputDialog(
textFields: textFields,
title: title,
message: message,
okLabel: okLabel,
cancelLabel: cancelLabel,
isDestructiveAction: isDestructiveAction,
style: style,
useRootNavigator: useRootNavigator,
),
)
: showModal(
context: context,
useRootNavigator: useRootNavigator,
configuration: FadeScaleTransitionConfiguration(
barrierDismissible: barrierDismissible,
),
builder: (context) => MaterialTextInputDialog(
textFields: textFields,
title: title,
message: message,
okLabel: okLabel,
cancelLabel: cancelLabel,
isDestructiveAction: isDestructiveAction,
style: style,
actionsOverflowDirection: actionsOverflowDirection,
useRootNavigator: useRootNavigator,
fullyCapitalized: fullyCapitalizedForMaterial,
),
);
}