import 'package:flutter/cupertino.dart';

import '../google-analytics.dart';

class LoginRegistration{

  final GALogger logger;
  LoginRegistration(this.logger);
  // R004.1
  login_register_initiate(){
    logger('login_register_initiate');
  }

  // R005.1
  visited_alhabib_group(bool value){
    // selection_type: yes/no
    logger('visited_alhabib_group', parameters: {
      'selection_type' : value ? 'yes' : 'no'
    });
  }

  // R006.1, R007.1, R008.1, R009.1
  registration_cancel({@required String step}){
    // registration_step : enter details
    // registration_step : personal info
    // registration_step : patient info
    // fourth (verification)
    logger('registration_cancel', parameters: {
      'registration_step' : step
    });
  }

  // R006.2
  registration_enter_details(){
    logger('registration_enter_details');
  }

  // R007.2
  registration_personal_info(){
    logger('registration_personal_info');
  }

  // R008.2
  registration_patient_info(){
    logger('registration_patient_info');
  }

  // R009.2
  registration_verification_option(){
    logger('registration_verification_option');
  }

  // R010:registration_confirmation
  registration_confirmation({@required String by}){
    // verification_method: by
    logger('registration_confirmation', parameters: {
      'verification_method' : by
    });
  }

  // R011.1
  login_start({@required String method}){
    logger('login_start', parameters: {
      'login_method' : method
    });
  }

  // R011:login_verify_otp |  R009:registration_verification_option
  verify_otp_method({@required int method, bool forRegistration = false}){
    var verification_method = '';
    if(method == 1) verification_method = 'sms';
    if(method == 2) verification_method = 'fingerprint';
    if(method == 3) verification_method = 'face id';
    if(method == 4) verification_method = 'whatsapp';

    if(forRegistration == false)
      logger("login_verify_otp", parameters: {
        'login_method' : verification_method
      });
    else
      logger("registration_verification_option", parameters: {
        'verification_method' : verification_method
      });
  }

  // R011.2
  forget_file_number(){
    logger('forget_file_number');
  }

  // R011.3
  register_now(){
    logger('register_now');
  }

  // R012.1, R014.1
  login_successful({@required int method}){
    var verification_method = '';
    if(method == 1) verification_method = 'sms';
    if(method == 2) verification_method = 'fingerprint';
    if(method == 3) verification_method = 'face id';
    if(method == 4) verification_method = 'whatsapp';
    logger('login_successful', parameters: {
      'login_method' : verification_method
    });
  }

  // R012.4
  login_unsuccessful({@required String method, error}){
    logger('login_unsuccessful', parameters: {
      'login_method' : method
    });
  }

  // R013
  recover_file_number(){
    logger('recover_file_number');
  }

  // R014.2
  login_with_other_account(){
    logger('login_with_other_account');
  }
}