getId method

Future<String> getId()

Implementation

Future<String> getId() async {
  int id = 0;

  try {
    id = Database.getSharedPreferences()
            .getInt('odin_model_factory_id_counter') ??
        0;
  } catch (_) {}

  String result = 'model_$id';

  id++;

  await Database.getSharedPreferences()
      .setInt('odin_model_factory_id_counter', id);

  return result;
}