POLISHING STUFF and Smarter AI, and alot i mean.. ALOT OF BUG FIX AND OPTIMIZE
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class AppConstants {
|
||||
static const String defaultServerUrl = 'http://202.46.28.170:8080';
|
||||
static const String defaultServerUrl = 'http://127.0.0.1:8080';
|
||||
static const String publicServerUrl = 'http://202.46.28.170:8080';
|
||||
static const String _serverUrlKey = 'server_base_url';
|
||||
static const String _selectedYoloModelKey = 'selected_yolo_model';
|
||||
|
||||
@@ -10,7 +11,7 @@ class AppConstants {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final saved = prefs.getString(_serverUrlKey);
|
||||
if (saved == null || saved.trim().isEmpty) {
|
||||
return defaultServerUrl;
|
||||
return null;
|
||||
}
|
||||
return saved;
|
||||
}
|
||||
@@ -38,7 +39,7 @@ class AppConstants {
|
||||
|
||||
static Future<void> clearServerUrl() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setString(_serverUrlKey, defaultServerUrl);
|
||||
await prefs.remove(_serverUrlKey);
|
||||
}
|
||||
|
||||
static String buildApiUrl(String baseUrl) => '$baseUrl/api/v1';
|
||||
|
||||
Reference in New Issue
Block a user