consume_qrcode_model.dart
1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import 'package:flutter/cupertino.dart';
class ConsumeQrcodeModel {
int? ret;
List<ConsumeQrcodeSunModel>? data;
String? msg;
ConsumeQrcodeModel({this.ret, this.data, this.msg});
ConsumeQrcodeModel.fromJson(Map<dynamic, dynamic> json) {
ret = json['ret'];
if (json['data'] != null) {
data = <ConsumeQrcodeSunModel>[];
json['data'].forEach((v) {
data!.add(new ConsumeQrcodeSunModel.fromJson(v));
});
}
msg = json['msg'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ret'] = this.ret;
if (this.data != null) {
data['data'] = this.data!.map((v) => v.toJson()).toList();
}
data['msg'] = this.msg;
return data;
}
}
class ConsumeQrcodeSunModel {
String? id;
String? sellerid;
String? qrcode;
String? amount;
String? cdate;
TextEditingController amountC = TextEditingController();
ConsumeQrcodeSunModel(
{this.id, this.sellerid, this.qrcode, this.amount, this.cdate});
ConsumeQrcodeSunModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
sellerid = json['sellerid'];
qrcode = json['qrcode'];
amount = json['amount'];
cdate = json['cdate'];
amountC.text = amount ?? '';
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['sellerid'] = this.sellerid;
data['qrcode'] = this.qrcode;
data['amount'] = this.amount;
data['cdate'] = this.cdate;
return data;
}
}