part of user_feedback;

/// 提交意见反馈
class UserFeedbackController extends GetxController {
  late TextEditingController searchController = TextEditingController();
  // 按钮是否可用
  bool  _enable = false;
  bool get enable => _enable;

  /// 提交意见反馈
  Future<bool> upFeedback() async {
    final result = await MineAPI.feedback(searchController.text);
    if (result) {
      Toast.show('提交成功');
      update();
    }
    return result;
  }

  void setCanClick(){
    if (searchController.text.isNotEmpty){
      _enable = true;
    }
    else{
      _enable = false;
    }
    update();
  }
}
