Skip to content

Commit

Permalink
add slang to barcode panel
Browse files Browse the repository at this point in the history
  • Loading branch information
karolgeneral committed Jul 16, 2024
1 parent 5ecf734 commit bd5e499
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
6 changes: 4 additions & 2 deletions lib/ i18n/strings.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 1
/// Strings: 18
/// Strings: 19
///
/// Built on 2024-07-16 at 06:05 UTC
/// Built on 2024-07-16 at 09:22 UTC
// coverage:ignore-file
// ignore_for_file: type=lint
Expand Down Expand Up @@ -156,6 +156,7 @@ class Translations implements BaseTranslations<AppLocale, Translations> {
String get error1 => 'Description cannot be empty';
String get error2 => 'Barcode cannot be empty';
String get error3 => 'Invalid barcode';
String get codetype => 'Code type';
String get dsc1 => 'Company not verified';
String get dsc2 => 'Company verified with full scores';
String get dsc3 => 'Company verified with incomplete scores';
Expand All @@ -182,6 +183,7 @@ extension on Translations {
case 'error1': return 'Description cannot be empty';
case 'error2': return 'Barcode cannot be empty';
case 'error3': return 'Invalid barcode';
case 'codetype': return 'Code type';
case 'dsc1': return 'Company not verified';
case 'dsc2': return 'Company verified with full scores';
case 'dsc3': return 'Company verified with incomplete scores';
Expand Down
1 change: 1 addition & 0 deletions lib/ i18n/strings.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"error1": "Opis nie może być pusty",
"error2": "Kod kreskowy nie może być pusty",
"error3": "Nieprawidłowy kod kreskowy",
"codetype": "Typ kodu",
"barcodesDescription": {
"dsc1": "Firma nie zweryfikowana",
"dsc2": "Firma zweryfikowana z pełną punktacją",
Expand Down
1 change: 1 addition & 0 deletions lib/ i18n/strings_en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"error1": "Description cannot be empty",
"error2": "Barcode cannot be empty",
"error3": "Invalid barcode",
"codetype": "Code type",
"dsc1": "Company not verified",
"dsc2": "Company verified with full scores",
"dsc3": "Company verified with incomplete scores",
Expand Down
16 changes: 8 additions & 8 deletions lib/barcodes_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class BarcodesPanelState extends State<BarcodesPanel> {
widget.onAddBarcode(description, data, barcodeType.barcode);
_descriptionController.clear();
_dataController.clear();
} catch (e) {
} else {
_dataError = Translations.of(context).error3;
}
}
Expand Down Expand Up @@ -78,15 +78,15 @@ class BarcodesPanelState extends State<BarcodesPanel> {
);
}

Widget _dropdownField() {
return Expanded(
Widget _dropdownField(BuildContext context) {
return Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
children: [
DropdownButtonFormField<custom.BarcodeType>(
value: _selectedBarcodeType,
decoration: const InputDecoration(
labelText: "Typ kodu",
decoration: InputDecoration(
labelText: Translations.of(context).codetype,
),
items: custom.BarcodeType.values.map((custom.BarcodeType type) {
return DropdownMenuItem<custom.BarcodeType>(
Expand Down Expand Up @@ -121,13 +121,13 @@ class BarcodesPanelState extends State<BarcodesPanel> {
const SizedBox(width: Constants.fieldSpacing),
_textField(_dataController, Translations.of(context).kod, _dataError),
const SizedBox(width: Constants.fieldSpacing),
_dropdownField(),
_dropdownField(context),
const SizedBox(width: Constants.fieldSpacing),
Padding(
padding: const EdgeInsets.only(top: Constants.errorHeight),
child: ElevatedButton(
onPressed: _handleAddBarcode,
child: const Text (Translations.of(context).kodplus),
child: Text (Translations.of(context).kodplus),
),
),
],
Expand Down

0 comments on commit bd5e499

Please sign in to comment.