Skip to content

Commit

Permalink
feat: add validate method
Browse files Browse the repository at this point in the history
  • Loading branch information
dionesxxx committed Jun 5, 2023
1 parent 81214e2 commit 4a27bbc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/qr_code_repository/lib/src/qr_code_repository.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:math';

import 'package:domain_models/domain_models.dart';
import 'package:qr_code_repository/src/mappers/remote_to_remote.dart';
import 'package:qr_generator_api/qr_generator_api.dart';
Expand Down Expand Up @@ -39,4 +41,11 @@ class QrCodeRepository {
return Stream.periodic(const Duration(seconds: 1), (x) => ticks - x - 1)
.take(ticks);
}

/// Validate a [String] from QRCode.
Future<bool> validateQrCode() async {
// Simulate random returns from the server
await Future<void>.delayed(const Duration(seconds: 1));
return Random().nextBool();
}
}

0 comments on commit 4a27bbc

Please sign in to comment.