Initial commit: family safety frontend project setup

This commit is contained in:
dmit.b
2026-05-09 12:38:19 +03:00
commit ca90c6c3fc
147 changed files with 6350 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import 'dart:convert';
import 'package:http/http.dart' as http;
import '../config/api.dart';
class GeoService {
final http.Client _client;
GeoService({http.Client? client}) : _client = client ?? http.Client();
Future<void> updatePosition(String token, int id, double x, double y) async {
final response = await _client.put(
Uri.parse('${ApiConfig.geoUrl}?id=$id'),
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer $token',
},
body: jsonEncode({'x': x, 'y': y}),
);
if (response.statusCode != 200) {
throw Exception('Failed to update position');
}
}
}