$declaration constant

BridgeClassDef const $declaration

Compile-time class declaration for $DateTime

Implementation

static const $declaration = BridgeClassDef(
    BridgeClassType(BridgeTypeRef(CoreTypes.dateTime)),
    constructors: {
      '': BridgeConstructorDef(BridgeFunctionDef(
          returns: BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.dateTime)),
          params: [
            BridgeParameter('year',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.int)), false),
            BridgeParameter('month',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.int)), true),
            BridgeParameter('day',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.int)), true),
            BridgeParameter('hour',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.int)), true),
            BridgeParameter('minute',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.int)), true),
            BridgeParameter('second',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.int)), true),
            BridgeParameter('millisecond',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.int)), true),
            BridgeParameter('microsecond',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.int)), true),
          ],
          namedParams: [])),
      'now': BridgeConstructorDef(BridgeFunctionDef(
          returns: BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.dateTime)),
          params: [],
          namedParams: [])),
    },
    methods: {
      'parse': BridgeMethodDef(
          BridgeFunctionDef(
              returns:
                  BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.dateTime)),
              params: [
                BridgeParameter(
                    'formattedString',
                    BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.string)),
                    false)
              ],
              namedParams: []),
          isStatic: true),
      'tryParse': BridgeMethodDef(
          BridgeFunctionDef(
              returns: BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.dateTime),
                  nullable: true),
              params: [
                BridgeParameter(
                    'formattedString',
                    BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.string)),
                    false)
              ],
              namedParams: []),
          isStatic: true),
      'isAfter': BridgeMethodDef(BridgeFunctionDef(
          returns: BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.bool)),
          params: [
            BridgeParameter(
                'other',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.dateTime)),
                false),
          ])),
      'isBefore': BridgeMethodDef(BridgeFunctionDef(
          returns: BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.bool)),
          params: [
            BridgeParameter(
                'other',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.dateTime)),
                false),
          ])),
      'isAtSameMomentAs': BridgeMethodDef(BridgeFunctionDef(
          returns: BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.bool)),
          params: [
            BridgeParameter(
                'other',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.dateTime)),
                false),
          ])),
      'compareTo': BridgeMethodDef(BridgeFunctionDef(
          returns: BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.int)),
          params: [
            BridgeParameter(
                'other',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.dateTime)),
                false),
          ])),
      'toLocal': BridgeMethodDef(BridgeFunctionDef(
          returns: BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.dateTime)),
          params: [])),
      'toUtc': BridgeMethodDef(BridgeFunctionDef(
          returns: BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.dateTime)),
          params: [])),
      'toIso8601String': BridgeMethodDef(BridgeFunctionDef(
          returns: BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.string)),
          params: [])),
      'add': BridgeMethodDef(BridgeFunctionDef(
          returns: BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.dateTime)),
          params: [
            BridgeParameter(
                'duration',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.duration)),
                false)
          ])),
      'subtract': BridgeMethodDef(BridgeFunctionDef(
          returns: BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.dateTime)),
          params: [
            BridgeParameter(
                'duration',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.duration)),
                false)
          ])),
      'difference': BridgeMethodDef(BridgeFunctionDef(
          returns: BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.duration)),
          params: [
            BridgeParameter(
                'other',
                BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.dateTime)),
                false)
          ])),
    },
    getters: {
      'day': _dtIntGetter,
      'hour': _dtIntGetter,
      'minute': _dtIntGetter,
      'second': _dtIntGetter,
      'millisecondsSinceEpoch': _dtIntGetter,
      'month': _dtIntGetter,
      'year': _dtIntGetter,
      'isUtc': _dtBoolGetter,
      'millisecond': _dtIntGetter,
      'microsecond': _dtIntGetter,
      'microsecondsSinceEpoch': _dtIntGetter,
      'weekday': _dtIntGetter,
      'timeZoneOffset': _dtDurationGetter,
    },
    setters: {},
    fields: {},
    wrap: true);