native_functions/define_native_functions
library
Functions
-
clock(List args)
→ int
-
Provides a clock() function that returns the current time in milliseconds since the epoch.
-
date(List args)
→ DateTime
-
Provides a date() function that creates a DateTime object from the given arguments.
-
defineVmNativeFunctions(VM vm)
→ void
-
This registers all the built-in native functions.
This is called automatically when by the VM.
-
duration(List args)
→ Duration
-
Provides a duration() function that creates a Duration object from the given arguments.
-
jsonDecode(List args)
→ Map<String, dynamic>
-
Provides a jsonDecode() function that decodes a JSON string to a map object.
Supports conversion of DateTime objects from strings.
-
jsonEncode(List args)
→ String
-
Provides a jsonEncode() function that encodes a map object to a JSON string.
Supports conversion of DateTime objects to strings.
-
now(List args)
→ DateTime
-
Provides a now() function that returns the current time.
-
parseDateTime(List args)
→ DateTime
-
Provides a parseDateTime() function that parses a date string to a DateTime object.
-
quit(VM vm)
→ Function
-
Provides a quit() function that immediately halts script execution and exits
with the given return code.
-
rndBool(List args)
→ bool
-
-
rndDouble(List args)
→ double
-
Provides a rndDouble() function that returns a random double value.
-
rndInt(List args)
→ int
-
Provides a rndInt() function that returns a random integer value.
-
wait(List args)
→ Future
-
Provides a wait() function that returns a Future that completes after the given number of milliseconds.