Skip to content

Commit

Permalink
fix: Border style can be applied to FormBuilder.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Aug 29, 2023
1 parent f1d7cf6 commit d90ccf5
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions packages/katana_form/lib/form/form_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,23 @@ class _FormBuilderState<T, TValue> extends FormFieldState<T>
@override
Widget build(BuildContext context) {
super.build(context);
return Padding(
padding: widget.style?.padding ?? const EdgeInsets.all(0),

final decoration =
widget.style?.borderColor != null && widget.style?.borderWidth != null
? BoxDecoration(
borderRadius: widget.style?.borderRadius ??
const BorderRadius.all(Radius.circular(4.0)),
border: Border.all(
color: widget.style!.borderColor!,
width: widget.style!.borderWidth!,
),
)
: null;

return Container(
decoration: decoration,
margin: widget.style?.padding ?? const EdgeInsets.all(0),
padding: widget.style?.contentPadding ?? const EdgeInsets.all(0),
child: widget._builder(context, this, value),
);
}
Expand Down

0 comments on commit d90ccf5

Please sign in to comment.