smf_core
library
Functions
boolFromJson (Object ? json )
→ bool
Convert null
value from Object to bool
.
clearSharedPref ()
→ Future <bool >
clear SharedPref
getBoolAsync (String key , {bool defaultValue = false })
→ bool
Returns a Bool if exists in SharedPref
getDoubleAsync (String key , {double defaultValue = 0.0 })
→ double
Returns a Double if exists in SharedPref
getIntAsync (String key , {int defaultValue = 0 })
→ int
Returns a Int if exists in SharedPref
getJSONAsync (String key , {Map <String , dynamic > ? defaultValue })
→ Map <String , dynamic >
Returns a JSON if exists in SharedPref
getMatchingSharedPrefKeys (String key )
→ List <String >
Returns List of Keys that matches with given Key
getProportionateScreenHeight (double inputHeight )
→ double
getProportionateScreenWidth (double inputWidth )
→ double
getStringAsync (String key , {String defaultValue = '' })
→ String
Returns a String if exists in SharedPref
getStringListAsync (String key )
→ List <String > ?
Returns a StringList if exists in SharedPref
initializePrefs ()
→ Future <void >
launchInAppWebView (Uri url , { })
→ Future <void >
Launch Uri in InAppWebView
.
launchInBrowser (Uri url )
→ Future <void >
Launch Uri in Browser
.
launchInWebViewWithoutDomStorage (Uri url )
→ Future <void >
Launch Uri in InAppWebView
withoud DOM Storage
.
launchInWebViewWithoutJavaScript (Uri url )
→ Future <void >
Launch Uri in InAppWebView
withoud javascript
.
launchUniversalLinkIos (Uri url )
→ Future <void >
Launch universal Uri link in iOS
.
nextDecode <T > (dynamic json , String key )
→ T
Decode to json 2nd
time
because consuming SOAP
api need to convert for second time.
numFromJson (Object ? json )
→ num
Convert null
value from Object to num
.
removeKey (String key )
→ Future <bool >
remove key from SharedPref
responseData <T > (Response response )
→ T
Convert data
of Response
to T
setValue (String key , dynamic value , {bool print = true })
→ Future <bool >
These codes are from nb_utils
package.
Add a value in SharedPref based on their type - Must be a String, int, bool, double, Map<String, dynamic> or StringList
showAnimatedDatePicker ({required BuildContext context , required DateTime initialDate , required DateTime firstDate , required DateTime lastDate , DateTime ? currentDate , DatePickerEntryMode initialEntryMode = DatePickerEntryMode.calendar , SelectableDayPredicate ? selectableDayPredicate , String ? helpText , String ? cancelText , String ? confirmText , Locale ? locale , bool useRootNavigator = true , RouteSettings ? routeSettings , TextDirection ? textDirection , TransitionBuilder ? builder , DatePickerMode initialDatePickerMode = DatePickerMode.day , String ? errorFormatText , String ? errorInvalidText , String ? fieldHintText , String ? fieldLabelText , TextInputType ? keyboardType , Offset ? anchorPoint })
→ Future <DateTime ? >
Show DateTime picker with easeInOutBack
curve animation.
showAnimatedDialog (BuildContext context , {bool barrierDismissible = false , String ? barrierLabel , Color ? barrierColor , Duration transitionDuration = const Duration(milliseconds: 200) , DialogAnimationType animType = DialogAnimationType.curveEaseInOutBack , required Widget dialog , bool shouldDelay = false })
→ void
Show dialog with animation and future delay awareness.
showAnimatedTimePicker ({required BuildContext context , required TimeOfDay initialTime , TimePickerEntryMode initialEntryMode = TimePickerEntryMode.dial , String ? cancelText , String ? confirmText , String ? helpText , String ? errorInvalidText , String ? hourLabelText , String ? minuteLabelText , EntryModeChangeCallback ? onEntryModeChanged , bool useRootNavigator = true , RouteSettings ? routeSettings , Offset ? anchorPoint })
→ Future <TimeOfDay ? >
Show TimeOfDay picker with easeInOutBack
curve animation.
showDialogWithAnimation (BuildContext context , {bool barrierDismissible = false , String ? barrierLabel , Color ? barrierColor , Duration transitionDuration = const Duration(milliseconds: 200) , DialogAnimationType animType = DialogAnimationType.curveEaseInOutBack , required Widget dialog })
→ void
Show dialog with some animation
stringFromJson (Object ? json )
→ String
Convert null
value from Object to empty
string.