create method
Implementation
Future<Map<String, dynamic>?> create(
String key, Map<String, dynamic> value) async {
final response = await http.post(Uri.parse(_url! + '/' + key + '.json'),
body: jsonEncode(value), headers: {'content-type': "application/json"});
if (response.statusCode == 200) {
print(response.statusCode);
var jsonResponse = jsonDecode(response.body);
return jsonResponse;
} else {
print('Request failed with status: ${response.statusCode}.');
return null;
}
}