/*
 * @author lsy
 * @date   2019-10-14
 **/
import 'package:flutter/cupertino.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/commonModel/live/BaseModel.dart';
import 'package:gmalpha_flutter/commonModel/toast/toast.dart';
import 'package:gmalpha_flutter/userModel/service/UserRepository.dart';

class CommentModel extends BaseModel {
  String refer;

  CommentModel(this.refer) {}

  @override
  void dispose() {}

  void confirmClick(BuildContext context, String content, String phone) {
    RouterCenterImpl()
        .findBuriedRouter()
        ?.onEvent('click_comment_suggest', {'comment_id': '10086'});
    UserRepository.getInstance().commentSuggest(content, phone).listen((value) {
      Toast.show(context, "提交成功");
      Navigator.pop(context);
    }).onError((error) {
      Toast.show(context, "提交失败");
      Toast.debugShow(context, error.message);
      print(error.message);
    });
  }
}
