2026-04-02 18:39:35 +08:00
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
class Env {
|
|
|
|
|
static String get backendUrl {
|
|
|
|
|
final injected = const String.fromEnvironment('BACKEND_URL');
|
|
|
|
|
if (injected.isNotEmpty && injected != 'false') {
|
|
|
|
|
return injected;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
|
return 'http://10.0.2.2:5775';
|
|
|
|
|
}
|
2026-04-28 10:45:29 +08:00
|
|
|
if (Platform.isIOS) {
|
|
|
|
|
return 'http://192.168.1.63:5775';
|
|
|
|
|
}
|
2026-04-02 18:39:35 +08:00
|
|
|
return 'http://localhost:5775';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Future<void> init() async {}
|
|
|
|
|
}
|