style: dart format reflow (no behavior change)
This commit is contained in:
parent
cf5d302cc1
commit
e3ec855630
17 changed files with 197 additions and 139 deletions
|
|
@ -267,7 +267,10 @@ class InventoryCsvCodec {
|
|||
);
|
||||
}
|
||||
|
||||
CsvImportLot? _parseLot(List<String> row, String? Function(List<String>, String) cell) {
|
||||
CsvImportLot? _parseLot(
|
||||
List<String> row,
|
||||
String? Function(List<String>, String) cell,
|
||||
) {
|
||||
final typeCell = cell(row, 'lot_type');
|
||||
final year = cell(row, 'harvest_year');
|
||||
final month = cell(row, 'harvest_month');
|
||||
|
|
@ -452,7 +455,8 @@ class InventoryCsvCodec {
|
|||
i++;
|
||||
}
|
||||
row.add(field.toString());
|
||||
final trailingEmpty = rows.isNotEmpty && row.length == 1 && row.first.isEmpty;
|
||||
final trailingEmpty =
|
||||
rows.isNotEmpty && row.length == 1 && row.first.isEmpty;
|
||||
if (!trailingEmpty) rows.add(row);
|
||||
return rows;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,11 +51,7 @@ class InventorySnapshot {
|
|||
/// newer incoming version (LWW), and rows skipped (already present and at
|
||||
/// least as recent, or not decodable).
|
||||
class ImportSummary {
|
||||
const ImportSummary({
|
||||
this.inserted = 0,
|
||||
this.updated = 0,
|
||||
this.skipped = 0,
|
||||
});
|
||||
const ImportSummary({this.inserted = 0, this.updated = 0, this.skipped = 0});
|
||||
|
||||
final int inserted;
|
||||
final int updated;
|
||||
|
|
|
|||
|
|
@ -65,13 +65,11 @@ class SpeciesRepository {
|
|||
if (existing != null) {
|
||||
// Backfill bundled reference data added after the row was seeded.
|
||||
if (existing.viabilityYears == null && seed.viabilityYears != null) {
|
||||
await (_db.update(_db.species)
|
||||
..where((s) => s.id.equals(existing.id)))
|
||||
.write(
|
||||
SpeciesCompanion(
|
||||
viabilityYears: Value(seed.viabilityYears),
|
||||
),
|
||||
);
|
||||
await (_db.update(
|
||||
_db.species,
|
||||
)..where((s) => s.id.equals(existing.id))).write(
|
||||
SpeciesCompanion(viabilityYears: Value(seed.viabilityYears)),
|
||||
);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,9 +77,24 @@ class TesseractLabelExtractor implements LabelTextExtractor {
|
|||
/// Words in an hOCR document ignored as packet boilerplate (lower-cased,
|
||||
/// accent-stripped compare). Kept deliberately small and generic.
|
||||
const _boilerplate = <String>{
|
||||
'organic', 'product', 'products', 'herb', 'herbs', 'seed', 'seeds',
|
||||
'bio', 'net', 'weight', 'wt', 'www', 'com', 'gr', 'grs', 'grams',
|
||||
'variety', 'quality',
|
||||
'organic',
|
||||
'product',
|
||||
'products',
|
||||
'herb',
|
||||
'herbs',
|
||||
'seed',
|
||||
'seeds',
|
||||
'bio',
|
||||
'net',
|
||||
'weight',
|
||||
'wt',
|
||||
'www',
|
||||
'com',
|
||||
'gr',
|
||||
'grs',
|
||||
'grams',
|
||||
'variety',
|
||||
'quality',
|
||||
};
|
||||
|
||||
/// Selects the variety name from Tesseract [hocr]: keep the words whose glyph
|
||||
|
|
@ -112,7 +127,13 @@ HocrLabel? readHocrLabel(String hocr, {int minConfidence = 20}) {
|
|||
final text = _unescape(m.group(6)!).trim();
|
||||
if (text.isEmpty) continue;
|
||||
words.add(
|
||||
_Word(x0: x0, y0: y0, height: y1 - y0, text: text, confidence: confidence),
|
||||
_Word(
|
||||
x0: x0,
|
||||
y0: y0,
|
||||
height: y1 - y0,
|
||||
text: text,
|
||||
confidence: confidence,
|
||||
),
|
||||
);
|
||||
}
|
||||
if (words.isEmpty) return null;
|
||||
|
|
|
|||
|
|
@ -130,6 +130,8 @@ class QuickAddCubit extends Cubit<QuickAddState> {
|
|||
quantity: state.quantity,
|
||||
photoBytes: state.photoBytes,
|
||||
);
|
||||
emit(QuickAddState(lotType: state.lotType, addedCount: state.addedCount + 1));
|
||||
emit(
|
||||
QuickAddState(lotType: state.lotType, addedCount: state.addedCount + 1),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,10 +76,8 @@ class _TriageSheet extends StatelessWidget {
|
|||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: drafts.length,
|
||||
itemBuilder: (context, i) => _DraftTile(
|
||||
draft: drafts[i],
|
||||
repository: repository,
|
||||
),
|
||||
itemBuilder: (context, i) =>
|
||||
_DraftTile(draft: drafts[i], repository: repository),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue