ionic-planb-logistic-app-fl.../lib/api/grpc_config.dart
Mathias Beaulieu-Duncan edb106a7fd Refactor theme system and remove unused platforms
- Overhaul theme system with Svrnty design and WCAG AAA compliance
- Remove android, macos, and web platform files (iOS-only focus)
- Update components with improved dark mode map and UI refinements
- Enhance settings page with additional configuration options
- Add theme system documentation in lib/theme/README.md
- Update CLAUDE.md with comprehensive theme guidelines

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 14:47:51 -05:00

60 lines
1.7 KiB
Dart

/// Configuration for gRPC client connections.
///
/// Provides separate configurations for development and production environments
/// with appropriate security settings for each.
class GrpcConfig {
/// The gRPC server host address.
final String host;
/// The gRPC server port.
final int port;
/// Connection timeout duration.
final Duration timeout;
/// Whether to use TLS for secure connections.
///
/// When false, uses insecure (plaintext) credentials suitable only for
/// development environments.
final bool useTls;
/// Whether to allow self-signed certificates.
///
/// Only applicable when [useTls] is true. Useful for development
/// environments with self-signed certificates.
final bool allowSelfSignedCertificate;
const GrpcConfig({
required this.host,
required this.port,
this.timeout = const Duration(seconds: 30),
this.useTls = true,
this.allowSelfSignedCertificate = false,
});
/// Development configuration pointing to local/development gRPC server.
///
/// Uses TLS with self-signed certificate support for local HTTPS.
static const GrpcConfig development = GrpcConfig(
host: 'localhost',
port: 5011,
timeout: Duration(seconds: 30),
useTls: true,
allowSelfSignedCertificate: true,
);
/// Production configuration for the Plan B Logistics gRPC server.
///
/// Uses TLS for secure communication.
static const GrpcConfig production = GrpcConfig(
host: 'grpc-route.goutezplanb.com',
port: 443,
timeout: Duration(seconds: 30),
useTls: true,
allowSelfSignedCertificate: false,
);
/// Returns the full address string in the format "host:port".
String get address => '$host:$port';
}