
import 'package:plugin_platform/engine/toast/toast_engine.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

import 'tenant_doc_state.dart';

part 'tenant_doc_view_model.g.dart';

@riverpod
class TenantDocViewModel extends _$TenantDocViewModel {

  @override
  TenantDocState build(){
    return const TenantDocState(docList: []);
  }

  //设置已选中的文件数组
  void setDocList(List<String> list){
    state = state.copyWith(docList: list);
  }

  //提交文件
  void submitDoc() {

    ToastEngine.show("请求接口上传文件：${state.docList}");
  }

  void setRemainingSpace(double remainingSpace) {
    state = state.copyWith(remainingSpace: remainingSpace);
  }

}
