A widget that wraps a TextFormField and draws connected borders with corner
radii that adapt to each field's position in a group.
Add the dependency to your app's pubspec.yaml:
dependencies:
text_form_field_wrapper: ^2.0.0Import the package:
import 'package:text_form_field_wrapper/text_form_field_wrapper.dart';TextFormFieldWrapper(
formField: TextFormField(
controller: myController,
decoration: const InputDecoration(border: InputBorder.none),
),
position: TextFormFieldPosition.alone,
)Use position to control how connected borders are rendered.
Column(
children: [
TextFormFieldWrapper(
formField: TextFormField(
controller: cardNumberController,
decoration: const InputDecoration(border: InputBorder.none),
),
position: TextFormFieldPosition.top,
),
Row(
children: [
Expanded(
child: TextFormFieldWrapper(
formField: TextFormField(
controller: expiryController,
decoration: const InputDecoration(border: InputBorder.none),
),
position: TextFormFieldPosition.bottomLeft,
),
),
Expanded(
child: TextFormFieldWrapper(
formField: TextFormField(
controller: cvvController,
decoration: const InputDecoration(border: InputBorder.none),
),
position: TextFormFieldPosition.bottomRight,
),
),
],
),
],
)- Set your inner
TextFormFielddecoration border toInputBorder.none. ColumnFormFieldItemis a data holder intended forColumnOfWrappedTextFields.
- Minimum SDKs are now Dart
>=3.11.0 <4.0.0and Flutter>=3.41.0. ColumnFormFieldItemis now a data holder class and is no longer a widget.
- If your app is on older Flutter/Dart, upgrade your app SDK first.
- If you previously treated
ColumnFormFieldItemlike a widget, replace that usage withTextFormFieldWrapperin widget trees and keepColumnFormFieldItemonly as configuration data inColumnOfWrappedTextFields. - Keep
InputBorder.noneon wrappedTextFormFielddecorations.
Version 2.0.0 adds optional fill-color overrides while preserving legacy
defaults when not provided.
TextFormFieldWrapper(
formField: TextFormField(
decoration: const InputDecoration(border: InputBorder.none),
),
fillColor: Colors.grey.shade50,
disabledFillColor: Colors.grey.shade100,
)If you do not set these properties, the widget keeps the same visual defaults as before.
- Found a bug? Open an issue at https://github.com/jonesw5/text_form_field_wrapper/issues.
- Want to add a feature? Open a pull request at https://github.com/jonesw5/text_form_field_wrapper/pulls.
