def TypeOrNothing(dart_type, comment=None, nullable=False):
    """Returns string for declaring something with |dart_type| in a context
  where a type may be omitted.
  The string is empty or has a trailing space.
  """
    nullability_operator = '?' if nullable else ''
    if dart_type == 'dynamic':
        if comment:
            return '/*%s*/ ' % comment  # Just a comment foo(/*T*/ x)
        else:
            return ''  # foo(x) looks nicer than foo(var|dynamic x)
    else:
        return dart_type + nullability_operator + ' '