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 toggleVerify() async { final response = await http.post( Url.verifyTest(id), headers: { 'Authorization': User.token } ); if (response.statusCode == 200) { result = result == 'Verified' ? 'NotVerified' : 'Verified'; notifyListeners(); } } }