lucavenir / go_router_riverpod

An example on how to use Riverpod + GoRouter
469 stars 70 forks source link

Stupid question about private variables #2

Closed JasCodes closed 2 years ago

JasCodes commented 2 years ago

Hi @lucavenir

   ...
    redirect: router._redirect, // All the logic is centralized here
    routes: router._routes,
   ...

How come private variable _redirect and _routes are accessible?

Thanks Jas

alaazamelDev commented 2 years ago

How come private variable _redirect and _routes are accessible?

Private fields are intended to be visible outside of the class in which they are declared. They are private to the library in which they are declared. See the explanation in the Language Tour.

JasCodes commented 2 years ago

Lol thanks!!