general_lib
library
Functions
convertToAgo (int ? timestamp )
→ String
convertToAgoFromDateTime (DateTime dateTime )
→ String
createOffset ({required int totalCount , required int limitCount })
→ (List <int > , int )
fetch (String url , {FetchOption ? options , Encoding ? encoding })
→ Future <Response >
generate_add_sql_data ({required String tableName , required Map data })
→ String
generateDataSqlJson ({required Map data })
→ String
generateUuid (int length , {String text = "0123456789abcdefghijklmnopqrstuvwxyz" })
→ String
getDeviceId ({bool isGetProductId = false })
→ DeviceId ?
getRandomElement <T > (List <T > list )
→ T
getUuid (int length , {String ? text })
→ String
getRandom uuid for parameters @extra
jsonEach ({required Map data , required Future builder (dynamic key , dynamic value , bool isList , bool isMapInList ) })
→ Future <Map >
jsonListEach ({required String key , required List data , required Future builder (dynamic key , dynamic value , bool isList , bool isMapInList ) })
→ Future <List >
jsonToIsar (Map <String , dynamic > data , {String className = "Root" , bool isMain = true , bool isUseClassName = false , int isarVersion = 3 })
→ JsonDataScript
jsonToIsarDynamic (Map <String , dynamic > data , {String className = "Root" , bool isMain = true , bool isUseClassName = false , required int isarVersion })
→ String
jsonToLanguageScript ({required Map language_raw , required String default_language_code_id , required Directory directory , required Future <String ? > onData (String origin_data , String language_code_id , String default_language_code_id ), bool is_translate = true })
→ Future <Directory >
jsonToMessage (Map data , {bool isHtml = false , required Map jsonFullMedia , bool isRoot = true , String space = "" })
→ String
jsonToScripts (List <Map > scripts_origin , {bool isMethodApi = true , required Directory directory , String path_package_json_dart = "import \"package:general_lib/general_lib.dart\";" , int try_loop = 2 })
→ Future <Directory >
jsonToScriptStatic (Map <String , dynamic > data , {bool isMethodApi = true , required Directory directory , String path_package_json_dart = "import \"package:general_lib/general_lib.dart\";" })
→ String
jsonToSqlSupabase ({required Map jsonData , bool isEnableRls = true , String ? tableName })
→ String
jsonUpdate ({required Map data , required Map newData })
→ Map
languageMapToStringScript ({required String key_name , required Map data , required String language_parameter , bool is_translate = true , required String default_language_code_id , required String base_name , required Future <String ? > onData (String origin_data , String language_code_id , String default_language_code_id ) })
→ Future <String >
textToFunctionDart ({required String key , required dynamic value , required String returnType , required String className , bool isClass = false , bool isList = false , required void paramFunction (String text ), required void paramJson (String text ) })
→ String
textToFunctionIsar ({required String key , required dynamic value , required String returnType , required String className , bool isClass = false , bool isList = false , bool isUseClassName = false , required void callback (String text ), required void paramFunction (String text ), required void paramJson (String text ), required void operatorData (String text ) })
→ String
textToListFunction ({required String key , required String returnType , required String className , bool isClass = false , bool isList = false , required void paramFunction (String text ), required void paramJson (String text ) })
→ String
Typedefs
CancelEvent
= void Function()
Handler for cancelling the event registration.
EventCallback
= void Function(Event ev , Object ? context )
The callback function to receive event notification.
ev
- Event event emitted by the publisher.
context
- Object passed while registering the subscription as context. This is useful especially when the listener want to receive context information for all future events emitted for the context.
ExecuteOnErrorDart <V >
= FutureOr <V > Function(Object error , StackTrace stackTrace )