FirestoreDateTimeConverter class

!! If you using fs to connect firestore, you should not use this class. !!

use this like (import is required and must below @JsonKey):

import 'package:cloud_firestore_platform_interface/cloud_firestore_platform_interface.dart';

@freezed
class TaskDataset with _$TaskDataset {

  const factory TaskDataset({
    required String task,
    required bool isDone,
    @JsonKey(includeIfNull: false)
    @FirestoreDateTimeConverter()
    required DateTime? createdAt,
    bool? stared,
  }) = _TaskDataset;

  factory TaskDataset.fromJson(Map<String, dynamic> json) =>
      _$TaskDatasetFromJson(json);
}

Constructors

FirestoreDateTimeConverter()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fromJson(Timestamp timestamp) DateTime
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson(DateTime dateTime) → Timestamp
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited