/// Application-wide constants
class AppConstants {
  // Private constructor to prevent instantiation
  AppConstants._();

  // API Configuration
  static const String apiBaseUrl = 'https://dotnet.elidev.info:8157/ws';
  static const String apiVersion = 'v1';
  static const String appId = 'Minhthu2016';
  static const String scansEndpoint = '/api/scans';

  // Network Timeouts (in milliseconds)
  static const int connectionTimeout = 30000; // 30 seconds
  static const int receiveTimeout = 30000; // 30 seconds
  static const int sendTimeout = 30000; // 30 seconds

  // Local Storage Keys
  static const String scanHistoryBox = 'scan_history';
  static const String settingsBox = 'settings';
  static const String userPreferencesKey = 'user_preferences';

  // Scanner Configuration
  static const List<String> supportedBarcodeFormats = [
    'CODE_128',
    'CODE_39',
    'CODE_93',
    'EAN_13',
    'EAN_8',
    'UPC_A',
    'UPC_E',
    'QR_CODE',
    'DATA_MATRIX',
  ];

  // UI Configuration
  static const int maxHistoryItems = 100;
  static const int scanResultDisplayDuration = 3; // seconds

  // Form Field Labels
  static const String field1Label = 'Field 1';
  static const String field2Label = 'Field 2';
  static const String field3Label = 'Field 3';
  static const String field4Label = 'Field 4';

  // Error Messages
  static const String networkErrorMessage = 'Network error occurred. Please check your connection.';
  static const String serverErrorMessage = 'Server error occurred. Please try again later.';
  static const String unknownErrorMessage = 'An unexpected error occurred.';
  static const String noDataMessage = 'No data available';
  static const String scannerPermissionMessage = 'Camera permission is required to scan barcodes.';

  // Success Messages
  static const String saveSuccessMessage = 'Data saved successfully!';
  static const String printSuccessMessage = 'Print job completed successfully!';

  // App Info
  static const String appName = 'Barcode Scanner';
  static const String appVersion = '1.0.0';
  static const String appDescription = 'Simple barcode scanner with form data entry';

  // Animation Durations
  static const Duration shortAnimationDuration = Duration(milliseconds: 200);
  static const Duration mediumAnimationDuration = Duration(milliseconds: 400);
  static const Duration longAnimationDuration = Duration(milliseconds: 600);

  // Spacing and Sizes
  static const double defaultPadding = 16.0;
  static const double smallPadding = 8.0;
  static const double largePadding = 24.0;
  static const double borderRadius = 8.0;
  static const double buttonHeight = 48.0;
  static const double textFieldHeight = 56.0;

  // Scanner View Configuration
  static const double scannerAspectRatio = 1.0;
  static const double scannerBorderWidth = 2.0;

  // Print Configuration
  static const String printJobName = 'Barcode Scan Data';
  static const double printPageMargin = 72.0; // 1 inch in points
}