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 BaseUrl { | |
String get url; | |
} | |
/// [Environment] has pre-defined values as prod, dev, test. | |
/// You can define yours by Environment('ENV_NAME') | |
@Environment(Environment.prod) | |
@Singleton(as: BaseUrl) | |
class ProdBaseUrl implements BaseUrl{ | |
@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 NotificationRepository { | |
Future<void> sendNotification(); | |
} | |
class FirebaseNotificationRepository implements NotificationRepository { | |
@override | |
Future<void> sendNotification(){ | |
// TODO: implement | |
} | |
} |
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); | |
final LocalMusicRepository _local; | |
final RemoteMusicRepository _remote; | |
final NetworkConnectivity _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<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'; | |
@LazySingleton(as: MusicRepository) | |
class MusicRepositoryImp implements MusicRepository { | |
MusicRepositoryImp(this._local, this._remote, this._networkConnectivity); | |
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'; | |
@LazySingleton(as: MusicRepository) | |
class MusicRepositoryImp implements MusicRepository { | |
MusicRepositoryImp(this._local, this._remote, this._networkConnectivity); | |
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<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 { | |
@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'; | |
@LazySingleton(as: MusicRepository) | |
class MusicRepositoryImp implements MusicRepository { | |
MusicRepositoryImp( | |
this._local, | |
this._remote, | |
this._networkConnectivity, | |
); |
NewerOlder