Add Table CellField

This commit is contained in:
Ankit Mahato
2023-04-21 13:19:05 +05:30
parent eabece7239
commit 56ac8cc0c0
3 changed files with 115 additions and 154 deletions

View File

@ -42,3 +42,56 @@ class _URLFieldState extends State<URLField> {
);
}
}
class CellField extends StatefulWidget {
const CellField(
{super.key,
required this.colorScheme,
required this.keyId,
required this.initialValue,
this.hintText,
this.onChanged});
final ColorScheme colorScheme;
final String keyId;
final String initialValue;
final String? hintText;
final void Function(String)? onChanged;
@override
State<CellField> createState() => _CellFieldState();
}
class _CellFieldState extends State<CellField> {
@override
Widget build(BuildContext context) {
return TextFormField(
key: Key(widget.keyId),
initialValue: widget.initialValue,
style: kCodeStyle.copyWith(
color: widget.colorScheme.onSurface,
),
decoration: InputDecoration(
hintStyle: kCodeStyle.copyWith(
color: widget.colorScheme.outline.withOpacity(
kHintOpacity,
),
),
hintText: widget.hintText,
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: widget.colorScheme.primary.withOpacity(
kHintOpacity,
),
),
),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: widget.colorScheme.surfaceVariant,
),
),
),
onChanged: widget.onChanged,
);
}
}