Closed
Description
suppose I registered a repo like this
sl.registerLazySingleton<CalenderMonthRepository>(()=>CalenderMonthRepositoryImpl(
local: sl(),
remote: sl(),
location: sl(),
notificationsDataSource: sl(),
all local, remote,location and notificationsDataSource are lazySingletons too,
I have this static function
static Future<CalenderMonth> getCalenderMonth(CalenderMonthRepository repository ) async{
//use repository
}
and I am calling compute function like this
CalenderMonth calenderMonth= await compute(getCalenderMonth,repository);
the issue is when I pass it to another isolate via dart compute function which should run on another isolate I get error of not reachable code .
the question is how to use lazySingletons like these on other isolates ?
Metadata
Metadata
Assignees
Labels
No labels