getPermission static method

Future<void> getPermission({
  1. bool hasCTV = false,
})

Implementation

static Future<void> getPermission({bool hasCTV = false}) => SharedPreferences.getInstance().then((prefs) {
  if (hasCTV) Constants().contributeRole = jsonDecode(prefs.getString('contribute_role')??'{}');
  else {
    Constants().permission = prefs.getString('manager_type')??'member';
    Constants().userId = prefs.getInt('id');
  }
});