Getx: Can't delete GetxService with force: true

Created on 20 Jan 2021  路  7Comments  路  Source: jonataslaw/getx

Screenshots
image
image
image

Why service doesn't get deleted, despite logs are saying it did?
As seen from the screenshot, I can access it afterwards. Thank you in advance!

Expected behavior
Error, when trying to access deleted service with Get.find()

Flutter Version:
1.22.5

Getx Version:
3.24.0

Most helpful comment

@Apollo108, replace

static FakeService to = Get.find();

with

static FakeService get to => Get.find();

All 7 comments

Thank you for the fast response. But Get.reset() will destroy everything, and I need to do that selectively. Is there any option for that purpose? Probably I can use GetxController instead? Will delete() work for it?

Exactly, if you use GetxController you can do the selective Delete

Just attempted to do this - the result is exactly the same as for GetxService... And I also noticed that I can find controllers after being disposed. @eduardoflorence, do you have any clue why?

@jonataslaw I'm sorry, but can I expect any answer from you, or anybody? Thank you in advance)

@Apollo108, replace

static FakeService to = Get.find();

with

static FakeService get to => Get.find();

You just saved my day, good sir! Omg, a GetxService gets deleted too! Thank you very much, I think your response deserves to be carved in the tables of documentation to this awesome library!)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wailashraf71 picture wailashraf71  路  4Comments

rupamking1 picture rupamking1  路  3Comments

GoldenSoju picture GoldenSoju  路  3Comments

omartinma picture omartinma  路  3Comments

NO-ob picture NO-ob  路  4Comments