import 'package:flutter/material.dart';
import 'package:zhiying_comm/util/log/let_log.dart';

class TeamPageNotifier with ChangeNotifier {
  /// taBar选中的index
  int tabSelectIndex = 0;
  bool isSearch = false;
  String keyword;

  /// 筛选的条件
  Map<String, String> reqArgs = {};

  /// 更新筛选条件
  void updateSortCondition(String key, String args) {
    this.isSearch = false;
    this.reqArgs[key] = args;
    notifyListeners();
  }

  /// 重置
  void searchReset(String keyword) {
    this.isSearch = true;
    this.keyword = keyword;
    this.reqArgs.clear();
    notifyListeners();
  }

  /// 更新选中Index
  void updateTabIndex(int index) {
    isSearch = false;
    this.tabSelectIndex = index;
  }

  /// 获取筛选条件
  Map<String, String> getReqArgs() {
    return this.reqArgs;
  }

  /// 获取当前选中的Tab下标
  int getTabIndex() {
    return this.tabSelectIndex;
  }

  /// 获取搜索关键字
  String getKeyword(){
    return this.keyword;
  }
  /// 获取是否是搜索方式
  bool getSearch() {
    return this.isSearch;
  }
}
