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

class FavoritesPageNotifier with ChangeNotifier {
  /// 是否是编辑中
  bool isEditing = false;

  /// 搜索关键字
  String keyword;

  int selectIndex = 0;

  /// 用于区分是编辑还是搜索
  bool editingTypeTag = true;

  /// 用于区分是否修改
  // int changeVal = 0;

  /// 选中的下标
  void changeSelectIndex(int index){
    this.selectIndex = index;
    // ++changeVal;
    notifyListeners();
  }

  /// 编辑
  void editing() {
    this.editingTypeTag = true;
    this.isEditing = !isEditing;
    // ++changeVal;
    notifyListeners();
  }

  /// 搜索
  void search(String keyword) {
    // if (!EmptyUtil.isEmpty(keyword)) {
      this.editingTypeTag = false;
      this.keyword = keyword;
      // ++changeVal;
      notifyListeners();
    // }
  }

}
