Erweiterungen
This commit is contained in:
1 parent
955d7b3cb4
commit
e9811da904
25 files changed
+1505
-128
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/app_localizations.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
showComissionNumberPopup(BuildContext context, TaskInfo taskInfo, Function(String) onFinished) async {
|
||||
@@ -42,15 +43,15 @@ showComissionNumberPopup(BuildContext context, TaskInfo taskInfo, Function(Strin
|
||||
padding: const EdgeInsets.all(35.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const Text('Bitte geben Sie die Kommisionsnummer ein'),
|
||||
Text('enter_commission_number'.tr),
|
||||
const SizedBox(height: 20),
|
||||
Util.getDefaultTextField('Kommisionsnummer',
|
||||
Util.getDefaultTextField('commission_number_hint'.tr,
|
||||
textInputType: TextInputType.text,
|
||||
formatter: [FilteringTextInputFormatter.singleLineFormatter],
|
||||
controller: textEditingController,
|
||||
autofocus: true),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Übernehmen', () {
|
||||
getDefaultButton('apply'.tr, () {
|
||||
final result = textEditingController.text;
|
||||
textEditingController.dispose();
|
||||
Navigator.of(context).pop();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/model/tour_task.dart';
|
||||
import 'package:stadtbote/tools/app_localizations.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
showPickupDeliveryStatusPopup(BuildContext context, TaskInfo taskInfo, Function(TourEntry?, String? remark) onFinished) async {
|
||||
@@ -58,7 +59,7 @@ showPickupDeliveryStatusPopup(BuildContext context, TaskInfo taskInfo, Function(
|
||||
DropdownMenu<TourEntry>(
|
||||
expandedInsets: const EdgeInsets.all(0),
|
||||
controller: controller,
|
||||
hintText: 'Status',
|
||||
hintText: 'status'.tr,
|
||||
onSelected: (TourEntry? value) {
|
||||
selectedTourEntry = value;
|
||||
|
||||
@@ -68,9 +69,9 @@ showPickupDeliveryStatusPopup(BuildContext context, TaskInfo taskInfo, Function(
|
||||
dropdownMenuEntries: entries,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Visibility(visible: selectedTourEntry != null ? selectedTourEntry!.queryRemark : false, child: Util.getDefaultTextField(controller: remController, "Bemerkung")),
|
||||
Visibility(visible: selectedTourEntry != null ? selectedTourEntry!.queryRemark : false, child: Util.getDefaultTextField(controller: remController, 'remark'.tr)),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Übernehmen', buttonHeight: 50, () => {
|
||||
getDefaultButton('apply'.tr, buttonHeight: 50, () => {
|
||||
if (selectedTourEntry!.queryRemark) {
|
||||
if (remController.text.isNotEmpty) {
|
||||
Navigator.of(context).pop(),
|
||||
@@ -80,7 +81,7 @@ showPickupDeliveryStatusPopup(BuildContext context, TaskInfo taskInfo, Function(
|
||||
|
||||
onFinished(selectedTourEntry, remController.text)
|
||||
} else {
|
||||
showAlertDialog("Fehler", "Bitte geben Sie eine Bemerkung ein")
|
||||
showAlertDialog('error'.tr, 'enter_remark'.tr)
|
||||
}
|
||||
} else {
|
||||
Navigator.of(context).pop(),
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/model/tour_task.dart';
|
||||
import 'package:stadtbote/tools/app_localizations.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
showReceiptGiverPopup(BuildContext context, TaskInfo taskInfo, Function(String, TourEntry) onFinished) async {
|
||||
@@ -57,7 +58,7 @@ showReceiptGiverPopup(BuildContext context, TaskInfo taskInfo, Function(String,
|
||||
DropdownMenu<TourEntry>(
|
||||
expandedInsets: const EdgeInsets.all(0),
|
||||
controller: controller,
|
||||
hintText: 'Geschlecht',
|
||||
hintText: 'gender'.tr,
|
||||
onSelected: (TourEntry? value) {
|
||||
selectedTourEntry = value;
|
||||
|
||||
@@ -73,7 +74,7 @@ showReceiptGiverPopup(BuildContext context, TaskInfo taskInfo, Function(String,
|
||||
maxLength: 40,
|
||||
autofocus: true),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Übernehmen', () {
|
||||
getDefaultButton('apply'.tr, () {
|
||||
if (textEditingController.text.isNotEmpty && selectedTourEntry != null) {
|
||||
Navigator.of(context).pop();
|
||||
|
||||
@@ -83,7 +84,7 @@ showReceiptGiverPopup(BuildContext context, TaskInfo taskInfo, Function(String,
|
||||
|
||||
onFinished(result, selectedTourEntry!);
|
||||
} else {
|
||||
showAlertDialog("Fehler", "Sie müssen einen Text eingeben und ein Geschlecht auswählen");
|
||||
showAlertDialog('error'.tr, 'enter_text_and_gender'.tr);
|
||||
}
|
||||
})
|
||||
],
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:signature/signature.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/app_localizations.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
showSignaturePopup(BuildContext context, TaskInfo taskInfo, Function(String?) onFinished) async {
|
||||
@@ -78,13 +79,13 @@ showSignaturePopup(BuildContext context, TaskInfo taskInfo, Function(String?) on
|
||||
),
|
||||
),
|
||||
getDefaultButton(
|
||||
'Übernehmen',
|
||||
'apply'.tr,
|
||||
buttonHeight: 50,
|
||||
() => {
|
||||
if (controller.points.length > 50)
|
||||
{Navigator.of(context).pop(), onFinished(convertPoints(controller.points))}
|
||||
else
|
||||
{showAlertDialog("Fehler", "Die Unterschrift ist zu kurz.")}
|
||||
{showAlertDialog('error'.tr, 'signature_too_short'.tr)}
|
||||
})
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/app_localizations.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
showStationNoticePopup(BuildContext context, TaskInfo taskInfo, Function(String) onFinished) async {
|
||||
@@ -54,7 +55,7 @@ showStationNoticePopup(BuildContext context, TaskInfo taskInfo, Function(String)
|
||||
autofocus: true),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Übernehmen', buttonHeight: 50, () {
|
||||
getDefaultButton('apply'.tr, buttonHeight: 50, () {
|
||||
final result = textEditingController.text;
|
||||
textEditingController.dispose();
|
||||
Navigator.of(context).pop();
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:image/image.dart' as image_lib;
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/app_localizations.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
Future<void> showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Function(List<Uint8List>) onFinished) async {
|
||||
@@ -53,7 +54,7 @@ Future<void> showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Functi
|
||||
onTap: () {},
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
await showQuestionDialog(context, "Achtung", "Wollen Sie das Bild wirklich löschen?", [
|
||||
await showQuestionDialog(context, 'attention'.tr, 'delete_photo_confirm'.tr, [
|
||||
TextButton(onPressed: () => {Navigator.of(context).pop(),
|
||||
imageDataList.removeAt(currentCarousselSliderIndex),
|
||||
imageWidgetsList.removeAt(currentCarousselSliderIndex),
|
||||
@@ -63,8 +64,8 @@ Future<void> showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Functi
|
||||
currentCarousselSliderIndex = 0,
|
||||
|
||||
setState(() {})
|
||||
}, child: const Text('Ja')),
|
||||
TextButton(onPressed: () => {Navigator.of(context).pop()}, child: const Text('Nein')),
|
||||
}, child: Text('yes'.tr)),
|
||||
TextButton(onPressed: () => {Navigator.of(context).pop()}, child: Text('no'.tr)),
|
||||
]);
|
||||
},
|
||||
child: Image.memory(resizedImageData),
|
||||
@@ -99,7 +100,7 @@ Future<void> showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Functi
|
||||
padding: const EdgeInsets.all(35.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const Text('Aufgenommene Fotos'),
|
||||
Text('photos'.tr),
|
||||
const SizedBox(height: 20),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
@@ -129,16 +130,16 @@ Future<void> showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Functi
|
||||
const SizedBox(height: 20),
|
||||
Visibility(
|
||||
visible: imageDataList.length < (taskInfo.task?.max ?? 999),
|
||||
child: getDefaultButton('Hinzufügen', buttonHeight: 50, () => {capturePhoto()})),
|
||||
child: getDefaultButton('add'.tr, buttonHeight: 50, () => {capturePhoto()})),
|
||||
const SizedBox(height: 12),
|
||||
getDefaultButton(
|
||||
'Übernehmen',
|
||||
'apply'.tr,
|
||||
buttonHeight: 50,
|
||||
() => {
|
||||
if (imageDataList.length >= (taskInfo.task?.min ?? 0) && imageDataList.length <= (taskInfo.task?.max ?? 999))
|
||||
{Navigator.of(context).pop(), onFinished(imageDataList)}
|
||||
else
|
||||
{showAlertDialog('Fehler', 'Es müssen mindestens ${taskInfo.task?.min ?? 0} Foto(s) aufgenommen werden')}
|
||||
{showAlertDialog('error'.tr, 'min_photos_error'.trParams({'min': taskInfo.task?.min ?? 0}))}
|
||||
})
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:stadtbote/tools/app_localizations.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
showZipPopup(BuildContext context, String text, String buttonText,
|
||||
@@ -55,7 +56,7 @@ showZipPopup(BuildContext context, String text, String buttonText,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 20),
|
||||
Util.getDefaultTextField('Postleitzahl',
|
||||
Util.getDefaultTextField('zip'.tr,
|
||||
formatter: [
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
LengthLimitingTextInputFormatter(5),
|
||||
@@ -89,11 +90,11 @@ bool _checkInput(BuildContext context, String input) {
|
||||
String message = '';
|
||||
|
||||
if (input.length != 5) {
|
||||
message += 'Bitte geben Sie eine fünfstellige Postleitzahl ein';
|
||||
message += 'enter_zip'.tr;
|
||||
}
|
||||
|
||||
if (message.isNotEmpty) {
|
||||
showAlertDialog('Fehler', message);
|
||||
showAlertDialog('error'.tr, message);
|
||||
}
|
||||
|
||||
return message.isEmpty;
|
||||
|
||||
Reference in new issue
Block a user