I have a multilevel user app in which I have implemented role based widget. Such as;
final user=Provider.of<UserNotifier>(context).getRole(); //returns role string
(user=="Admin")?SomeWidget():Container(),
There is another option such as:
Visibility (
visible: (user=="Admin"),
child: SomeWidget()
),
Which would be the best approach among this two?