Files
pfm-ocr/lib/features/camera/camera_drawer_helpers.dart
T
fhanyuh caf8e98378 chore: normalize line endings (CRLF -> LF)
No content changes: git diff --ignore-all-space over these files is empty.
The churn came from editing on Windows against a repo checked out with LF.
2026-08-27 10:40:49 +07:00

79 lines
2.3 KiB
Dart

import 'package:flutter/material.dart';
import '../../config/app_config.dart';
/// Stateless helper functions extracted from [CameraDrawer] to keep that
/// file under the AGENTS.md §3 256-line threshold (touched in task 8.1).
/// Contains only UI helpers with no side-effects or state.
Widget buildDrawerSectionHeader(String title) {
return Padding(
padding: const EdgeInsets.only(left: 16.0, top: 8.0, bottom: 8.0),
child: Text(
title,
style: AppConfig.bodySmall.copyWith(
color: Colors.grey.shade400,
fontWeight: FontWeight.bold,
fontSize: 11,
letterSpacing: 1.0,
),
),
);
}
Widget buildDrawerItem({
required IconData icon,
required String title,
required VoidCallback onTap,
Color? textColor,
Color? iconColor,
}) {
return ListTile(
leading: Icon(icon, color: iconColor ?? Colors.black87),
title: Text(
title,
style: AppConfig.bodyLarge.copyWith(
color: textColor ?? Colors.black87,
fontWeight: FontWeight.w500,
),
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
onTap: onTap,
);
}
void showDrawerNotImplemented(BuildContext context, String featureName) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(' feature coming soon!'),
behavior: SnackBarBehavior.floating,
),
);
}
void showDrawerHelpDialog(BuildContext context) {
showDialog(
context: context,
builder: (ctx) => AlertDialog(
title: const Text('Tentang Prima Mart'),
content: const SingleChildScrollView(
child: Text(
'www.primafreshmart.com merupakan sarana belanja online dari toko Prima Mart '
'yang sudah melayani konsumen selama 10 tahun dan memiliki hampir 1200 gerai '
'di Pulau Jawa, Bali dan Sumatera. Inovasi terbaru dari PT. Primafood '
'International sebagai bagian dari PT. Charoen Pokphand Indonesia, Tbk.\n\n'
'PT. Primafood International\n'
'Jl. Ancol Barat VIII no.1, Ancol, Pademangan, Jakarta Utara, DKI Jakarta.',
),
),
actions: [
TextButton(
onPressed: () => Navigator.pop(ctx),
child: const Text('Tutup'),
)
],
),
);
}