SimInfo class

SimInfo is a class that encapsulates information about a SIM card. The SimInfo class provides a factory constructor fromJson to create an instance from a JSON object. This is particularly useful when parsing JSON data received from an API.

The toString method is overridden to provide a string representation of the SimInfo object. This can be useful for debugging purposes.

The == operator is overridden to provide value equality. Two SimInfo objects are considered equal if all their properties are equal.

The hashCode getter is overridden to provide a hash code that is consistent with the == operator. This is important if you intend to use SimInfo objects as keys in a Map or insert them into a Set.

Constructors

SimInfo({required String carrierName, required String displayName, required String slotIndex, required String number, required String countryIso, required String countryPhonePrefix})
SimInfo.fromJson(Map<String, dynamic> json)
factory

Properties

carrierName String
carrierName : The name of the carrier.
final
countryIso String
  • countryIso : The ISO country code associated with the SIM card.
  • final
    countryPhonePrefix String
  • countryPhonePrefix : The phone prefix for the country of the SIM card.
  • final
    displayName String
  • displayName : The display name of the carrier.
  • final
    hashCode int
    The hash code for this object.
    no setteroverride
    number String
  • number : The phone number associated with the SIM card.
  • final
    runtimeType Type
    A representation of the runtime type of the object.
    no setterinherited
    slotIndex String
    slotIndex : The index of the SIM card slot.
    final

    Methods

    copyWith({String? carrierName, String? displayName, String? slotIndex, String? number, String? countryIso, String? countryPhonePrefix}) SimInfo
    noSuchMethod(Invocation invocation) → dynamic
    Invoked when a nonexistent method or property is accessed.
    inherited
    toJson() Map<String, dynamic>
    toString() String
    A string representation of this object.
    override

    Operators

    operator ==(Object other) bool
    The equality operator.
    override