utils/common/index library
Classes
- AsciiCodec
- An AsciiCodec allows encoding strings as ASCII bytes and decoding ASCII bytes to strings.
- AsciiDecoder
- Converts ASCII bytes to string.
- AsciiEncoder
- Converts strings of only ASCII characters to bytes.
- Base64Codec
- A base64 encoder and decoder.
- Base64Decoder
- Decoder for base64 encoded data.
- Base64Encoder
- Base64 and base64url encoding converter.
- ByteConversionSink
- The ByteConversionSink provides an interface for converters to efficiently transmit byte data.
- ChineseHelper
- Chinese Helper.
-
ChunkedConversionSink<
T> - A ChunkedConversionSink is used to transmit data more efficiently between two converters during chunked conversions.
- CityModel
- ClosableStringSink
-
A ClosableStringSink extends the StringSink interface by adding a
close
method. -
Codec<
S, T> - A Codec encodes and (if supported) decodes data.
- Colours
-
Converter<
S, T> - A Converter converts data from one representation into another.
- DateFormats
- 一些常用格式参照。可以自定义格式,例如:'yyyy/MM/dd HH:mm:ss','yyyy/M/d HH:mm:ss'。 格式要求 year -> yyyy/yy month -> MM/M day -> dd/d hour -> HH/H minute -> mm/m second -> ss/s
- DateUtil
- Date Util.
- Encoding
- Open-ended set of encodings.
- EncryptUtil
- Encrypt Util.
- EnInfo
- EnNormalInfo
- HtmlEscape
- Converter which escapes characters with special meaning in HTML.
- HtmlEscapeMode
- HTML escape modes.
- JsonCodec
- A JsonCodec encodes JSON objects to strings and decodes strings to JSON objects.
- JsonDecoder
- This class parses JSON strings and builds the corresponding objects.
- JsonEncoder
- This class converts JSON objects to strings.
- JsonUtf8Encoder
- Encoder that encodes a single object as a UTF-8 encoded JSON string.
- JsonUtil
- Json Util.
- Latin1Codec
- A Latin1Codec encodes strings to ISO Latin-1 (aka ISO-8859-1) bytes and decodes Latin-1 bytes to strings.
- Latin1Decoder
- This class converts Latin-1 bytes (lists of unsigned 8-bit integers) to a string.
- Latin1Encoder
- This class converts strings of only ISO Latin-1 characters to bytes.
- LineSplitter
- A StreamTransformer that splits a String into individual lines.
- LogUtil
- Log Util.
- MoneyUtil
- Money Util.
- MultiPinyin
- 多音字
- NumUtil
- Num Util.
- ObjectUtil
- Object Util.
- PinyinHelper
- 汉字转拼音类.
- PinyinResource
- Pinyin Resource.
- RegexUtil
- Regex Util.
- StringConversionSink
- A sink for converters to efficiently transmit String data.
- TextUtil
- Text Util.
- TimelineInfo
- Timeline information configuration. Timeline信息配置.
- TimelineUtil
- TimelineUtil
- TimerUtil
- TimerUtil.
- Utf8Codec
- A Utf8Codec encodes strings to utf-8 code units (bytes) and decodes UTF-8 code units to strings.
- Utf8Decoder
- This class converts UTF-8 code units (lists of unsigned 8-bit integers) to a string.
- Utf8Encoder
- This class converts strings to their UTF-8 code units (a list of unsigned 8-bit integers).
- Utils
- ZhInfo
- ZhNormalInfo
Enums
- DayFormat
- (xx)Configurable output. (xx)为可配置输出.
- MoneyFormat
- MoneyUnit
- PinyinFormat
- 拼音格式: WITHOUT_TONE--不带声调 WITH_TONE_MARK--带声调 WITH_TONE_NUMBER--数字代表声调
Constants
- ascii → const AsciiCodec
- An instance of the default implementation of the AsciiCodec.
- base64 → const Base64Codec
- A base64 encoder and decoder.
- base64Url → const Base64Codec
- A base64url encoder and decoder.
-
chineseDict
→ const List<
String> - htmlEscape → const HtmlEscape
-
A
String
converter that converts characters to HTML entities. - json → const JsonCodec
- An instance of the default implementation of the JsonCodec.
- latin1 → const Latin1Codec
- An instance of the default implementation of the Latin1Codec.
-
multiPinyinDict
→ const List<
String> -
pinyinDict
→ const List<
String> - unicodeBomCharacterRune → const int
-
The Unicode Byte Order Marker (BOM) character
U+FEFF
. - unicodeReplacementCharacterRune → const int
-
The Unicode Replacement character
U+FFFD
(�). - utf8 → const Utf8Codec
- An instance of the default implementation of the Utf8Codec.
Properties
Functions
-
base64Decode(
String source) → Uint8List - Decodes base64 or base64url encoded bytes.
-
base64Encode(
List< int> bytes) → String -
Encodes
bytes
using base64 encoding. -
base64UrlEncode(
List< int> bytes) → String -
Encodes
bytes
using base64url encoding. -
blackLinearGradient(
{dynamic colorsList}) → dynamic - 线性渐变
-
blackLinearGradientRight(
{dynamic colorsList}) → dynamic - 线性渐变
-
bottomBoxShadow(
BuildContext context) → BoxDecoration? - 底部阴影
-
cachedImage(
String url, {double? width, double? height}) → Widget - 带缓存的image
-
hiSpace(
{double height = 1, double width = 1}) → dynamic -
jsonDecode(
String source, {Object? reviver(Object? key, Object? value)?}) → dynamic - Parses the string and returns the resulting Json object.
-
jsonEncode(
Object? object, {Object? toEncodable(Object? nonEncodable)?}) → String -
Converts
object
to a JSON string. -
setLocaleInfo(
String locale, TimelineInfo timelineInfo) → void - add custom configuration.
Typedefs
- ByteConversionSinkBase = ByteConversionSink
- This class provides a base-class for converters that need to accept byte inputs.
- OnTimerTickCallback = void Function(int millisUntilFinished)
- timer callback.(millisUntilFinished 毫秒).
- StringConversionSinkBase = StringConversionSink
- This class provides a base-class for converters that need to accept String inputs.
- StringConversionSinkMixin = StringConversionSink
- This class provides a mixin for converters that need to accept String inputs.
Exceptions / Errors
- JsonCyclicError
- Reports that an object could not be stringified due to cyclic references.
- JsonUnsupportedObjectError
- Error thrown by JSON serialization if an object cannot be serialized.
- PinyinException
- Pinyin Exception.