yin_utils 0.0.4

yin_utils #

这是一个满足自己需求的第三方包,发布成第三方包是为了使用方便

Getting Started #

引用库

dependencies:
  yin_utils: ^0.0.3

引用包

import 'package:yin_utils/yin_utils.dart';

字符串转 color

ColorUtil   :   getColorFromHex   

字符串

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

Toast

TsUtil      :   showShort
TsUtil      :   showCenterShort


获取json对象

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      底部状态栏高度

内容存储1

初始化  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      判断是否初始化

内容存储2

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:


dependencies:
  yin_utils: ^0.0.4

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

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

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
flutter_toast_pk ^0.0.1 0.0.1
shared_preferences ^0.5.3+1 0.5.3+4
synchronized ^2.1.0 2.1.0+1
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test

Admin