czech 1.0.0

czech #

Set of Czechia-specific Dart functions.

At this point - validation of frequently used values:

  • personal ID (rodné číslo)
  • company ID (IČ)
  • bank account (číslo účtu)

Usage #

A simple usage example:

import 'package:czech/czech.dart' as cz;

main() {

  // a.k.a Rodné číslo
  if (cz.isCzechPersonalIdNumber("780324/6543")) {
    print("Valid!");
  }

  // a.k.a. IČ
  if (cz.isCzechCompanyIdNumber("04626133")) {
    print("Valid!");
  }

  // a.k.a. Číslo účtu - with bank code by default
  if (cz.isCzechBankAccount("3033/2700")) {
    print("Valid!");
  }

  // a.k.a. Číslo účtu - without a bank code
  if (cz.isCzechBankAccount("3033", withBankCode: false)) {
    print("Valid!");
  }

}

Attributions #

Based on analysis by David Grudl: https://phpfashion.com/jak-overit-platne-ic-a-rodne-cislo

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Changelog #

1.0.0 #

  • upgrade to Dart2

0.1.1 #

  • Initial version, created by Stagehand
  • Czech validators

example/czech_example.dart

// Copyright (c) 2017, tomucha. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:czech/czech.dart' as cz;

main() {

  // a.k.a Rodné číslo
  if (cz.isCzechPersonalIdNumber("780324/6543")) {
    print("Valid!");
  }

  // a.k.a. IČ
  if (cz.isCzechCompanyIdNumber("04626133")) {
    print("Valid!");
  }

  // a.k.a. Číslo účtu - with bank code by default
  if (cz.isCzechBankAccount("3033/2700")) {
    print("Valid!");
  }

  // a.k.a. Číslo účtu - without a bank code
  if (cz.isCzechBankAccount("3033", withBankCode: false)) {
    print("Valid!");
  }

}

Use this package as a library

1. Depend on it

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


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

We analyzed this package on Jul 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:czech/czech.dart.

Health suggestions

Fix lib/src/czech_bank_account.dart. (-1.49 points)

Analysis of lib/src/czech_bank_account.dart reported 3 hints:

line 4 col 1: Prefer using /// for doc comments.

line 9 col 70: Use = to separate a named parameter from its default value.

line 65 col 1: Prefer using /// for doc comments.

Fix lib/src/czech_company_id.dart. (-1 points)

Analysis of lib/src/czech_company_id.dart reported 2 hints:

line 4 col 1: Prefer using /// for doc comments.

line 17 col 1: Prefer using /// for doc comments.

Fix lib/src/czech_personal_id.dart. (-1 points)

Analysis of lib/src/czech_personal_id.dart reported 2 hints:

line 4 col 1: Prefer using /// for doc comments.

line 37 col 1: Prefer using /// for doc comments.

Maintenance suggestions

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.0.0-dev.61.0 <3.0.0
Dev dependencies
test ^1.3.0

Admin