price per item is printed

This commit is contained in:
atseirjo
2026-10-28 12:32:49 +01:00
parent c32adbad50
commit 77fbe16867
31 changed files with 656 additions and 55 deletions
+49 -42
View File
@@ -9,51 +9,58 @@ class BauteilPhotoPicker extends StatelessWidget {
final BauteilController controller;
@override
Widget build(BuildContext context) => Obx(
() => Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BauteilPhoto(bytes: controller.foto.value),
const SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Widget build(BuildContext context) => LayoutBuilder(
builder: (context, constraints) => Obx(() {
final photo = BauteilPhoto(bytes: controller.foto.value);
final controls = Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Bauteilfoto (optional)',
style: TextStyle(fontWeight: FontWeight.w600),
),
const SizedBox(height: 8),
Wrap(
spacing: 8,
runSpacing: 8,
children: [
const Text(
'Bauteilfoto (optional)',
style: TextStyle(fontWeight: FontWeight.w600),
),
const SizedBox(height: 8),
Wrap(
spacing: 8,
runSpacing: 8,
children: [
OutlinedButton.icon(
onPressed:
controller.isPickingPhoto.value ||
controller.isSaving.value
? null
: controller.pickPhoto,
icon: const Icon(Icons.add_photo_alternate_outlined),
label: Text(
controller.isPickingPhoto.value
? 'Wird geladen …'
: 'Foto auswählen',
),
),
if (controller.foto.value != null)
TextButton(
onPressed: controller.isSaving.value
? null
: controller.removePhoto,
child: const Text('Foto entfernen'),
),
],
OutlinedButton.icon(
onPressed:
controller.isPickingPhoto.value || controller.isSaving.value
? null
: controller.pickPhoto,
icon: const Icon(Icons.add_photo_alternate_outlined),
label: Text(
controller.isPickingPhoto.value
? 'Wird geladen …'
: 'Foto auswählen',
),
),
if (controller.foto.value != null)
TextButton(
onPressed: controller.isSaving.value
? null
: controller.removePhoto,
child: const Text('Foto entfernen'),
),
],
),
),
],
),
],
);
if (constraints.maxWidth < 400) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [photo, const SizedBox(height: 12), controls],
);
}
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
photo,
const SizedBox(width: 16),
Expanded(child: controls),
],
);
}),
);
}