Skip to content

Commit

Permalink
Fix delay issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ferndot committed Mar 20, 2020
1 parent a6e1158 commit 512283e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/src/data/repositories/checkups.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import 'dart:async';
import 'dart:io';
import 'dart:math';

import 'package:coronavirus_diary/src/data/models/assessments.dart';
import 'package:coronavirus_diary/src/data/models/checkups.dart';

class CheckupsRepository {
Future<Checkup> createCheckup(Checkup checkup) async {
await sleep(Duration(seconds: 1));
await Future.delayed(Duration(seconds: 1));
return checkup;
}

Future<Checkup> updateCheckup(Checkup updatedCheckup) async {
await sleep(Duration(seconds: 1));
await Future.delayed(Duration(seconds: 1));
return updatedCheckup;
}

Future<Assessment> completeCheckup(String id) async {
await sleep(Duration(seconds: 1));
await Future.delayed(Duration(seconds: 1));
return Assessment(
processed: DateTime.now(),
matchesPuiSymptoms: Random().nextBool(),
Expand Down

0 comments on commit 512283e

Please sign in to comment.