YogiBook_App/lib/config/api_config.dart
2025-12-27 20:46:49 +01:00

22 lines
689 B
Dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
class ApiConfig {
// Host handling:
// - Web: localhost
// - Android emulator: 10.0.2.2 (maps to host machine)
static String get host {
if (kIsWeb) return 'localhost';
if (defaultTargetPlatform == TargetPlatform.android) return '10.0.2.2';
return 'localhost';
}
// Laravel/Vanguard API (login, password remind, social)
static String get laravelApiBase => 'http://$host/yogiboook/public/api';
// Your custom PHP APIs under /public/userarea/api/
static String get phpApiBase => 'http://$host/yogiboook/public/userarea/api';
static const String deviceName = 'FlutterApp';
}