addApplication static method

Future<bool> addApplication(
  1. ApplicationModel app
)

Implementation

static Future<bool> addApplication(ApplicationModel app) async {

  bool ok = true;

  // set page
  app.page ??= 0;

  // set ordering
  app.order ??= _apps.length;

  // insert into the hive
  ok = await app.insert();

  // add to the list
  if (!_apps.contains(app)) _apps.add(app);

  return ok;
}