utils/utils library

Exports for the utilities, new utils should be added here and this is the file that should be imported instead of the specific util file.

Functions

brighten(Color c, [int percent = 10]) Color
These are internal tools to birghten the color, used for tuning colors.
darken(Color c, [int percent = 10]) Color
These are internal tools to darken the color, used for tuning colors.
getConversationDetails(EcodeskProps p, Conversation conversation, EcodeskCustomer customer, Function sc, {Client? client}) Future<Conversation>
This function will get the conversation details that we need in order to join the room. The most important detail is the ID, and this will return a new conversation.
getCustomerDetails(EcodeskProps p, EcodeskCustomer? c, Function? sc, {Client? client}) Future<EcodeskCustomer>
getCustomerDetailsFromMetadata(EcodeskProps p, EcodeskCustomer? c, Function sc, {Client? client}) Future<EcodeskCustomer>
This funtction is used to get the customer details from Ecodesk. This is the function responsible for finding the Customer's ID.
getCustomerHistory({required EcodeskProps props, EcodeskCustomer? c, required Function setCustomer, List<EcodeskMessage>? messages, PhoenixChannel? conversationChannel, Function? setConversationChannel, Function? rebuild, PhoenixSocket? socket}) Future<bool>
This function is used to get the history. It also initializes the necessary funtions if the customer is known.
getPastCustomerMessages(EcodeskProps p, EcodeskCustomer c, {Client? client}) Future<Map<String, dynamic>>
This function is used to get the past messages from the customer.
initChannels(bool connected, PhoenixSocket socket, PhoenixChannel? channel, EcodeskProps props, bool canJoinConversation, Function setState) → dynamic
This function creates the necessary channels, sockets and rooms for ecodesk to communicate.
joinConversationAndListen({List<EcodeskMessage>? messages, required String convId, required PhoenixChannel? conversation, required PhoenixSocket socket, required Function? setState, required Function setChannel}) → PhoenixChannel?
This function will join the channel and listen to new messages.
parseDateFromUTC(String? time) DateTime?
This function converts a sting in ISO8601 format into a DateTime object which is in UTC and then converts in into the local timezone. Used to convert times from the Ecodesk API. It assumes all times provided are in UTC or it will force them bo be.