name hin text take null, ifg null then dont display hint
This commit is contained in:
@@ -9,7 +9,7 @@ class MihTextFormField extends StatefulWidget {
|
|||||||
final Color inputColor;
|
final Color inputColor;
|
||||||
final TextEditingController controller;
|
final TextEditingController controller;
|
||||||
final bool? hasError;
|
final bool? hasError;
|
||||||
final String hintText;
|
final String? hintText;
|
||||||
final double? borderRadius;
|
final double? borderRadius;
|
||||||
final bool? multiLineInput;
|
final bool? multiLineInput;
|
||||||
final bool? readOnly;
|
final bool? readOnly;
|
||||||
@@ -98,11 +98,13 @@ class _MihTextFormFieldState extends State<MihTextFormField> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Visibility(
|
||||||
|
visible: widget.hintText != null,
|
||||||
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
widget.hintText,
|
widget.hintText ?? "",
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: widget.fillColor,
|
color: widget.fillColor,
|
||||||
@@ -124,6 +126,7 @@ class _MihTextFormFieldState extends State<MihTextFormField> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
FormField<String>(
|
FormField<String>(
|
||||||
initialValue: widget.controller.text,
|
initialValue: widget.controller.text,
|
||||||
|
|||||||
Reference in New Issue
Block a user