nanc_tools
library
Classes
Bench
BoolList
A space-efficient list of boolean values.
BrowserConfiguration
Additional configuration options for LaunchMode.inAppBrowserView
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.
DbAdapter <T >
DbService
Debouncer
DeepCollectionEquality
Deep equality on collections.
DefaultEquality <E >
Equality of objects that compares only the natural equality of the objects.
Delayer
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.
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.
EventBus
EventBusRequest <T >
EventBusResponse <T >
HeapPriorityQueue <E >
Heap based priority queue.
IdentityEquality <E >
Equality of objects that compares only the identity of the objects.
IterableEquality <E >
Equality on iterables.
IterableZip <T >
Iterable that iterates over lists of values from other iterables.
ListEquality <E >
Equality on lists.
ListSlice <E >
A list view of a range of another list.
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 .
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.
PackageInfo
Application metadata. Provides application bundle information on iOS and
application package information on Android.
PriorityQueue <E >
A priority queue is a priority based work-list of elements.
QueueList <E >
A class that efficiently implements both Queue and List .
SetEquality <E >
Equality of sets.
Ulid
Lexicographically sortable, 128-bit identifier (UUID) with 48-bit timestamp
and 80 random bits. Canonically encoded as a 26 character string, as opposed
to the 36 character UUID.
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.
WebViewConfiguration
Additional configuration options for LaunchMode.inAppWebView .
Functions
binarySearch <E > (List <E > sortedList , E value , {int compare (E , E )? })
→ int
Returns a position of the value
in sortedList
, if it is there.
boolFromJson (dynamic value )
→ bool
canLaunch (String urlString )
→ Future <bool >
Checks whether the specified URL can be handled by some app installed on the
device.
canLaunchUrl (Uri url )
→ Future <bool >
Checks whether the specified URL can be handled by some app installed on the
device.
capitalize (String value )
→ String
cast <T > (dynamic value )
→ T
castToJson (dynamic json )
→ Json
castToJsonOr <T > (dynamic json , CastingFallback <T > fallback )
→ T
clone (Json json )
→ Json
closeInAppWebView ()
→ Future <void >
Closes the current in-app web view, if one was previously opened by
launchUrl .
closeWebView ()
→ Future <void >
Closes the current WebView, if one was previously opened via a call to launch .
colorFromHex (String inputString , {bool enableAlpha = true })
→ Color ?
colorToHex (Color color , {bool includeHashSign = false , bool enableAlpha = true , bool toUpperCase = true })
→ String
colorToJson (Color ? color )
→ String ?
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 .
copyTextToClipboard (String ? value )
→ Future <bool >
createDbService ()
→ DbService
decodeFromBase64 (String value )
→ String
decrypt (String value , {String ? salt })
→ Future <String >
decryptSync (String value , {String ? salt })
→ String
deepClone <T > (T json )
→ T
delayed <T > (ValueGetter <T > callback )
→ ValueGetter <Future <T > >
detailedDoubleFromString (String ? value )
→ (double ? , NumberParsingErrorType ? , String ? )
detailedIntFromString (String ? value )
→ (int ? , NumberParsingErrorType ? , String ? )
doSomethingWhen <T > ({required Action <T > action , required Condition condition , required Duration interval , int maxTries = 100 })
→ Future <T? >
encodeToBase64 (String value )
→ String
encrypt (String value , {String ? salt })
→ Future <String >
encryptSync (String value , {String ? salt })
→ String
equalsIgnoreAsciiCase (String a , String b )
→ bool
Checks if strings a
and b
differ only on the case of ASCII letters.
generateEventHash ()
→ String
getAppInfo ()
→ Future <PackageInfo >
groupBy <S , T > (Iterable <S > values , T key (S ) )
→ Map <T , List <S > >
Groups the elements in values
by the value returned by key
.
groupOfValidators (List <FormFieldValidator <String > > validators )
→ FormFieldValidator <String >
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.
isEmpty (dynamic value )
→ bool
isRequiredValidator (String ? value )
→ String ?
isTheSame (dynamic value1 , dynamic value2 )
→ bool
lastBy <S , T > (Iterable <S > values , T key (S ) )
→ Map <T , S >
Associates the elements in values
by the value returned by key
.
launch (String urlString , {bool ? forceSafariVC , bool forceWebView = false , bool enableJavaScript = false , bool enableDomStorage = false , bool universalLinksOnly = false , Brightness ? statusBarBrightness , String ? webOnlyWindowName })
→ Future <bool >
Parses the specified URL string and delegates handling of it to the
underlying platform.
launchUrl (Uri url , {LaunchMode mode = LaunchMode.platformDefault , WebViewConfiguration webViewConfiguration = const WebViewConfiguration() , BrowserConfiguration browserConfiguration = const BrowserConfiguration() , String ? webOnlyWindowName })
→ Future <bool >
Passes url
to the underlying platform for handling.
logError (Object ? message , {Object ? error , StackTrace ? stackTrace })
→ void
logInfo (Object ? message , {Object ? error , StackTrace ? stackTrace })
→ void
logWarning (Object ? message , {Object ? error , StackTrace ? stackTrace })
→ void
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.
nullableBoolFromJson (dynamic value )
→ bool ?
nullableColorFromJson (String ? color )
→ Color ?
nullableDoubleFromJson (dynamic value )
→ double ?
nullableIntFromJson (dynamic value )
→ int ?
nullableValidatorFromJson (dynamic code )
→ String ?
parseMarkup (String markup )
→ Document
prettyJson (dynamic data , {String indent = ' ' })
→ String
randomError ([String ? text ])
→ void
randomIntBetween ({required int min , required int max })
→ int
reverse <E > (List <E > elements , [int start = 0 , int ? end ])
→ void
Reverses a list, or a part of a list, in-place.
shuffle (List elements , [int start = 0 , int ? end , Random ? random ])
→ void
Shuffles a list randomly.
splitTextByLines (String text )
→ List <String >
stronglyConnectedComponents <T > (Map <T , Iterable <T > > graph )
→ List <Set <T > >
Returns the strongly connected components of graph
, in topological
order.
supportsCloseForLaunchMode (LaunchMode mode )
→ Future <bool >
Returns true if closeInAppWebView is supported for mode
in the current
platform implementation.
supportsLaunchMode (LaunchMode mode )
→ Future <bool >
Returns true if mode
is supported by the current platform implementation.
toNullJson (dynamic value )
→ Null
toSnakeCase (String value )
→ String
transitiveClosure <T > (Map <T , Iterable <T > > graph )
→ Map <T , Set <T > >
Returns the transitive closure of graph
.
unzip (String archive )
→ String
validatorToJson (dynamic value )
→ String ?
wait ({Duration duration = const Duration(milliseconds: 4) , int period = 250 , bool periodic = false })
→ FutureOr <void >
zip (String data )
→ String