user_profile.dart 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import 'package:flutter/material.dart';
  2. @immutable
  3. final class UserProfile {
  4. const UserProfile({
  5. required this.name,
  6. required this.role,
  7. required this.employeeId,
  8. required this.avatarText,
  9. required this.monthlyCount,
  10. required this.passRate,
  11. required this.activeProjects,
  12. });
  13. final String name;
  14. final String role;
  15. final String employeeId;
  16. final String avatarText;
  17. final int monthlyCount;
  18. final String passRate;
  19. final int activeProjects;
  20. UserProfile copyWith({
  21. String? name,
  22. String? role,
  23. String? employeeId,
  24. String? avatarText,
  25. int? monthlyCount,
  26. String? passRate,
  27. int? activeProjects,
  28. }) {
  29. return UserProfile(
  30. name: name ?? this.name,
  31. role: role ?? this.role,
  32. employeeId: employeeId ?? this.employeeId,
  33. avatarText: avatarText ?? this.avatarText,
  34. monthlyCount: monthlyCount ?? this.monthlyCount,
  35. passRate: passRate ?? this.passRate,
  36. activeProjects: activeProjects ?? this.activeProjects,
  37. );
  38. }
  39. }
  40. @immutable
  41. final class SettingsSection {
  42. const SettingsSection({required this.title, required this.items});
  43. final String title;
  44. final List<SettingsItem> items;
  45. }
  46. @immutable
  47. final class SettingsItem {
  48. const SettingsItem({
  49. required this.icon,
  50. required this.label,
  51. this.iconBgColor,
  52. this.iconColor,
  53. this.value,
  54. this.showArrow = true,
  55. this.onTap,
  56. });
  57. final String icon;
  58. final String label;
  59. final Color? iconBgColor;
  60. final Color? iconColor;
  61. final String? value;
  62. final bool showArrow;
  63. final VoidCallback? onTap;
  64. }