nholiday_jp 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • new67

日本の祝日

Usage #

A simple usage example:

import 'package:nholiday_jp/nholiday_jp.dart';

main() {
  // 2019年1月1日が祝日ならその名称を取得
  var name = NHolidayJp.getName(2019, 1, 1); // 元日

  // 2019年1月の祝日一覧
  var holidaysOfMonth = NHolidayJp.getByMonth(2019, 1);
  // holidaysOfMonth[0].toString() => '1/1 元日'
  // holidaysOfMonth[1].toString() => '1/14 成人の日'

  // 2019年の祝日一覧
  var holidaysOfYear = NHolidayJp.getByYear(2019);
  // holidaysOfYear[0].toString() => '1/1 元日'
  // holidaysOfYear[1].toString() => '1/14 成人の日'
  // ...
  // ...
  // holidaysOfYear[20].toString() => 11/4 振替休日
  // holidaysOfYear[21].toString() => 11/23 勤労感謝の日
}

1.0.0 #

  • Initial version, created by Stagehand

example/nholiday_jp_example.dart

import 'package:nholiday_jp/nholiday_jp.dart';

main() {
  var name = NHolidayJp.getName(2019, 1, 1);
  print('1月1日: ${name}');
}

Use this package as a library

1. Depend on it

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


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

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

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

Format lib/src/nholiday_jp_base.dart.

Run dartfmt to format lib/src/nholiday_jp_base.dart.

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.5.0 <3.0.0
Dev dependencies
pedantic ^1.8.0
test ^1.6.0