def _to_schema(cls) -> str:
        """Convert a state to a schema.

        Returns:
            The hash of the schema.
        """

        def _field_tuple(
            field_name: str,
        ) -> tuple[str, Any, Any]:
            model_field = cls.__fields__[field_name]
            return (
                field_name,
                _serialize_type(model_field.type_),
                (model_field.default if is_serializable(model_field.default) else None),
            )

        return md5(
            pickle.dumps(
                sorted(_field_tuple(field_name) for field_name in cls.base_vars)
            )
        ).hexdigest()
Convert a state to a schema.

        Returns:
            The hash of the schema.
        
reflex/state.py