from typing import Optional, override
from flut._flut.engine import FlutImmutableObject
from .border_radius import BorderRadius


class BoxDecoration(FlutImmutableObject):
    def __init__(
        self,
        *,
        color=None,
        border=None,
        borderRadius=None,
    ):
        super().__init__("BoxDecoration")
        self.color = color
        self.border = border
        self.borderRadius = borderRadius

    @override
    def _flut_pack(self) -> dict:
        result = self._flut_base_props()
        if self.color is not None:
            result["color"] = self.color._flut_pack()
        if self.border is not None:
            result["border"] = self.border._flut_pack()
        if self.borderRadius is not None:
            result["borderRadius"] = self.borderRadius._flut_pack()
        return result
