import 'package:hmg_patient_app/core/enum/viewstate.dart';
import 'package:hmg_patient_app/core/service/termsConditionsService.dart';
import 'package:hmg_patient_app/core/viewModels/base_view_model.dart';

import '../../locator.dart';

class TermsConditionsViewModel extends BaseViewModel{

  TermsConditionsService _service = locator<TermsConditionsService>();

  String get userAgreementContent => _service.userAgreementContent;

  getUserTermsAndConditions() async {
    setState(ViewState.Busy);
    await _service.getUserTermsAndConditions();
    if (_service.hasError) {
      error = _service.error!;
      setState(ViewState.Error);
    } else {
      setState(ViewState.Idle);
    }
  }

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

}