auto-claude/001-normalize-code-update-packages-widgetify-component #1

Merged
mathias merged 12 commits from auto-claude/001-normalize-code-update-packages-widgetify-component into main 2026-01-20 12:25:49 -05:00
Showing only changes of commit c8c2ec0921 - Show all commits
+10 -55
View File
@@ -13,6 +13,8 @@ import '../models/delivery_commands.dart';
import '../components/map_sidebar_layout.dart';
import '../components/dark_mode_map.dart';
import '../components/unified_delivery_list.dart';
import '../components/loading_dialog.dart';
import '../components/photo_capture_dialog.dart';
import '../utils/toast_helper.dart';
class DeliveriesPage extends ConsumerStatefulWidget {
@@ -410,38 +412,10 @@ class _DeliveriesPageState extends ConsumerState<DeliveriesPage> {
if (!context.mounted) return;
final bool? confirmed = await showDialog<bool>(
context: context,
builder: (BuildContext dialogContext) {
return AlertDialog(
title: const Text('Confirm Photo'),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Image.file(
File(pickedFile!.path),
height: 300,
fit: BoxFit.contain,
),
const SizedBox(height: 16),
Text(
'Upload this photo for ${delivery.name}?',
textAlign: TextAlign.center,
),
],
),
actions: [
TextButton(
onPressed: () => Navigator.of(dialogContext).pop(false),
child: Text(AppLocalizations.of(context)!.cancel),
),
ElevatedButton(
onPressed: () => Navigator.of(dialogContext).pop(true),
child: Text(AppLocalizations.of(context)!.upload),
),
],
);
},
final bool? confirmed = await PhotoCaptureDialog.show(
context,
imageFile: File(pickedFile.path),
deliveryName: delivery.name,
);
if (confirmed != true) {
@@ -450,27 +424,8 @@ class _DeliveriesPageState extends ConsumerState<DeliveriesPage> {
if (!context.mounted) return;
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext dialogContext) {
return const Center(
child: Card(
child: Padding(
padding: EdgeInsets.all(24.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
CircularProgressIndicator(),
SizedBox(height: 16),
Text('Uploading photo...'),
],
),
),
),
);
},
);
final localizations = AppLocalizations.of(context);
LoadingDialog.show(context, message: localizations.uploadingPhoto);
try {
final Uri uploadUrl = Uri.parse(
@@ -485,7 +440,7 @@ class _DeliveriesPageState extends ConsumerState<DeliveriesPage> {
final http.Response response = await http.Response.fromStream(streamedResponse);
if (context.mounted) {
Navigator.of(context).pop();
LoadingDialog.hide(context);
}
if (response.statusCode >= 200 && response.statusCode < 300) {
@@ -501,7 +456,7 @@ class _DeliveriesPageState extends ConsumerState<DeliveriesPage> {
}
} catch (e) {
if (context.mounted) {
Navigator.of(context).pop();
LoadingDialog.hide(context);
ToastHelper.showError(context, 'Upload error: $e');
}
}