21 lines
454 B
Dart
21 lines
454 B
Dart
import 'dart:io';
|
|
|
|
class Env {
|
|
static String get apiUrl {
|
|
const url = String.fromEnvironment('API_URL');
|
|
if (url.isNotEmpty) return url;
|
|
if (Platform.isAndroid) {
|
|
return 'http://10.0.2.2:5775';
|
|
}
|
|
return 'http://localhost:5775';
|
|
}
|
|
|
|
static bool get isMockApi {
|
|
final fromDefine = const String.fromEnvironment('MOCK_API');
|
|
if (fromDefine.isNotEmpty) {
|
|
return fromDefine == 'true';
|
|
}
|
|
return false;
|
|
}
|
|
}
|