execute method

  1. @override
Future<Content> execute(
  1. ToolContext context,
  2. Map<String, dynamic> arguments
)
override

Implementation

@override
Future<Content> execute(ToolContext context, Map<String, dynamic> arguments) async {
  final zone = await FlutterTimezone.getLocalTimezone();
  final now = DateTime.now();
  final callerName = context.caller?.getAttribute("name")?.toString() ?? "user";
  return TextContent(text: "$callerName's time info:\ntime: ${now.toIso8601String()}\nzone: ${zone.identifier}");
}