mudular code ready to fork
This commit is contained in:
@@ -1,22 +1,8 @@
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import '../core/exceptions/invalid_environment_exception.dart';
|
||||
import 'app_config.dart';
|
||||
import '../data/firebase/models/firebase_config.dart';
|
||||
|
||||
/// Exception thrown when an invalid environment is provided to [ConfigLoader].
|
||||
class InvalidEnvironmentException implements Exception {
|
||||
/// The invalid environment that was provided.
|
||||
final String environment;
|
||||
|
||||
/// Creates an [InvalidEnvironmentException] with the provided environment.
|
||||
InvalidEnvironmentException(this.environment);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'InvalidEnvironmentException: Invalid environment "$environment". '
|
||||
'Valid environments are: dev, prod';
|
||||
}
|
||||
}
|
||||
|
||||
/// Loads application configuration based on the specified environment.
|
||||
///
|
||||
/// This class provides a factory method to load configuration for either
|
||||
|
||||
Reference in New Issue
Block a user