Files
social-app/apps/lib/core/config/env.dart
T

23 lines
528 B
Dart
Raw Normal View History

import 'dart:io';
class Env {
static String get apiUrl {
final backendUrl = const String.fromEnvironment('BACKEND_URL');
if (backendUrl.isNotEmpty && backendUrl != 'false') {
return backendUrl;
}
if (Platform.isAndroid) {
return 'http://192.168.1.25:5775';
}
return 'http://localhost:5775';
}
static bool get isMockApi {
final fromDefine = const String.fromEnvironment('MOCK_API');
if (fromDefine.isNotEmpty) {
return fromDefine == 'true';
}
return false;
}
}