removed auth from picture upload

This commit is contained in:
verboomp
2026-02-02 08:13:28 +01:00
parent 94c6becf9f
commit 33ee33d55c
7 changed files with 29 additions and 31 deletions

View File

@@ -63,7 +63,17 @@ class _CustomerWidgetState extends State<CustomerWidget> {
}
if (snapshot.hasData) {
CustomerDto? dto = snapshot.data;
if (dto == null) {
return Text(
AppLocalizations.of(context)!.customerWidgetNotFound,
style: TextStyle(
fontFamily: _generalStyle.fontFamily,
fontWeight: FontWeight.bold,
fontSize: 20,
color: _generalStyle.secondaryWidgetBackgroundColor,
),
);
}
return _mainWidget(dto);
} else if (snapshot.hasError) {
var error = snapshot.error;
@@ -74,19 +84,7 @@ class _CustomerWidgetState extends State<CustomerWidget> {
);
}
Widget _mainWidget(CustomerDto? dto) {
if (dto == null) {
return Text(
AppLocalizations.of(context)!.customerWidgetNotFound,
style: TextStyle(
fontFamily: _generalStyle.fontFamily,
fontWeight: FontWeight.bold,
fontSize: 20,
color: _generalStyle.secondaryWidgetBackgroundColor,
),
);
}
Widget _mainWidget(CustomerDto dto) {
var subText = AppLocalizations.of(context)!.customerWidgetCustomerNumberPrefix(dto.customerNumber);
return Column(
mainAxisAlignment: MainAxisAlignment.start,
@@ -97,7 +95,7 @@ class _CustomerWidgetState extends State<CustomerWidget> {
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
_downloadButton(context),
_downloadButton(context, dto),
],
),
const SizedBox(height: 24),
@@ -263,7 +261,7 @@ class _CustomerWidgetState extends State<CustomerWidget> {
Icons.file_download_outlined,
color: _generalStyle.loginFormTextLabelColor,
),
onPressed: () => _actionDelete(context, customerDto, pictureDto),
onPressed: () => _actionDownload(context, customerDto, pictureDto),
),
),
SizedBox(
@@ -283,10 +281,10 @@ class _CustomerWidgetState extends State<CustomerWidget> {
);
}
Widget _downloadButton(BuildContext context) {
Widget _downloadButton(BuildContext context, CustomerDto customerDto) {
return ElevatedButton.icon(
key: Key("download_all_button"),
onPressed: () => _actionDownload(context),
onPressed: () => _actionDownload(context, customerDto, null),
iconAlignment: IconAlignment.end,
icon: Icon(
Icons.file_download_outlined,
@@ -328,14 +326,14 @@ class _CustomerWidgetState extends State<CustomerWidget> {
}
Future<void> _actionSelect(BuildContext context, CustomerDto customerDto, PictureDto pictureDto) async {
String uri = "${GlobalRouter.pathHome}${GlobalRouter.pathCustomer}/${customerDto.id}${GlobalRouter.pathPicture}/${pictureDto.id}";
String uri = "${GlobalRouter.pathHome}${GlobalRouter.pathCustomer}/${customerDto.id}${GlobalRouter.pathPicture}/${pictureDto.id}";
context.go(uri);
setState(() {
_dto = _customerController.get(id: widget.customerId);
});
}
Future<void> _actionDownload(BuildContext context) async {
Future<void> _actionDownload(BuildContext context, CustomerDto customerDto, PictureDto? pictureDto) async {
// FIXME: implement a download from the export
}
}