passo_mobile_app/lib/sevices/passo/building/location_landref_services.dart

28 lines
861 B
Dart
Raw Normal View History

2023-07-28 02:35:36 +00:00
import 'dart:convert';
import 'dart:developer';
import 'dart:io';
import 'package:http/http.dart' as http;
import 'package:unit2/model/passo/bldg_loc.dart';
class LocationLandrefServices {
static final LocationLandrefServices _instance = LocationLandrefServices();
static LocationLandrefServices get instance => _instance;
Future<http.Response?> bldgLocPutInfo(BldgLoc data, id) async {
http.Response? response;
try {
response = await http.put(Uri.parse(
// ignore: unnecessary_brace_in_string_interps
"http://192.168.10.218:8000/api/rptass_app/bldgappr_location/?bldgappr_details_id=${id}"),
headers: {
HttpHeaders.contentTypeHeader: "application/json",
},
body: jsonEncode(data.toJson()));
} catch (e) {
log(e.toString());
}
return response;
}
}