schultek/dart_mappable

entity toMap() will missing some key like: "page" or "id"

Closed this issue · 1 comments

this is my request entity:

class SomeReqEntity with SomeEntityMappable {
  @MappableField(key: 'user_id')
  int? userId;
  int page = 1;
  String? sort;
  int? id;

  SomeReqEntity();

  factory SomeReqEntity.fromMap(Map<String, dynamic> map) =>
      SomeReqEntityMapper.fromMap(map);

  factory SomeReqEntity.fromJson(String json) =>
      SomeReqEntityMapper.fromJson(json);

  static SomeReqEntityMapper ensureInitialized() =>
      SomeReqEntityMapper.ensureInitialized();
}

when i give the value with id, page, userid,and use SomeReqEntity.toMap(),id and page key will missing
image

when i use @MappableField(key: 'id'), @MappableField(key: 'page'), every thing is fine.