toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() => {
      "date":
          "${date!.year.toString().padLeft(4, '0')}-${date!.month.toString().padLeft(2, '0')}-${date!.day.toString().padLeft(2, '0')}",
      "time_stamp": timeStamp,
      "token": token,
      "user_code": userCode,
      "locations": locations == null ? [] : List<dynamic>.from(locations!.map((x) => x.toMap())),
      "device": device?.toMap(),
      "sucursales": sucursales == null ? [] : List<dynamic>.from(sucursales!.map((x) => x.toMap())),
      "usuario": usuario?.toMap(),
      "session": session?.toMap(),
    };