1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Restrict change in value of valueNotifier.value

Discussão em 'Mobile' iniciado por Stack, Outubro 10, 2024 às 11:22.

  1. Stack

    Stack Membro Participativo

    I want to check in my app anywhere if the user is an admin or not. For that, I am first fetching the admins list from the server and set a global file that contains ValueNotifier<bool> admin to notify if we have set or change the value of admin after fetching the admin list. But problem is that admin.value setter will also be accessible to all files to set its value, but I want to restrict it such that the value of admin can only be changed in Networks class or Network files or any other specific files, while I want to listen on its changes anywhere possible. Can anyone help me?

    Continue reading...

Compartilhe esta Página