

import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:injectable/injectable.dart';
import 'package:location/dialog/loading_dialog.dart';

import '../../../base/base_controller.dart';
import 'news_report_dialog.dart' show NewsReportDialog;

@injectable
class NewsReportController extends BaseController {


  ///用户的基本信息
  late TextEditingController reportContetnController;
  late String reportContentString;

  RxBool submitBuEnble = RxBool(false);

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    reportContetnController = TextEditingController(text:"");
    reportContentString = "";
  }

  @override
  void onReady() {
    super.onReady();
  }


  void back() {
    Get.back();
  }


  void inputContentText(String inpustr) {
    reportContentString = inpustr;
    onTextInputChange();
  }

  void onTextInputChange() {
    if (reportContentString.length > 3 && reportContentString.length < 500) {
       submitBuEnble.value = true;
     } else {
       submitBuEnble.value = false;
     }
  }

  void onSubmti() {
    FocusManager.instance.primaryFocus?.unfocus();
    CustomLoadingDialog.show();
    Future.delayed(Duration(seconds: 2), () {
      CustomLoadingDialog.hide();
      NewsReportDialog.show();
    });
  }

}