-1

hello all I have an app in flutter and i have List Model I'm new in flutter

hello all I have an app in flutter and i have List Model I'm new in flutter

class OrderePostModel {
  OrderePostModel({
    this.id,
    this.itemsTbId,
    this.accessoriesTbId,
    this.userTbId,
    this.waitingTime,
    this.isReady,
    this.isWaiting,
    this.isClosed,
  });

  String? id;
  String? itemsTbId;
  String? accessoriesTbId;
  String? userTbId;
  String? waitingTime;
  bool? isReady;
  bool? isWaiting;
  bool? isClosed;

  factory OrderePostModel.fromJson(Map<String, dynamic> json) =>
      OrderePostModel(
        id: json["id"],
        itemsTbId: json["itemsTBId"],
        accessoriesTbId: json["accessoriesTBId"],
        userTbId: json["userTBId"],
        waitingTime: json["waitingTime"],
        isReady: json["isReady"],
        isWaiting: json["isWaiting"],
        isClosed: json["isClosed"],
      );

  Map<String, dynamic> toJson() => {
        "id": id,
        "itemsTBId": itemsTbId,
        "accessoriesTBId": accessoriesTbId,
        "userTBId": userTbId,
        "waitingTime": waitingTime,
        "isReady": isReady,
        "isWaiting": isWaiting,
        "isClosed": isClosed,
      };
}

want to add Value in This list ? like itemsTBId = 9;

iappsd
  • 1
  • Okay. So what did you try? What can you do so far and which part do you need help with? Can you create a new model with your values? Can you add that model to the list? – nvoigt Jun 06 '22 at 10:37

1 Answers1

0

You can change the model as below:

List<String>? itemsTBIds
Pathik Patel
  • 1,347
  • 1
  • 9
  • 22