/*
 * @Author: XianKaiQun
 * @Date: 2020-07-29 09:05:00
 * @LastEditors: XianKaiQun
 * @LastEditTime: 2020-08-10 16:26:54
 * @Description: 
 */
import 'package:flutter/material.dart';
import 'package:qrcode_package/src/impl/clean_service_impl.dart';
import 'package:qrcode_package/src/models/clean_record.dart';

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

  String? get id => routingArgs['id'];

  CleanRecordModel? data;

  getData() async {
    final res = await CleanServiceImpl.instance!.getCleanDetail(id);
    data = res.data ?? CleanRecordModel();
    notifyListeners();
  }
}
