check web and tablet for logic

This commit is contained in:
amirrezaghabeli
2025-08-23 15:22:28 +03:30
parent b00ba07122
commit 14ab9a75ca
27 changed files with 569 additions and 282 deletions
+18 -15
View File
@@ -1,3 +1,5 @@
import 'package:flutter/foundation.dart';
class AppConfig {
// این فلگ نشان می‌دهد که آیا برنامه در حالت Development است یا خیر.
// می‌توانید این مقدار را با استفاده از environment variables در زمان بیلد تغییر دهید.
@@ -8,23 +10,24 @@ class AppConfig {
// این متد بر اساس محیط فعال، URL مناسب را برمی‌گرداند.
static String get apiBaseUrl {
return 'http://10.0.2.2:8081';
// return 'http:127.0.0.1';
// return 'http://10.0.2.2:8081';
// return '192.168.1.103:8081';
// if (isDevelopment) {
// // Handle different platforms for local development
// if (kIsWeb) {
// // For web, use localhost
// return 'http://localhost:8081';
// } else if (Platform.isAndroid) {
// // For Android emulator, use 10.0.2.2 (special IP for host machine)
// return 'http://10.0.2.2:8081';
// } else if (Platform.isIOS) {
// // For iOS simulator, use localhost
// return 'http://localhost:8081';
// } else {
// // For other platforms (desktop), use localhost
// return 'http://localhost:8081';
// }
if (kIsWeb) {
// For web, use localhost
return 'http://localhost:8081';
} else {
// For Android emulator, use 10.0.2.2 (special IP for host machine)
return 'http://10.0.2.2:8081';
}
// else if (Platform.isIOS) {
// // For iOS simulator, use localhost
// return 'http://localhost:8081';
// } else {
// // For other platforms (desktop), use localhost
// return 'http://localhost:8081';
// }
// } else {
// // Production URL - replace with your actual production server
// return 'https://your-production-server.com';