mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 05:32:26 +08:00
Add Table CellField
This commit is contained in:
@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user