PlanCompareDetailModel.dart 1019 Bytes
Newer Older
朱璇's avatar
朱璇 committed
1 2 3 4
/*
 * @Author: zx 
 * @Date: 2020-06-30 17:43:13 
 * @Last Modified by: zx
朱璇's avatar
朱璇 committed
5
 * @Last Modified time: 2020-07-01 20:04:23
朱璇's avatar
朱璇 committed
6 7 8 9 10 11 12 13 14
 */
import 'package:flutter_common/commonModel/live/BaseModel.dart';
import 'package:flutter_common/commonModel/live/LiveData.dart';
import 'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart';
import 'package:gm_flutter/ClueModel/server/entity/PlanCompareDetail.dart';
import 'package:gm_flutter/commonModel/GMBase.dart';
import 'package:gm_flutter/commonModel/rx/RxDispose.dart';

class PlanCompareDetailModel extends BaseModel {
朱璇's avatar
朱璇 committed
15 16
  LiveData<PlanCompareDetail> detailLive = LiveData();
  RxDispose rxDispose = RxDispose();
朱璇's avatar
朱璇 committed
17

朱璇's avatar
朱璇 committed
18 19 20 21 22 23 24 25 26 27 28
  void init() {
    ClueApiImpl.getInstance()
        .getPlanCompareDetail(DioUtil.getInstance().getDio(), [1,2])
        .listen((event) {
          if (event.error == 0) {
            detailLive.notifyView(event);
          }
        })
        .addToDispose(rxDispose)
        .onError((err) {});
  }
朱璇's avatar
朱璇 committed
29 30
  @override
  void dispose() {
朱璇's avatar
朱璇 committed
31
    detailLive.dispost();
朱璇's avatar
朱璇 committed
32 33 34
  }

}