mirrored_repositories/pokedex/lib/features/home/data
import 'package:flutter/foundation.dart';

///[PokemonType] is a model class that defines the types of a pokemon
///details
@immutable
class PokemonType {
  const PokemonType({
    required this.name,
    required this.url,
  });

  factory PokemonType.fromJson(Map<String, dynamic> json) => PokemonType(
        name: json['name'] as String,
        url: json['url'] as String,
      );

  final String? name;
  final String? url;

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is PokemonType &&
          other.runtimeType == runtimeType &&
          other.name == name &&
          other.url == url;

  @override
  int get hashCode => name.hashCode ^ url.hashCode;
}
