save<T extends Model> static method

Future<bool> save<T extends Model>(
  1. T instance
)

Saves instance (create or update).

Implementation

static Future<bool> save<T extends Model>(T instance) async {
  if (instance.id == null || instance.createdAt == null) {
    return await _create<T>(instance);
  } else {
    return await _update<T>(instance);
  }
}