/*
 * @Author: XianKaiQun
 * @Date: 2020-07-29 11:51:10
 * @LastEditors: XianKaiQun
 * @LastEditTime: 2020-08-03 15:55:16
 * @Description: 
 */
import 'package:flutter/material.dart';
import 'package:qrcode_package/src/impl/repair_service_impl.dart';
import 'package:qrcode_package/src/models/repair_equipment_record.dart';

class PrivateRepairDetailItemStore with ChangeNotifier {
  final BuildContext context, providerContext;
  late Map<String, dynamic> routingArgs;
  PrivateRepairDetailItemStore(this.context, this.providerContext) {
    routingArgs = (ModalRoute.of(context)?.settings.arguments ??
            new Map<String, dynamic>()) as Map<String, dynamic>? ??
        {};
  }
  String? get id => routingArgs['id'];

  RepairEquipmentRecordModel? data;

  Future getData() async {
    final res = await RepairServiceImpl.instance!.getEquipmentRecord(id);
    data = res.data ?? RepairEquipmentRecordModel();
    notifyListeners();
  }
}
