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


class IconData(FlutImmutableObject):

    def __init__(
        self,
        codePoint: int,
        *,
        fontFamily: Optional[str] = None,
        fontPackage: Optional[str] = None,
        matchTextDirection: bool = False,
    ):
        super().__init__("IconData")
        self.codePoint = codePoint
        self.fontFamily = fontFamily
        self.fontPackage = fontPackage
        self.matchTextDirection = matchTextDirection

    @override
    def _flut_pack(self) -> dict:
        result = self._flut_base_props()
        result["codePoint"] = self.codePoint
        result["matchTextDirection"] = self.matchTextDirection
        if self.fontFamily is not None:
            result["fontFamily"] = self.fontFamily
        if self.fontPackage is not None:
            result["fontPackage"] = self.fontPackage
        return result
