Skip to content

Instantly share code, notes, and snippets.

View dokumanx's full-sized avatar
🏠
Working from home

Nahit Fidancı dokumanx

🏠
Working from home
View GitHub Profile
import 'package:injectable/injectable.dart';
@LazySingleton(as: MusicRepository)
class MusicRepositoryImp implements MusicRepository {
MusicRepositoryImp(
this._local,
this._remote,
this._networkConnectivity,
);
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;
import 'package:injectable/injectable.dart';
abstract class MusicRepository {
Future<List<Music>> getMusicList();
}
class LocalMusicRepository {
@override
Future<List<Music>> getMusicList() {
// TODO: implement getMusicList
import 'package:injectable/injectable.dart';
abstract class MusicRepository {
Future<Either<Failure, List<Music>>> getMusicList();
}
class LocalMusicRepository {
@override
Future<List<Music>> getMusicList() {
// TODO: implement getMusicList
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
abstract class MusicRepository {
Future<List<Music>> getMusicList();
}
class LocalMusicRepository implements MusicRepository {
@override
Future<List<Music>> getMusicList() {
// TODO: implement getMusicList
}
}
part 'env_prod.g.dart';
@Envied(
path: 'environment/.env.prod',
obfuscate: true,
)
class ProductionSecret implements AppSecret, AppEnvFields {
ProductionSecret();
@override
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;
}
abstract class AppSecret implements AppEnvFields {
static const String environment = EnvironmentConfig.env;
static final AppSecret _instance =
environment == 'prod' ? ProductionSecret() : DevelopmentSecret();
factory AppSecret() => _instance;
}
abstract class AppEnvFields {
String get secretKey;
}