flutter_localized_countries 1.0.0

  • Readme
  • Changelog
  • Installing
  • 41

flutter_localized_countries #

Country code to name mappings for 122 languages.

This is a port of an npm package localized-countries for Flutter.

Data is taken from https://github.com/umpirsky/country-list.

This package bundles required assets and provides custom LocalizationsDelegate for loading them.

Usage #

import 'package:flutter_localized_countries/flutter_localized_countries.dart';

void main() {
  runApp(MaterialApp(
    localizationsDelegates: [
      CountryNamesLocalizationsDelegate(),
      // ... more localization delegates
      GlobalMaterialLocalizations.delegate,
      GlobalWidgetsLocalizations.delegate,
    ],
    ...
  );
  
  ...
  
  print(CountryNames.of(context).nameOf('NL'));
}

Known Bugs #

[1.0.0] #

  • Initial release

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_localized_countries: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_localized_countries/flutter_localized_countries.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
67
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
37
Overall:
Weighted score of the above. [more]
41
Learn more about scoring.

We analyzed this package on Mar 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running flutter pub upgrade failed with the following output:

ERR: Because flutter_localized_countries depends on flutter_localizations any from sdk which depends on intl 0.16.0, intl 0.16.0 is required.
 So, because flutter_localized_countries depends on intl ^0.15.7, version solving failed.

Health suggestions

Format lib/flutter_localized_countries.dart.

Run flutter format to format lib/flutter_localized_countries.dart.

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

Package is getting outdated. (-13.97 points)

The package was last published 59 weeks ago.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and flutter_localized_countries.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

The package description is too short. (-9 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0