queen
library
Functions
bootLaunchers (List <Launcher > launchers )
→ Future <void >
boots series launchers
then boots all parallel launchers
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.
capitalizeFirstChar (String str )
→ String
takes foo
return Foo
takes foo bar
return Foo bar
capitalizeFirstCharForEachWord (String str )
→ String
takes foo
return Foo
takes foo bar
return Foo Bar
takes foo bar zee
return Foo Bar Zee
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 .
containsAny (String v , List <String > list , {bool caseSensitive = false , bool trim = true })
→ bool
convertToArabicNumbers (String str )
→ String
arabic numbers are 0123456789
convert numbers to arabic format
0123456789
becomes ٠١٢٣٤٥٦٧٨٩
convertToHindiNumbers (String str )
→ String
arabic numbers are ٠١٢٣٤٥٦٧٨٩
eightSeconds ()
→ Future <void >
instead of await Future.delayed(const Duration(seconds:8));
find <T > ({String ? tag })
→ T
findInMap (String path , Map <Object ? , Object ? > map , {String splitOperator = '.' })
→ Object ?
can dig deeper into the Map
if the key is not nested return the value
if the key is not nested go deep until find the value
fiveSeconds ()
→ Future <void >
instead of await Future.delayed(const Duration(seconds:5));
flatMapKeys (Map <String , Object ? > map )
→ List <String >
takes a Map and return the flat keys to the map
Example
map :
forSeconds <T > (int seconds )
→ Future <T >
instead of await Future.delayed(const Duration(seconds:1));
do await forSeconds(x)
fourSeconds ()
→ Future <void >
instead of await Future.delayed(const Duration(seconds:4));
isArabicNum (String input )
→ bool
isBool (Object ? input )
→ bool
isDate (String ? v )
→ bool
checks if the input is a valid date
to parse by Dart DateTime
class
isDateAfter (Object ? input , DateTime date )
→ bool
isDateMills (String v , {bool isUtc = false })
→ bool
checks if the input is a valid date
to parse by DateTime.fromMillisecondsSinceEpoch
factory
isEgyptianNumber (String str )
→ bool
isEmail (String ? email )
→ bool
checks if the value can be well formatted email address
isEmpty (String ? input )
→ bool
trim
the string then checks if isEmpty
if string is empty it will returns true
isFacebookUrlValid (String url )
→ bool
isHexColor (String ? input )
→ bool
can starts with or without#
must contains
isHindiNum (String input )
→ bool
isIn (Object v , List <Object > list )
→ bool
check if string
is in List<String>
isInstgramUrlValid (String url )
→ bool
isKsaPhone (String input )
→ bool
isLtrLanguage (String languageCode )
→ bool
isNotEmpty (String ? string )
→ bool
trim
the string then checks if isNotEmpty
isNotIn (Object v , List <Object > list )
→ bool
check if value
is NOT
in List
isNumber (String ? input )
→ bool
isPort (Object ? input )
→ bool
isRtlLanguage (String languageCode )
→ bool
isUrlValid (String url )
→ bool
isYoutubeUrLValid (String url )
→ bool
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() , String ? webOnlyWindowName })
→ Future <bool >
Passes url
to the underlying platform for handling.
match (Object ? input , Object ? other )
→ bool
checks if two Strings
are the same
maxValue (Object ? value , num max )
→ bool
mergeTwoMaps (Map <String , Object ? > ? a , Map <String , Object ? > ? b )
→ Map <String , Object ? > ?
merges to maps into single one
if the key found in both maps it will use the one from the second map
minLength (String ? input , int min )
→ bool
minValue (Object ? value , num min )
→ bool
nineSeconds ()
→ Future <void >
instead of await Future.delayed(const Duration(seconds:9));
notContainsAny (String v , List <String > list )
→ bool
numberToLocale (String str , Locale locale )
→ String
localize numbers base on locale
if none provided it will use the app locale Nations.locale
Make sure you know the difference between arabic and hindi numbers
oneSecond ()
→ Future <void >
instead of await Future.delayed(const Duration(seconds:1));
qValidator (List <TextValidationRule > rules , {OnFailureCallBack ? onFail , bool useNations = true })
→ String ? Function(String ? )
? build and return String Function(String value)
? which triggers the provided validation rules
replaceArgsOf (String data , Map <String , Object ? > args )
→ String
replace args of map
in your assets the arg must starts with :
to be identified as variable
to replace it
sevenSeconds ()
→ Future <void >
instead of await Future.delayed(const Duration(seconds:7));
sixSeconds ()
→ Future <void >
instead of await Future.delayed(const Duration(seconds:6));
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.
tenSeconds ()
→ Future <void >
instead of await Future.delayed(const Duration(seconds:10));
threeSeconds ()
→ Future <void >
instead of await Future.delayed(const Duration(seconds:3));
twoSeconds ()
→ Future <void >
instead of await Future.delayed(const Duration(seconds:2));