junny_utils library

Classes

Bidi
This provides utility methods for working with bidirectional text. All of the methods are static, and are organized into a class primarily to group them together for documentation and discoverability.
BidiFormatter
Bidi stands for Bi-directional text. According to Wikipedia: Bi-directional text is text containing text in both text directionalities, both right-to-left (RTL) and left-to-right (LTR). It generally involves text containing different types of alphabets, but may also refer to boustrophedon, which is changing text directionality in each row.
BoolList
A space-efficient list of boolean values.
CanonicalizedMap<C, K, V>
A map whose keys are converted to canonical values of type C.
CaseInsensitiveEquality
String equality that's insensitive to differences in ASCII case.
CombinedIterableView<T>
A view of several iterables combined sequentially into a single iterable.
CombinedListView<T>
A view of several lists combined into a single list.
CombinedMapView<K, V>
Returns a new map that represents maps flattened into a single map.
DateFormat
DateFormat is for formatting and parsing dates in a locale-sensitive manner.
DeepCollectionEquality
Deep equality on collections.
DefaultEquality<E>
Equality of objects that compares only the natural equality of the objects.
DelegatingIterable<E>
An Iterable that delegates all operations to a base iterable.
DelegatingList<E>
A List that delegates all operations to a base list.
DelegatingMap<K, V>
A Map that delegates all operations to a base map.
DelegatingQueue<E>
A Queue that delegates all operations to a base queue.
DelegatingSet<E>
A Set that delegates all operations to a base set.
DeviceUtils
设备相关的工具类,提供获取设备信息的方法
DirectoryUtils
文件夹相关的工具类,提供初始化存储目录等方法 在调用任何目录获取方法之前,必须先调用 init 方法进行初始化。
Equality<E>
A generic equality relation on objects.
EqualityBy<E, F>
Equality of objects based on derived values.
EqualityMap<K, V>
A Map whose key equality is determined by an Equality object.
EqualitySet<E>
A Set whose key equality is determined by an Equality object.
HapticUtil
HapticUtil 是一个震动反馈工具类,提供了不同类型的震动反馈功能, 用于向用户提供成功、警告和失败等通知类型的震动反馈。该类通过震动序列 和平台适配,简化了震动反馈的调用,提升了用户交互体验。
HeapPriorityQueue<E>
Heap based priority queue.
IdentityEquality<E>
Equality of objects that compares only the identity of the objects.
Intl
The Intl class provides a common entry point for internationalization related tasks. An Intl instance can be created for a particular locale and used to create a date format via anIntl.date(). Static methods on this class are also used in message formatting.
IterableEquality<E>
Equality on iterables.
IterableZip<T>
Iterable that iterates over lists of values from other iterables.
JunnyLogUtils
LogUtils 是一个日志工具类,用于记录和处理应用程序的运行日志。
JunnyPermissionUtils
权限工具类,用于处理应用的权限请求、检查、管理等功能。
ListEquality<E>
Equality on lists.
ListSlice<E>
A list view of a range of another list.
LogEvent
LogEvent 表示一次日志记录的事件对象,包含日志时间、标签、消息以及堆栈信息。
MapEquality<K, V>
Equality on maps.
MapKeySet<E>
An unmodifiable Set view of the keys of a Map.
MapValueSet<K, V>
Creates a modifiable Set view of the values of a Map.
MicroMoney
Used primarily for currency formatting, this number-like class stores millionths of a currency unit, typically as an Int64.
MultiEquality<E>
Combines several equalities into a single equality.
NonGrowableListMixin<E>
Mixin class that implements a throwing version of all list operations that change the List's length.
NonGrowableListView<E>
A fixed-length list.
NumberFormat
Provides the ability to format a number in a locale-specific way.
NumberParserBase<R>
PackageUtils
用于管理与包相关的信息,如版本、构建号和应用名称。此类还可以用于检查更新 以及处理版本相关的操作。
Permission
Defines the permissions which can be checked and requested.
PermissionWithService
A special kind of permission, used to access a service.
Pick
A picked object holding the value (may be null) and giving access to useful parsing functions
PriorityQueue<E>
A priority queue is a priority based work-list of elements.
QueueList<E>
A class that efficiently implements both Queue and List.
RequiredPick
A picked object holding the value (never null) and giving access to useful parsing functions
SelectedDataProvider<T>
管理已选择数据的类
SetEquality<E>
Equality of sets.
TextDirection
Represents directionality of text.
TextInputFormatterUtils
工具类,提供常用的文本输入格式化方法
UnionSet<E>
A single set that provides a view of the union over a set of sets.
UnionSetController<E>
A controller that exposes a view of the union of a collection of sets.
UnmodifiableListView<E>
An unmodifiable List view of another List.
UnmodifiableMapMixin<K, V>
Mixin class that implements a throwing version of all map operations that change the Map.
UnmodifiableMapView<K, V>
View of a Map that disallow modifying the map.
UnmodifiableSetMixin<E>
Mixin class that implements a throwing version of all set operations that change the Set.
UnmodifiableSetView<E>
An unmodifiable set.
UnorderedIterableEquality<E>
Equality of the elements of two iterables without considering order.

Enums

DatePattern
日期格式枚举,定义了多种日期格式。
JunnyLogLevel
日志级别枚举
PermissionStatus
Defines the state of a Permission.
PickDateFormat
The format of the to-be-parsed String that will be converted to DateTime
ServiceStatus
Defines the different states a service can be in.

Extensions

BoolPick on Pick
BuildContextExtension on BuildContext
扩展 BuildContext 的功能,提供便捷的方法访问常用的 Flutter 功能和上下文相关属性。
ColorExtension on Color
Color 类的扩展,为颜色提供透明度判断、MaterialColor生成、亮度调整等功能。
ComparatorExtension on Comparator<T>
Extensions on comparator functions.
DateExtension on String
String 类型提供扩展,处理日期相关的操作。
DateFormatExtension on DatePattern
DatePattern 提供一个扩展,允许将日期模式转换为 DateFormat
DateTimeExtension on DateTime
DateTime 类型提供扩展,增加日期格式化及时区转换等功能。
DoubleExtension on double
double 添加扩展方法。
EnumByName on Iterable<T>
为枚举集合 Iterable<T> 提供根据索引查找值的功能。
FuturePermissionStatusGetters on Future<PermissionStatus>
Utility getter extensions for the Future<PermissionStatus> type.
FutureServiceStatusGetters on Future<ServiceStatus>
Utility getter extensions for the Future<ServiceStatus> type.
HexColor on Color
扩展支持 HEX 格式的颜色转换,提供字符串到 Color 的互相转换功能。 来源: https://stackoverflow.com/a/50081214/10064463
IDCardExtension on String
身份证相关功能扩展
IntExtension on int
int 添加扩展方法。
IterableComparableExtension on Iterable<T>
Extensions that apply to iterables of Comparable elements.
IterableDoubleExtension on Iterable<double>
Extension on iterables of double.
IterableExtension on Iterable<T>
Extensions that apply to all iterables.
IterableIntegerExtension on Iterable<int>
Extension on iterables of integers.
IterableIterableExtension on Iterable<Iterable<T>>
Extensions on iterables whose elements are also iterables.
IterableNullableExtension on Iterable<T?>
Extensions that apply to iterables with a nullable element type.
IterableNumberExtension on Iterable<num>
Extensions that apply to iterables of numbers.
JsonParseExtension on Map<K, V>
Map 扩展,用于 JSON 解析
JunnyIterableExtension on Iterable<E>
Iterable 提供扩展方法,支持索引操作、数据筛选及递归查询功能。
JunnyListExtension on List<T>
List 提供扩展方法,支持分组、索引操作以及数据筛选等功能。
JunnyMapExtension on Map<K, V>
提供对 Map 的便捷扩展操作,包括键值替换、过滤、对比等功能。
Let on RequiredPick
ListComparableExtensions on List<E>
Various extensions on lists of comparable elements.
ListExtensions on List<E>
Various extensions on lists of arbitrary elements.
LongestCommonStringExtension on List<String>
为字符串列表提供扩展方法,用于查找最长公共字符串。
MediaQueryExtension on BuildContext
扩展 BuildContext,简化常用的屏幕尺寸、比例和安全区域的获取。
NullableDateTimePick on Pick
NullableDoublePick on Pick
NullableIntPick on Pick
NullableLet on Pick
NullableListPick on Pick
NullableMapPick on Pick
NullableStringExtension on String?
为可空字符串添加扩展方法。
NullableStringPick on Pick
NumExtension on T
num 添加扩展方法。
PermissionActions on Permission
Actions that can be executed on a permission.
PermissionCheckShortcuts on Permission
Shortcuts for checking the status of a Permission.
PermissionListActions on List<Permission>
Actions that can be taken on a List of Permissions.
PermissionStatusGetters on PermissionStatus
Utility getter extensions for the PermissionStatus type.
RequiredStringPick on RequiredPick
SafeSetStateExtension on State<StatefulWidget>
State 添加安全扩展方法。
ScopedFunctionExtension on T
为任何对象提供函数式扩展方法。
ServicePermissionActions on PermissionWithService
Actions that apply only to permissions that have an associated service.
ServiceStatusGetters on ServiceStatus
Utility getter extensions for the ServiceStatus type.
StringExtension on String
String 添加扩展方法。

Constants

yearQuarterRegex → const String
年季度的正则表达式,用于匹配 "yyyyQQ" 格式的字符串。

Functions

asType<T>(dynamic data, [dynamic key0, dynamic key1, dynamic key2, dynamic key3, dynamic key4, dynamic key5, dynamic key6, dynamic key7, dynamic key8, dynamic key9]) → T
解析基础数据类型
asTypeList<T>(dynamic data, [dynamic key0, dynamic key1, dynamic key2, dynamic key3, dynamic key4, dynamic key5, dynamic key6, dynamic key7, dynamic key8, dynamic key9]) List<T>
解析列表类型数据
binarySearch<E>(List<E> sortedList, E value, {int compare(E, E)?}) int
Returns a position of the value in sortedList, if it is there.
compareAsciiLowerCase(String a, String b) int
Compares a and b lexically, converting ASCII letters to lower case.
compareAsciiLowerCaseNatural(String a, String b) int
Compares strings a and b according to lower-case natural sort ordering.
compareAsciiUpperCase(String a, String b) int
Compares a and b lexically, converting ASCII letters to upper case.
compareAsciiUpperCaseNatural(String a, String b) int
Compares strings a and b according to upper-case natural sort ordering.
compareNatural(String a, String b) int
Compares strings a and b according to natural sort ordering.
equalsIgnoreAsciiCase(String a, String b) bool
Checks if strings a and b differ only on the case of ASCII letters.
groupBy<S, T>(Iterable<S> values, T key(S)) Map<T, List<S>>
Groups the elements in values by the value returned by key.
hashIgnoreAsciiCase(String string) int
Hash code for a string which is compatible with equalsIgnoreAsciiCase.
insertionSort<E>(List<E> elements, {int compare(E, E)?, int start = 0, int? end}) → void
Sort a list between start (inclusive) and end (exclusive) using insertion sort.
isDynamicEmpty(dynamic data) bool
判断动态类型是否为空。
lastBy<S, T>(Iterable<S> values, T key(S)) Map<T, S>
Associates the elements in values by the value returned by key.
lowerBound<E>(List<E> sortedList, E value, {int compare(E, E)?}) int
Returns the first position in sortedList that does not compare less than value.
mapMap<K1, V1, K2, V2>(Map<K1, V1> map, {K2 key(K1, V1)?, V2 value(K1, V1)?}) Map<K2, V2>
Creates a new map from map with new keys and values.
maxBy<S, T>(Iterable<S> values, T orderBy(S), {int compare(T, T)?}) → S?
Returns the element of values for which orderBy returns the maximum value.
mergeMaps<K, V>(Map<K, V> map1, Map<K, V> map2, {V value(V, V)?}) Map<K, V>
Returns a new map with all key/value pairs in both map1 and map2.
mergeSort<E>(List<E> elements, {int start = 0, int? end, int compare(E, E)?}) → void
Sorts a list between start (inclusive) and end (exclusive) using the merge sort algorithm.
minBy<S, T>(Iterable<S> values, T orderBy(S), {int compare(T, T)?}) → S?
Returns the element of values for which orderBy returns the minimum value.
openAppSettings() Future<bool>
Opens the app settings page.
pick(dynamic json, [Object? arg0, Object? arg1, Object? arg2, Object? arg3, Object? arg4, Object? arg5, Object? arg6, Object? arg7, Object? arg8, Object? arg9]) Pick
Picks the value of a json-like dart data structure consisting of Maps, Lists and objects at location arg0, arg1 ... arg9
pickDeep(dynamic json, List<Object> selector) Pick
Picks the value of json by traversing the object along the values in selector one by one
pickFromJson(String json, [Object? arg0, Object? arg1, Object? arg2, Object? arg3, Object? arg4, Object? arg5, Object? arg6, Object? arg7, Object? arg8, Object? arg9]) Pick
Picks a values from a json String at location arg0, arg1...
reverse<E>(List<E> elements, [int start = 0, int? end]) → void
Reverses a list, or a part of a list, in-place.
run<ReturnType>(ReturnType operation()) → ReturnType
执行指定的操作并返回其结果。
shuffle(List elements, [int start = 0, int? end, Random? random]) → void
Shuffles a list randomly.
stronglyConnectedComponents<T>(Map<T, Iterable<T>> graph) List<Set<T>>
Returns the strongly connected components of graph, in topological order.
toBeginningOfSentenceCase<T extends String?>(T input, [String? locale]) → T
Convert a string to beginning of sentence case, in a way appropriate to the locale.
transitiveClosure<T>(Map<T, Iterable<T>> graph) Map<T, Set<T>>
Returns the transitive closure of graph.
typeOf<T>() Type
获取泛型 T 的实际类型。

Exceptions / Errors

PickException