registerDevice method

  1. @override
Future<int> registerDevice(
  1. LicenseDocument license
)
override

Implementation

@override
Future<int> registerDevice(LicenseDocument license) async {
  if (!await _exists(license)) {
    throw LcpException.runtime(
        "The LCP License doesn't exist in the database");
  }
  return database.update(
    LicensesTable.name,
    {
      LicensesTable.registered: _true,
    },
    where: '${LicensesTable.id} = ?',
    whereArgs: [license.id],
  );
}