getHabitByCodeSpecie method

Future<String?> getHabitByCodeSpecie(
  1. int codEspecieCode
)

Implementation

Future<String?> getHabitByCodeSpecie(int codEspecieCode) async {
  final db = await database;
  List<Map<String, dynamic>> result = await db.query(
    'species',
    columns: ['habit'],
    where: 'code_specie = ?',
    whereArgs: [codEspecieCode],
  );
  if (result.isNotEmpty) {
    return result.first['habit'] as String?;
  }
  return null;
}