Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export country_model in intl_phone_number_input.dart #322

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Aerofluxx
Copy link

In order to be able to use countryComparator (see snippet below) with Specify type annotations always_specify_types in our lint rules, I have to use the import from import 'package:intl_phone_number_input/src/models/country_model.dart';

Importing a file like country_model.dart leads me to the next lint error.
Don't import implementation files from another package implementation_imports

 countryComparator: (Country a, Country b) {
    return a.nameTranslations!.entries
        .firstWhere((MapEntry<String, String> element) => element.key == context.locale.toString())
        .value
        .replaceFirst('Ö', 'OE')
        .replaceFirst('Ä', 'AE')
        .replaceFirst('Ü', 'UE')
        .compareTo(
          b.nameTranslations!.entries
              .firstWhere((MapEntry<String, String> element) => element.key == context.locale.toString())
              .value
              .replaceFirst('Ö', 'OE')
              .replaceFirst('Ä', 'AE')
              .replaceFirst('Ü', 'UE'),
        );
  },

So the solution (in my own experience, maybe there is already a better one?) would be, to add the country_model.dart in ..\intl_phone_number_input-0.7.0+2\lib\intl_phone_number_input.dart as an export.

library intl_phone_number_input;

export 'src/utils/phone_number.dart';
export 'src/widgets/input_widget.dart';
export 'src/utils/selector_config.dart';
export 'src/models/country_model.dart';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant