import 'package:mwf_app/service/api.dart';
import 'package:mwf_app/service/url.dart';

class StatusType {
  String id;
  String statusType;

  StatusType({this.id, this.statusType});

  static getData() async {
    print(AppUrl.StatusServiceType_ReadList + "?AuthenKey=" + AppUrl.AuthenKey);
    final response = await AppApi.apiGetRequest(
        AppUrl.StatusServiceType_ReadList +
            "?AuthenKey=" +
            AppUrl.AuthenKey); // เรียกใช้ api
    data.clear(); // เคลียข้อมูลเดิมออกก่อน
    return response;
  }

  static List<StatusType> data = []; // ตัวแปรที่จะเรียกใช้งาน

  StatusType.fromJson(Map<String, dynamic> json) {
    id = json['Id'];
    statusType = json['StatusType'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['Id'] = this.id;
    data['StatusType'] = this.statusType;
    return data;
  }
}
