yin_utils 0.0.6

  • Readme
  • Changelog
  • Installing
  • 60

yin_utils #


Getting Started #


  yin_utils: ^0.0.3


import 'package:yin_utils/yin_utils.dart';

字符串转 color

ColorUtil   :   getColorFromHex   


TextUtil    :   isEmpty             判断为空
TextUtil    :   isNotEmpty          判断非空
TextUtil    :   isArrayEmpty        判断数组为空
TextUtil    :   checkEqualText      检测字符并Toast


TsUtil      :   showShort
TsUtil      :   showCenterShort


JsonUtil    :   getInt           
JsonUtil    :   getString         
JsonUtil    :   getBool           
JsonUtil    :   getMap            
JsonUtil    :   getList           


NumberUtil  :   formatNum          
NumberUtil  :   formatNumString   
NumberUtil  :   formatNumDouble   


RegexUtil  :   isNumber   检测数字
RegexUtil  :   isLetter   检测字母
RegexUtil  :   isSymbol   检测符号
RegexUtil  :   isChina    检测中文


ScreenUtil : getScreenW         屏幕 宽
ScreenUtil : getScreenH         屏幕 高
ScreenUtil : getScreenDensity   屏幕 像素密度   
ScreenUtil : getStatusBarH      appBar 高
ScreenUtil : getBottomBarH      底部状态栏高度


初始化  SpUtil.getInstance()
SpUtil     : putObject
SpUtil     : putObjectList
SpUtil     : getObjectList
SpUtil     : getString
SpUtil     : putString
SpUtil     : getBool
SpUtil     : putBool
SpUtil     : getInt
SpUtil     : putInt
SpUtil     : getDouble
SpUtil     : putDouble
SpUtil     : getStringList
SpUtil     : putStringList
SpUtil     : getDynamic
SpUtil     : haveKey
SpUtil     : getKeys
SpUtil     : remove
SpUtil     : clear
SpUtil     : isInitialized      判断是否初始化


Sp         :    使用方式与SpUtil 一致,新增了一个 debug 与 online 环境       

[0.0.1] - TODO: Add release date.

  • TODO: Describe initial release.

Use this package as a library

1. Depend on it

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

  yin_utils: ^0.0.6

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support 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:yin_utils/yin_utils.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Format lib/com/yin/ColorUtil.dart.

Run flutter format to format lib/com/yin/ColorUtil.dart.

Format lib/com/yin/JosnUtil.dart.

Run flutter format to format lib/com/yin/JosnUtil.dart.

Format lib/com/yin/NumberUtil.dart.

Run flutter format to format lib/com/yin/NumberUtil.dart.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/com/yin/RegexUtil.dart (Run flutter format to format lib/com/yin/RegexUtil.dart.)
  • lib/com/yin/ScreenUtil.dart (Run flutter format to format lib/com/yin/ScreenUtil.dart.)
  • lib/com/yin/SpUtil.dart (Run flutter format to format lib/com/yin/SpUtil.dart.)
  • lib/yin_utils.dart (Run flutter format to format lib/yin_utils.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.

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 yin_utils.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
shared_preferences ^0.5.3+1 0.5.6+1
synchronized ^2.1.0 2.2.0
Transitive dependencies
collection 1.14.11 1.14.12
flutter_web_plugins 0.0.0
meta 1.1.8
shared_preferences_macos 0.0.1+4
shared_preferences_platform_interface 1.0.1
shared_preferences_web 0.1.2+3
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies