This commit is contained in:
ehaya
2020-05-10 14:09:07 +04:30
parent 66c1e7bf16
commit 158c53e534
192 changed files with 13165 additions and 1 deletions
+38
View File
@@ -0,0 +1,38 @@
import 'package:cssd/config/urls.dart';
import 'package:cssd/config/user.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
class TestResult with ChangeNotifier{
final int id;
final String name;
final String date;
final String deviceId;
String result;
bool get isVerified {
return result == 'Verified';
}
TestResult({
this.id,
this.name,
this.date,
this.deviceId,
this.result,
});
Future<void> toggleVerify() async {
final response = await http.post(
Url.verifyTest(id), headers: {
'Authorization': User.token
}
);
if (response.statusCode == 200) {
result = result == 'Verified' ? 'NotVerified' : 'Verified';
notifyListeners();
}
}
}