C2CSecondaryInput
A custom secondary input widget that extends TextField.
This widget is designed to enhance the standard TextField with additional features and styling options commonly used in form inputs.
Example
import 'package:c2c_core/c2c_core.dart';
import 'package:flutter/material.dart';
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('C2CSecondaryInput')),
body: const C2CSecondaryInput(
label: 'Label',
placeholder: 'Placeholder',
),
),
);
}
}
void main() => runApp(const ExampleApp());
Properties
Inherits TextField Props.
placeholder
Placeholder text for the input field.
| Type |
|---|
| String? |
placeholderColor
Color of the placeholder text.
| Type |
|---|
| Color? |
backgroundColor
Background color of the input field.
| Type |
|---|
| Color? |
disabledBackgroundColor
Background color of the input field when it's disabled.
| Type |
|---|
| Color? |
label
Label of the input field. Can be either a string or a widget.
| Type |
|---|
| dynamic (String or Widget)? |
labelStyle
Style for the label text.
| Type |
|---|
| TextStyle? |
isRequired
If true, displays an asterisk next to the label to indicate it's a required field.
| Type |
|---|
| bool |
asteriskCharacter
Character to use for the asterisk symbol.
| Type |
|---|
| String? |
asteriskStyle
Style for the asterisk symbol.
| Type |
|---|
| TextStyle? |
leftIcon
Widget to display as a left icon within the input field.
| Type |
|---|
| Widget? |
rightIcon
Widget to display as a right icon within the input field.
| Type |
|---|
| Widget? |
error
Error message to display. Can be either a string or a widget.
| Type |
|---|
| dynamic (String or Widget)? |
errorTextStyle
Style for the error message text.
| Type |
|---|
| TextStyle? |
errorMaxLines
Maximum number of error lines that can be displayed.
| Type |
|---|
| int? |
height
Height of the input field for multi-line input (overrides maxLines and minLines).
| Type |
|---|
| double? |
iconColor
Color of icons (left and right icons) within the input field.
| Type |
|---|
| Color? |
disabledIconColor
Color of icons when the input field is disabled.
| Type |
|---|
| Color? |
disabledColor
Text color of the input field when it's disabled.
| Type |
|---|
| Color? |
helperText
Helper text to display below the input field. Can be either a string or a widget.
| Type |
|---|
| dynamic (String or Widget)? |
helperTextStyle
Style for the helper text.
| Type |
|---|
| TextStyle? |
helperMaxLines
Maximum number of lines for the helper text.
| Type |
|---|
| int? |
isShowCounter
If true, displays a character counter below the input field.
| Type |
|---|
| bool |
counterTextStyle
Style for the character counter text.
| Type |
|---|
| TextStyle? |
counterBuilder
Custom builder for the character counter widget.
| Type |
|---|
| Widget Function(int)? |
helperTextSpacing
Spacing between the helper text and the input field.
| Type |
|---|
| double? |
rightIconPadding
Padding for the right icon within the input field.
| Type |
|---|
| EdgeInsets? |
leftIconPadding
Padding for the left icon within the input field.
| Type |
|---|
| EdgeInsets? |
errorIcon
Image to use as an error icon.
| Type |
|---|
| ImageProvider? |
errorIconSize
Size of the error icon.
| Type |
|---|
| double? |
passwordIconBuilder
Custom builder for the password visibility toggle icon.
| Type |
|---|
| Widget Function(bool obscureText)? |
alwaysShowPasswordIcon
Vertical spacing below the label.
| Type |
|---|
| double? |
ensureFooterVisible
If true, ensures that the footer is always visible when the input field gains focus.
| Type |
|---|
| bool? |
onFocus
Callback function that is called when the input field gains focus.
| Type |
|---|
| Function()? |
onBlur
Callback function that is called when the input field loses focus.
| Type |
|---|
| Function()? |
borderRadius
Border radius of the input field.
| Type |
|---|
| BorderRadius? |