Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Add equals function to country code #187

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/country_code.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:collection/collection.dart' show IterableExtension;
import 'package:country_code_picker/country_codes.dart';
import 'package:country_code_picker/country_localizations.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/cupertino.dart';

mixin ToAlias {}
Expand All @@ -9,7 +10,7 @@ mixin ToAlias {}
class CElement = CountryCode with ToAlias;

/// Country element. This is the element that contains all the information
class CountryCode {
class CountryCode extends Equatable {
/// the name of the country
String? name;

Expand All @@ -29,6 +30,9 @@ class CountryCode {
this.dialCode,
});

@override
List<Object?> get props => [name, flagUri, code, dialCode];

@Deprecated('Use `fromCountryCode` instead.')
factory CountryCode.fromCode(String isoCode) {
return CountryCode.fromCountryCode(isoCode);
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:
modal_bottom_sheet: ^2.0.0
collection: ^1.15.0
universal_platform: ^1.0.0+1
equatable: ^2.0.3

flutter:
assets:
Expand Down