settings_menu_item.dart 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import 'package:flutter/material.dart';
  2. import 'package:asr_client/models/user_profile.dart';
  3. import 'package:asr_client/theme/app_colors.dart';
  4. class SettingsMenuItem extends StatelessWidget {
  5. const SettingsMenuItem({super.key, required this.item});
  6. final SettingsItem item;
  7. @override
  8. Widget build(BuildContext context) {
  9. return ListTile(
  10. contentPadding: const EdgeInsets.symmetric(horizontal: 14, vertical: 2),
  11. leading: Container(
  12. width: 34,
  13. height: 34,
  14. decoration: BoxDecoration(
  15. color: item.iconBgColor ?? AppColors.bg,
  16. borderRadius: BorderRadius.circular(9),
  17. ),
  18. child: Center(
  19. child: Text(item.icon, style: const TextStyle(fontSize: 16)),
  20. ),
  21. ),
  22. title: Text(
  23. item.label,
  24. style: const TextStyle(
  25. fontSize: 14,
  26. fontWeight: FontWeight.w600,
  27. color: AppColors.ink,
  28. ),
  29. ),
  30. trailing: Row(
  31. mainAxisSize: MainAxisSize.min,
  32. children: [
  33. if (item.value != null)
  34. Text(
  35. item.value!,
  36. style: const TextStyle(fontSize: 12, color: AppColors.ink3),
  37. ),
  38. if (item.showArrow) ...[
  39. const SizedBox(width: 6),
  40. const Icon(Icons.chevron_right, color: AppColors.ink3, size: 20),
  41. ],
  42. ],
  43. ),
  44. onTap: item.onTap,
  45. );
  46. }
  47. }