zh_char_converter 0.1.1+2

  • Readme
  • Changelog
  • Example
  • Installing
  • 58

A library use for:

Replace all zh_TW character to zh_CN character

Replace all zh_CN character to zh_TW character

(简体/繁體 字符互換)

Usage #

A simple usage example:

import 'package:zh_char_converter/zh_char_converter.dart';

main() {
  String cn = zhCN('两岸猿声啼不住,輕舟已過萬重山。 Li Bai,courtesy name Taibai.');
  print('zh_CN: $cn');
  String tw = zhTW('两岸猿声啼不住,輕舟已過萬重山。 Li Bai,courtesy name Taibai.');
  print('zh_TW: $tw');
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.1.1 #

  • First publish version, John Wang, Apr 22, 2019

0.1.0 #

  • Initial version, created by Stagehand

example/zh_char_converter_example.dart

import 'package:zh_char_converter/zh_char_converter.dart';

main() {
  String cn = zhCN('两岸猿声啼不住,輕舟已過萬重山。 Li Bai,courtesy name Taibai.');
  print('zh_CN: $cn');
  String tw = zhTW('两岸猿声啼不住,輕舟已過萬重山。 Li Bai,courtesy name Taibai.');
  print('zh_TW: $tw');
}

Use this package as a library

1. Depend on it

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


dependencies:
  zh_char_converter: ^0.1.1+2

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

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

  • Dart: 2.6.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Fix lib/zh_char_converter.dart. (-1.99 points)

Analysis of lib/zh_char_converter.dart reported 4 hints:

line 10 col 23: Unnecessary new keyword.

line 21 col 10: Unnecessary new keyword.

line 28 col 23: Unnecessary new keyword.

line 39 col 10: Unnecessary new keyword.

Maintenance issues and suggestions

The description contains too many non-ASCII characters. (-20 points)

The site uses English as its primary language. The value of the description field in your package's pubspec.yaml field should primarily contain characters used in English.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
pedantic ^1.0.0
test ^1.0.0