Closed shohrab-swl closed 1 week ago
{ "Operation": { "OperationID": 1 } }
Only Variable names automatically require the first letter to be lowercase.
class ResponseData { final Operation Operation; // Need automatic lowercase variable name
ResponseData({ required this.Operation, });
factory ResponseData.fromJson(Map<String, dynamic>? json) => ResponseData( Operation: Operation.fromJson(asT<Map<String, dynamic>>(json, 'Operation')), );
Map<String, dynamic> toJson() => { 'Operation': Operation.toJson(), };
ResponseData copyWith({ Operation? Operation,// Need automatic lowercase variable name }) { return ResponseData( Operation: Operation ?? this.Operation, ); } }
class Operation { // 1 final int OperationID;
Operation({ this.OperationID = 0, });
factory Operation.fromJson(Map<String, dynamic>? json) => Operation( OperationID: asT(json, 'OperationID'), );
Map<String, dynamic> toJson() => { 'OperationID': OperationID, };
Operation copyWith({ int? OperationID, }) { return Operation( OperationID: OperationID ?? this.OperationID, ); } }
Thanks for your feedback. I will fixed it in few days.
@shohrab-swl Fixed now. New package under review, you can download by json2dart-1.2.3.zip
{ "Operation": { "OperationID": 1 } }
Only Variable names automatically require the first letter to be lowercase.
class ResponseData { final Operation Operation; // Need automatic lowercase variable name
ResponseData({ required this.Operation, });
factory ResponseData.fromJson(Map<String, dynamic>? json) => ResponseData( Operation: Operation.fromJson(asT<Map<String, dynamic>>(json, 'Operation')), );
Map<String, dynamic> toJson() => { 'Operation': Operation.toJson(), };
ResponseData copyWith({ Operation? Operation,// Need automatic lowercase variable name }) { return ResponseData( Operation: Operation ?? this.Operation, ); } }
class Operation { // 1 final int OperationID;
Operation({ this.OperationID = 0, });
factory Operation.fromJson(Map<String, dynamic>? json) => Operation( OperationID: asT(json, 'OperationID'),
);
Map<String, dynamic> toJson() => { 'OperationID': OperationID, };
Operation copyWith({ int? OperationID, }) { return Operation( OperationID: OperationID ?? this.OperationID, ); } }