This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:injectable/injectable.dart'; | |
@LazySingleton(as: MusicRepository) | |
class MusicRepositoryImp implements MusicRepository { | |
MusicRepositoryImp( | |
this._local, | |
this._remote, | |
this._networkConnectivity, | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:injectable/injectable.dart'; | |
@LazySingleton(as: MusicRepository) | |
class MusicRepositoryImp implements MusicRepository { | |
MusicRepositoryImp(this._local, this._remote); | |
final LocalMusicRepository _local; | |
final MusicRepository _remote; | |
final RemoteMusicRepository _networkConnectivity; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:injectable/injectable.dart'; | |
abstract class MusicRepository { | |
Future<List<Music>> getMusicList(); | |
} | |
class LocalMusicRepository { | |
@override | |
Future<List<Music>> getMusicList() { | |
// TODO: implement getMusicList |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:injectable/injectable.dart'; | |
abstract class MusicRepository { | |
Future<Either<Failure, List<Music>>> getMusicList(); | |
} | |
class LocalMusicRepository { | |
@override | |
Future<List<Music>> getMusicList() { | |
// TODO: implement getMusicList |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:injectable/injectable.dart'; | |
abstract class MusicRepository { | |
Future<Either<Failure, List<Music>>> getMusicList(); | |
} | |
class LocalMusicRepository implements MusicRepository { | |
@override | |
Future<List<Music>> getMusicList() { | |
// TODO: implement getMusicList |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class MusicRepository { | |
Future<List<Music>> getMusicList(); | |
} | |
class LocalMusicRepository implements MusicRepository { | |
@override | |
Future<List<Music>> getMusicList() { | |
// TODO: implement getMusicList | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
part 'env_prod.g.dart'; | |
@Envied( | |
path: 'environment/.env.prod', | |
obfuscate: true, | |
) | |
class ProductionSecret implements AppSecret, AppEnvFields { | |
ProductionSecret(); | |
@override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class AppSecret implements AppEnvFields { | |
static const String environment = String.fromEnvironment('ENV', defaultValue: 'prod'); | |
static final AppSecret _instance = | |
environment == 'prod' ? ProductionSecret() : DevelopmentSecret(); | |
factory AppSecret() => _instance; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class AppSecret implements AppEnvFields { | |
static const String environment = EnvironmentConfig.env; | |
static final AppSecret _instance = | |
environment == 'prod' ? ProductionSecret() : DevelopmentSecret(); | |
factory AppSecret() => _instance; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class AppEnvFields { | |
String get secretKey; | |
} |