Skip to content

Commit

Permalink
Add barcode scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonp2412 committed Jul 13, 2024
1 parent 7c0cf5e commit 13f2213
Show file tree
Hide file tree
Showing 18 changed files with 1,609 additions and 56 deletions.
5 changes: 4 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
analyzer:
errors:
argument_type_not_assignable_to_error_handler: ignore
invalid_return_type_for_catch_error: ignore
include: package:flutter_lints/flutter.yaml

linter:
rules:
curly_braces_in_flow_control_structures: false
require_trailing_commas: true

1 change: 1 addition & 0 deletions drift_schemas/drift_schema_v20.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion lib/database/database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AppDatabase extends _$AppDatabase {
AppDatabase({QueryExecutor? executor}) : super(executor ?? _openConnection());

@override
int get schemaVersion => 19;
int get schemaVersion => 20;

@override
MigrationStrategy get migration {
Expand Down Expand Up @@ -242,6 +242,9 @@ class AppDatabase extends _$AppDatabase {
from18To19: (Migrator m, Schema19 schema) async {
await m.addColumn(schema.foods, schema.foods.created);
},
from19To20: (Migrator m, Schema20 schema) async {
await m.addColumn(schema.foods, schema.foods.barcode);
},
),
);
}
Expand Down
61 changes: 58 additions & 3 deletions lib/database/database.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/database/foods.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:drift/drift.dart';
// coverage:ignore-file

class Foods extends Table {
TextColumn get barcode => text().nullable()();
RealColumn get addedSugarG => real().nullable()();
RealColumn get alanineMg => real().nullable()();
RealColumn get alcoholG => real().nullable()();
Expand Down
Loading

0 comments on commit 13f2213

Please sign in to comment.