Add Android support with configurable server URL and location permissions

- Add shared_preferences for persisting server URL
- Add SettingsService and PlatformService
- Add server URL input field on non-web platforms
- Make ApiConfig baseUrl configurable at runtime
- Add Android location permissions (ACCESS_FINE/COURSE_LOCATION, INTERNET)
- Request location permission on login and map init
- Fix geo_id type: use String instead of int (UUID format)
- Align share_service with API spec: remove unique_id, use share_id only
- Fix watch endpoint response: last_update instead of created_at
- Add error handling with SnackBars for geo operations
- Wrap login screen in SingleChildScrollView for keyboard handling
- Update map tile layer with userAgentPackageName for OSM
This commit is contained in:
dmit.b
2026-05-15 17:38:56 +03:00
parent ca90c6c3fc
commit f1e88b1ac3
26 changed files with 1255 additions and 297 deletions
+16 -10
View File
@@ -1,14 +1,20 @@
class ApiConfig {
static final String baseUrl = Uri.base.origin;
static String _baseUrl = 'https://family-safety.onrender.com/api';
static String get baseUrl => _baseUrl;
static void setBaseUrl(String url) {
_baseUrl = url.endsWith('/') ? url.substring(0, url.length - 1) : url;
}
// Auth endpoints
static final String loginUrl = '$baseUrl/login';
static final String regUrl = '$baseUrl/reg';
static String get loginUrl => '$baseUrl/login';
static String get regUrl => '$baseUrl/reg';
// Geo endpoints
static final String geoUrl = '$baseUrl/geo';
static String get geoUrl => '$baseUrl/geo';
// Share endpoints
static final String shareUrl = '$baseUrl/share';
static final String watchUrl = '$baseUrl/watch';
}
static String get shareUrl => '$baseUrl/share';
static String get watchUrl => '$baseUrl/watch';
}