getTableName method

String getTableName(
  1. dynamic obj
)

This method is used to get the table name for a given object.

It takes an object as a parameter and returns a string that represents the table name for that object in the database. The table name is constructed by converting the runtime type of the object to a string and making it lowercase. An 's' is appended to the end of the string to make it plural.

Parameters: obj (dynamic): The object for which to get the table name.

Returns: String: The table name for the given object.

Implementation

String getTableName(dynamic obj) {
  return '${obj.runtimeType.toString().toLowerCase()}s';
}