light_country_picker 0.1.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 33

light_country_picker #

Country Picker with Currency

Getting Started #

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

[0.0.1] - RELEASE #

[0.0.2] - RELEASE #

[0.0.3] - RELEASE #

[0.0.4] - RELEASE #

[0.0.5] - RELEASE #

[0.0.6] - RELEASE #

[0.0.7] - RELEASE #

[0.0.8] - RELEASE #

[0.0.9] - RELEASE #

[0.1.0] - RELEASE #

[0.1.1] - RELEASE #

[0.1.2] - RELEASE #

[0.1.3] - RELEASE #

[0.1.4] - RELEASE #

  • TODO: Describe initial release.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:light_country_picker/light_country_picker.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Country Picker Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  var _selected;

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: Text('Flutter Country Picker Demo'),
      ),
      body:  Column(
        children: [
          CountryPicker(
            showDialingCode: true,
            onChanged: (country){
              debugPrint(country.toString());
            },
          ),
          CountryPicker(
            showDialingCode: false,
            showCurrencyISO: true,
            onChanged: (country){
              debugPrint(country.currency.symbol);
            },
          ),
        ]
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  light_country_picker: ^0.1.4

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:light_country_picker/light_country_picker.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
30
Health:
Code health derived from static analysis. [more]
18
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
60
Overall:
Weighted score of the above. [more]
33
Learn more about scoring.

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

  • Dart: 2.8.2
  • pana: 0.13.8-dev
  • Flutter: 1.17.1

Health issues and suggestions

Fix lib/light_country_picker.dart. (-82.29 points)

Analysis of lib/light_country_picker.dart failed with 6 errors, 1 hint, including:

line 91 col 11: This requires the 'control-flow-collections' experiment to be enabled.

line 99 col 11: This requires the 'control-flow-collections' experiment to be enabled.

line 105 col 11: This requires the 'control-flow-collections' experiment to be enabled.

line 111 col 11: This requires the 'control-flow-collections' experiment to be enabled.

line 117 col 11: This requires the 'control-flow-collections' experiment to be enabled.

Format lib/country_entity.dart.

Run flutter format to format lib/country_entity.dart.

Format lib/currency.dart.

Run flutter format to format lib/currency.dart.

Maintenance issues and suggestions

No valid SDK. (-20 points)

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

The package description is too short. (-20 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.1.0 <3.0.0
diacritic ^0.1.1 0.1.1
flutter 0.0.0
Transitive dependencies
collection 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test