Fixes reported from APK field testing: DO/Product scan mode was inconsistent between the camera drawer and documents screen (now one shared provider, with an orange/green color cue); unconfirmed scans leaked into history with placeholder data before the user tapped confirm (backend now gates GET /documents on a new `confirmed` column, flipped only by PUT); and Product Scan ran the GPU classifier twice, once at upload and again on review (now a single pass at upload, persisted and read directly by the editor). Also removes the unused "Hubungkan ke PO" field and fabricated PO/SO/DO placeholder values from the Product Scan flow, closes out the per-document-polling and save-recovery tasks (6.1/6.3), and splits several touched files to stay under the repo's 256-line guideline. Full detail in docs/iteration-log.md and backend/docs/iteration-log.md. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
79 lines
2.2 KiB
Dart
79 lines
2.2 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'),
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|