manual_screen.dart 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. import 'package:flutter/material.dart';
  2. import '../constants/mpob_colors.dart';
  3. import '../services/app_strings.dart';
  4. import '../theme/locale_controller.dart';
  5. class ManualScreen extends StatelessWidget {
  6. const ManualScreen({super.key});
  7. @override
  8. Widget build(BuildContext context) {
  9. return ValueListenableBuilder<String>(
  10. valueListenable: LocaleController.localeCode,
  11. builder: (context, _, _) {
  12. final colorScheme = Theme.of(context).colorScheme;
  13. return Scaffold(
  14. appBar: AppBar(title: Text(AppStrings.t('manual_title'))),
  15. body: ListView(
  16. padding: const EdgeInsets.symmetric(vertical: 8),
  17. children: [
  18. _buildSection(
  19. icon: Icons.photo_library,
  20. title: AppStrings.t('manual_gallery_title'),
  21. body: AppStrings.t('manual_gallery_body'),
  22. ),
  23. _buildSection(
  24. icon: Icons.camera_alt,
  25. title: AppStrings.t('manual_snap_title'),
  26. body: AppStrings.t('manual_snap_body'),
  27. ),
  28. _buildSection(
  29. icon: Icons.camera,
  30. title: AppStrings.t('manual_live_title'),
  31. body: AppStrings.t('manual_live_body'),
  32. ),
  33. _buildSection(
  34. icon: Icons.history,
  35. title: AppStrings.t('manual_history_title'),
  36. body: AppStrings.t('manual_history_body'),
  37. ),
  38. _buildSection(
  39. icon: Icons.edit_outlined,
  40. title: AppStrings.t('manual_correction_title'),
  41. body: AppStrings.t('manual_correction_body'),
  42. ),
  43. _buildSection(
  44. icon: Icons.insights,
  45. title: AppStrings.t('manual_batch_title'),
  46. body: AppStrings.t('manual_batch_body'),
  47. ),
  48. ExpansionTile(
  49. leading: const Icon(Icons.palette_outlined),
  50. title: Text(AppStrings.t('manual_classes_title')),
  51. children: mpobClasses.map((key) {
  52. return Padding(
  53. padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
  54. child: Row(
  55. crossAxisAlignment: CrossAxisAlignment.start,
  56. children: [
  57. Container(
  58. width: 14,
  59. height: 14,
  60. margin: const EdgeInsets.only(top: 3),
  61. decoration: BoxDecoration(
  62. color: getMPOBColor(key),
  63. shape: BoxShape.circle,
  64. ),
  65. ),
  66. const SizedBox(width: 10),
  67. Expanded(
  68. child: Column(
  69. crossAxisAlignment: CrossAxisAlignment.start,
  70. children: [
  71. Text(
  72. AppStrings.className(key),
  73. style: TextStyle(fontWeight: FontWeight.bold, color: colorScheme.onSurface),
  74. ),
  75. const SizedBox(height: 2),
  76. Text(
  77. AppStrings.t('manual_class_desc_$key'),
  78. style: TextStyle(fontSize: 13, color: colorScheme.onSurface.withValues(alpha: 0.75)),
  79. ),
  80. ],
  81. ),
  82. ),
  83. ],
  84. ),
  85. );
  86. }).toList(),
  87. ),
  88. ],
  89. ),
  90. );
  91. },
  92. );
  93. }
  94. Widget _buildSection({required IconData icon, required String title, required String body}) {
  95. return ExpansionTile(
  96. leading: Icon(icon),
  97. title: Text(title),
  98. children: [
  99. Padding(
  100. padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
  101. child: Text(body),
  102. ),
  103. ],
  104. );
  105. }
  106. }