firstIntValue function

int? firstIntValue(
  1. List<Map<String, Object?>> list
)

helper to get the first int value in a query Useful for COUNT(*) queries

Implementation

int? firstIntValue(List<Map<String, Object?>> list) {
  if (list.isNotEmpty) {
    final firstRow = list.first;
    if (firstRow.isNotEmpty) {
      return parseInt(firstRow.values.first);
    }
  }
  return null;
}