FEATURE character validation

This commit is contained in:
konrad.lys@eu.equinix.com
2023-06-09 19:24:05 +02:00
parent 421479d280
commit 5270c37a5b
3 changed files with 16 additions and 1 deletions

View File

@@ -180,6 +180,14 @@ class _ScannerPageState extends State<ScannerPage>
.of(context)! .of(context)!
.thisFieldIsRequired; .thisFieldIsRequired;
} }
if (value?.trim().contains(
RegExp(
r'[<>:"/|?*]')) ??
true) {
return S
.of(context)!
.invalidFilenameCharacter;
}
return null; return null;
}, },
decoration: InputDecoration( decoration: InputDecoration(
@@ -326,7 +334,6 @@ class _ScannerPageState extends State<ScannerPage>
await cubit.saveLocally( await cubit.saveLocally(
file.bytes, fileName, globalSettings.preferredLocaleSubtag); file.bytes, fileName, globalSettings.preferredLocaleSubtag);
_downloadFormKey.currentState!.save();
} catch (error) { } catch (error) {
showGenericError(context, error); showGenericError(context, error);
} }

View File

@@ -815,5 +815,9 @@
"export": "Export", "export": "Export",
"@export": { "@export": {
"description": "Label for button that exports scanned images to pdf (before upload)" "description": "Label for button that exports scanned images to pdf (before upload)"
},
"invalidFilenameCharacter": "Invalid filename character found",
"@invalidFilenameCharacter": {
"description": "For validating filename in export dialogue"
} }
} }

View File

@@ -815,5 +815,9 @@
"export": "Eksport", "export": "Eksport",
"@export": { "@export": {
"description": "Label for button that exports scanned images to pdf (before upload)" "description": "Label for button that exports scanned images to pdf (before upload)"
},
"invalidFilenameCharacter": "Znaleziono niedozwolony znak w nazwie pliku",
"@invalidFilenameCharacter": {
"description": "For validating filename in export dialogue"
} }
} }