diff --git a/CHANGELOG.md b/CHANGELOG.md index 6536b0e..9eacc04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 1.0.0+4 +- Added: FancyFromField documentation. + ## 1.0.0+3 - Fixed CHANGELOG. diff --git a/README.md b/README.md index 0d1dd6a..fda2331 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add the package to your `pubspec.yaml`: ```yaml dependencies: - fancy_form: ^1.0.0+3 + fancy_form: ^1.0.0+4 ``` Run `flutter pub get` to install. diff --git a/lib/fancy_form_field.dart b/lib/fancy_form_field.dart index 017a402..6ecbf5c 100644 --- a/lib/fancy_form_field.dart +++ b/lib/fancy_form_field.dart @@ -3,55 +3,156 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:mask_text_input_formatter/mask_text_input_formatter.dart'; +/// A custom form field widget that integrates with a form manager and offers various configurable input properties. +/// +/// The `FancyFormField` widget allows you to customize the behavior and appearance of a text input field, +/// including validation, input formatting, and styling. class FancyFormField extends StatefulWidget { + /// Controls the validation and auto-validation mode for the field. final AutovalidateMode? autovalidateMode; + + /// A unique key to identify this field in the form. final FancyKey fancyKey; + + /// The controller for the text input field. final TextEditingController? controller; + + /// Whether the field is enabled or not. final bool? enabled; + + /// A forced error message to display instead of the default error messages. final String? forceErrorText; + + /// The initial value of the field. final String? initialValue; + + /// A callback that is invoked when the field value changes. final ValueChanged? onChanged; + + /// A callback that is invoked when the form is saved. final FormFieldSetter? onSaved; + + /// The restoration ID used to restore the state of the field. final String? restorationId; + + /// A validator function that validates the field input. final FormFieldValidator? validator; + + /// A node that can be used to manage the focus state of the input field. final FocusNode? focusNode; + + /// The decoration for the input field, such as label, hint, and icon. final InputDecoration? decoration; + + /// The keyboard type (e.g., text, number, email). final TextInputType? keyboardType; + + /// Controls text capitalization behavior for the field (e.g., none, sentences, words). final TextCapitalization textCapitalization; + + /// The action button on the keyboard (e.g., next, done). final TextInputAction? textInputAction; + + /// The text style for the input field. final TextStyle? style; + + /// The style for the text strut (line height). final StrutStyle? strutStyle; + + /// The text direction for the input field (e.g., left-to-right, right-to-left). final TextDirection? textDirection; + + /// The alignment of the text within the field (e.g., left, right, center). final TextAlign textAlign; + + /// The vertical alignment of the text within the field. final TextAlignVertical? textAlignVertical; + + /// Whether the field should autofocus when the widget is built. final bool autofocus; + + /// Whether the field is read-only. final bool readOnly; + + /// Controls whether the cursor is visible in the field. final bool? showCursor; + + /// The character to obscure the text when `obscureText` is enabled (e.g., `•`). final String obscuringCharacter; + + /// Whether the field obscures the text (typically used for passwords). final bool obscureText; + + /// Whether autocorrection is enabled for the field. final bool autocorrect; + + /// A list of input formatters to apply to the input field. final List? inputFormatters; + + /// Whether suggestions (e.g., predictive text) are enabled. final bool enableSuggestions; + + /// The maximum number of lines that the input can occupy. final int? maxLines; + + /// The minimum number of lines that the input can occupy. final int? minLines; + + /// Whether the input should expand to fill the available space. final bool expands; + + /// The maximum length of the input. final int? maxLength; + + /// A callback that is triggered when the input field is tapped. final GestureTapCallback? onTap; + + /// Whether the `onTap` callback should always be called. final bool onTapAlwaysCalled; + + /// A callback that is triggered when tapping outside of the field. final TapRegionCallback? onTapOutside; + + /// A callback that is triggered when editing is complete. final VoidCallback? onEditingComplete; + + /// A callback that is triggered when the field value is submitted. final ValueChanged? onFieldSubmitted; + + /// The scroll physics to apply to the field's scrollable area. final ScrollPhysics? scrollPhysics; + + /// The controller for the scrollable area of the field. final ScrollController? scrollController; + + /// The width of the cursor in the input field. final double cursorWidth; + + /// The height of the cursor in the input field. final double? cursorHeight; + + /// The radius of the cursor. final Radius? cursorRadius; + + /// The color of the cursor in the input field. final Color? cursorColor; + + /// The color of the cursor when an error occurs. final Color? cursorErrorColor; + + /// The appearance mode of the keyboard (e.g., light or dark). final Brightness? keyboardAppearance; + + /// The padding for the scrollable area of the field. final EdgeInsets scrollPadding; + + /// Whether to enable personalized learning for the IME (Input Method Editor). final bool enableIMEPersonalizedLearning; + + /// Whether to allow interactive selection of the text in the input field. final bool? enableInteractiveSelection; + + /// The clipping behavior for the input field. final Clip clipBehavior; const FancyFormField({ @@ -111,6 +212,7 @@ class FancyFormField extends StatefulWidget { State createState() => _FancyFormFieldState(); } +/// The state of the `FancyFormField` widget, managing the text input controller and input formatters. class _FancyFormFieldState extends State { late final TextEditingController controller; final List inputFormatters = []; diff --git a/pubspec.yaml b/pubspec.yaml index 8eee557..8f5a28d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fancy_form description: A flexible and easy-to-use form management solution for Flutter. -version: 1.0.0+3 +version: 1.0.0+4 repository: https://github.com/MusilyApp/fancy_form.git environment: