Skip to content

Commit

Permalink
fix turf mod bug and migrate sync to service
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Webb authored and Kevin Webb committed Feb 25, 2021
1 parent 61952a0 commit e70ba9f
Show file tree
Hide file tree
Showing 13 changed files with 355 additions and 266 deletions.
6 changes: 3 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ PODS:
- MTBBarcodeScanner
- shared_preferences (0.0.1):
- Flutter
- sqflite (0.0.1):
- sqflite (0.0.2):
- Flutter
- FMDB (~> 2.7.2)
- FMDB (>= 2.7.5)

DEPENDENCIES:
- camera (from `.symlinks/plugins/camera/ios`)
Expand Down Expand Up @@ -90,7 +90,7 @@ SPEC CHECKSUMS:
Protobuf: 176220c526ad8bd09ab1fb40a978eac3fef665f7
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904

PODFILE CHECKSUM: a75497545d4391e2d394c3668e20cfb1c2bbd4aa

Expand Down
6 changes: 3 additions & 3 deletions lib/database/database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ class FeatureTypes extends Table {
TextColumn get projectId => text()();
TextColumn get geometryType => text()(); // 'point' or 'line'
TextColumn get color => text()(); // string of color hex code
TextColumn get name => text()(); // label to be displayed in app
TextColumn get label => text()(); // label to be displayed in app
TextColumn get value => text()(); // value to use in export feed

@override
Set<Column> get primaryKey => {id};
Expand Down Expand Up @@ -199,7 +199,7 @@ class CurbWheelDatabase extends _$CurbWheelDatabase {
geometryType: surveyItem.feature.geometryType,
featureId: surveyItem.feature.id,
color: surveyItem.feature.color,
name: surveyItem.feature.name,
name: surveyItem.feature.label,
span: span[0],
points: points);
return listItem;
Expand All @@ -210,7 +210,7 @@ class CurbWheelDatabase extends _$CurbWheelDatabase {
geometryType: surveyItem.feature.geometryType,
featureId: surveyItem.feature.id,
color: surveyItem.feature.color,
name: surveyItem.feature.name,
name: surveyItem.feature.label,
points: points);
return listItem;
}
Expand Down
102 changes: 52 additions & 50 deletions lib/database/database.g.dart

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

3 changes: 2 additions & 1 deletion lib/database/survey_span_dao.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class SurveySpanDao extends DatabaseAccessor<CurbWheelDatabase>
(select(surveySpans)..where((s) => s.id.equals(id))).getSingle();

Future<List<SurveySpan>> getSpansBySurveyItemId(String surveyItemId) =>
select(surveySpans).get();
(select(surveySpans)..where((s) => s.surveyItemId.equals(surveyItemId)))
.get();

Future insertSpan(SurveySpansCompanion surveySpan) =>
into(surveySpans).insert(surveySpan);
Expand Down
3 changes: 3 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:curbwheel/service/sync.dart';
import 'package:curbwheel/ui/camera/camera_screen.dart';
import 'package:curbwheel/ui/camera/gallery_screen.dart';
import 'package:curbwheel/ui/camera/image_view_screen.dart';
Expand All @@ -18,6 +19,8 @@ import 'database/database.dart';
void main() => runApp(MultiProvider(providers: [
Provider<CurbWheelDatabase>(create: (_) => CurbWheelDatabase()),
Provider<ProjectMapDatastores>(create: (_) => ProjectMapDatastores()),
ChangeNotifierProvider(
create: (BuildContext context) => ProjectSyncService(context)),
ChangeNotifierProvider(create: (BuildContext context) => BleConnection()),
ChangeNotifierProxyProvider<BleConnection, WheelCounter>(
create: (BuildContext context) => WheelCounter(),
Expand Down
Loading

0 comments on commit e70ba9f

Please sign in to comment.