diff --git a/lib/dashboard_latest/widgets/app_bar_widget.dart b/lib/dashboard_latest/widgets/app_bar_widget.dart index 39a97f7a..a08a9809 100644 --- a/lib/dashboard_latest/widgets/app_bar_widget.dart +++ b/lib/dashboard_latest/widgets/app_bar_widget.dart @@ -145,7 +145,7 @@ class _AppBarWidgetState extends State with TickerProviderStateMix style: AppTextStyles.heading6.copyWith(color: AppColor.headingTextColor(context), fontSize: context.isTablet() ? 14 : null), ), Text( - snapshot.user?.type?.name.toCamelCase ?? "", + snapshot.user?.roleName ?? "", style: AppTextStyles.bodyText.copyWith(color: AppColor.lightTextColor(context), fontSize: context.isTablet() ? 12 : null), ), ], diff --git a/lib/models/user.dart b/lib/models/user.dart index aa3389dc..608e0989 100644 --- a/lib/models/user.dart +++ b/lib/models/user.dart @@ -100,6 +100,8 @@ class User { return {"username": userName, "password": password, "fireBaseToken": FirebaseNotificationManger?.token ?? "", "notificationType": notificationType}; } + String get roleName => userRoles?.first.name ?? ""; + UsersTypes? get type { switch (userRoles?.first.value) { case "R-6":