Fehlerkorrekturen und Erweiterungen
This commit is contained in:
1 parent
3fd8b0f9d4
commit
777876bc8d
8 files changed
+70
-45
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
@@ -67,10 +67,9 @@ class _AcceptedJobsPageState extends State<AcceptedJobsPage> with ProducerMixin
|
||||
|
||||
for (var job in _jobs) {
|
||||
var bottomText = "${job.id}\n${job.tours[0].comp}\n${job.tours[0].street}\n${job.tours[0].city}";
|
||||
// BWV
|
||||
/*if (job.rem.trim().isNotEmpty) {
|
||||
if (job.rem.trim().isNotEmpty) {
|
||||
bottomText += "\n\n${job.rem.trim()}";
|
||||
}*/
|
||||
}
|
||||
|
||||
jobWidgets.add(
|
||||
ListTile(
|
||||
|
||||
@@ -124,6 +124,16 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> with ProducerMixin,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(backgroundColor: isJobTooFarInFuture(job) ? Colors.red : Colors.white),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset("assets/${mapVehicleTypeToImageName(job.vhtId)}", width: 60, height: 60),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
mapVehicleTypeToText(job.vhtId)
|
||||
),
|
||||
],
|
||||
),
|
||||
Text('Auftragsnummer: ${job.id}'),
|
||||
Text(job.tours[0].comp),
|
||||
Text(job.tours[0].street),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:stadtbote/content_views/approach_area_page.dart';
|
||||
import 'package:stadtbote/content_views/assigned_jobs_page.dart';
|
||||
import 'package:stadtbote/content_views/finished_jobs_page.dart';
|
||||
import 'package:stadtbote/content_views/messages_page.dart';
|
||||
import 'package:stadtbote/content_views/set_desired_zip_page.dart';
|
||||
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
||||
import 'package:stadtbote/main.dart';
|
||||
import 'package:stadtbote/model/job.dart';
|
||||
@@ -219,21 +220,19 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
|
||||
//await MessageService().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: const ApproachAreaPage())
|
||||
}),
|
||||
),
|
||||
/*SizedBox(height: _loggedOut == true ? 0 : 20),
|
||||
SizedBox(height: _loggedOut == true ? 0 : 20),
|
||||
Visibility(
|
||||
visible: !_loggedOut,
|
||||
child: getDefaultButton(
|
||||
'Wunschziel für heute',
|
||||
image: Image.asset('assets/anfahrtsbereich.png', width: 30, height: 30),
|
||||
image: Image.asset('assets/wunsch_plz.png', width: 30, height: 30),
|
||||
() async => {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: const SetDesiredZipPage(),
|
||||
)
|
||||
//await MessageService().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: const ApproachAreaPage())
|
||||
}),
|
||||
),*/
|
||||
),
|
||||
SizedBox(height: _loggedOut == true ? 0 : 20),
|
||||
getDefaultButton(_loggedOut ? 'Anmelden' : 'Abmelden',
|
||||
image: Image.asset(_loggedOut ? 'assets/anmelden.png' : 'assets/abmelden.png', width: 30, height: 30), () async {
|
||||
|
||||
@@ -28,6 +28,11 @@ class _SetDesiredZipPageState extends State<SetDesiredZipPage> with ProducerMixi
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
var savedDesiredZip = Util.preferencesGetString(Constants.prefsDesiredZip, null);
|
||||
if (savedDesiredZip != null) {
|
||||
textEditController.text = savedDesiredZip;
|
||||
}
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@@ -47,8 +52,13 @@ class _SetDesiredZipPageState extends State<SetDesiredZipPage> with ProducerMixi
|
||||
width: 120, // Festlegen der Breite des Textfelds
|
||||
child:
|
||||
Util.getDefaultTextField('PLZ',
|
||||
textInputType: TextInputType.text,
|
||||
formatter: [FilteringTextInputFormatter.singleLineFormatter],
|
||||
textInputType: TextInputType.number,
|
||||
formatter: [
|
||||
// Erlaubt nur Ziffern
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
// Begrenzt die maximale Eingabelänge auf 5 Zeichen
|
||||
LengthLimitingTextInputFormatter(5),
|
||||
],
|
||||
controller: textEditController,
|
||||
maxLength: 5,
|
||||
autofocus: true
|
||||
@@ -59,14 +69,18 @@ class _SetDesiredZipPageState extends State<SetDesiredZipPage> with ProducerMixi
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Übernehmen', () =>
|
||||
{
|
||||
Util.preferencesSaveString(Constants.prefsDesiredZip, textEditController.text),
|
||||
if (textEditController.text.isEmpty || textEditController.text.length == 5) {
|
||||
Util.preferencesSaveString(Constants.prefsDesiredZip, textEditController.text),
|
||||
|
||||
_sendDesiredZipMessage(textEditController.text),
|
||||
_sendDesiredZipMessage(textEditController.text),
|
||||
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPopContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
)
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPopContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
)
|
||||
} else {
|
||||
showAlertDialog("Fehler", "Das Feld muss leer sein, oder es müssen fünf Zahlen eingegeben werden")
|
||||
}
|
||||
})
|
||||
]
|
||||
),
|
||||
@@ -79,7 +93,7 @@ class _SetDesiredZipPageState extends State<SetDesiredZipPage> with ProducerMixi
|
||||
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPublishPayload,
|
||||
payload: PublishPayloadMessage(topic: "set_desired_zip", message: desiredZipMessage.toJson(),acknowledgeRequired: true),
|
||||
payload: PublishPayloadMessage(topic: "set_desired_zip", message: desiredZipMessage.toJson(), acknowledgeRequired: true),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+15
-11
@@ -36,6 +36,8 @@ Future<void> main() async {
|
||||
runZonedGuarded(() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await Util.init();
|
||||
|
||||
MQClient.initialize();
|
||||
MQClient.instance.declareQueue(Constants.messageTopicRemoveJob);
|
||||
MQClient.instance.declareQueue(Constants.messageTopicPublishPayload);
|
||||
@@ -349,19 +351,21 @@ class _MainState extends State<Main> with SingleTickerProviderStateMixin, Produc
|
||||
|
||||
var job = await MyApp.isarInstance.jobs.where().filter().idEqualTo(removeJobMessage.id).findFirst();
|
||||
|
||||
await MyApp.isarInstance.writeTxn(() async {
|
||||
await MyApp.isarInstance.jobs.where().filter().idEqualTo(removeJobMessage.id).deleteAll();
|
||||
});
|
||||
if (job != null) {
|
||||
await MyApp.isarInstance.writeTxn(() async {
|
||||
await MyApp.isarInstance.jobs.where().filter().idEqualTo(removeJobMessage.id).deleteAll();
|
||||
});
|
||||
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicJobDeleted,
|
||||
payload: JobDeletedMessage(job: job!),
|
||||
);
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicJobDeleted,
|
||||
payload: JobDeletedMessage(job: job!),
|
||||
);
|
||||
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicUpdateBadges,
|
||||
payload: RefreshBadgesMessage,
|
||||
);
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicUpdateBadges,
|
||||
payload: RefreshBadgesMessage,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
+15
-16
@@ -16,19 +16,22 @@ import 'package:uuid/uuid.dart';
|
||||
import '../Tools/colored_safe_area.dart';
|
||||
|
||||
class Util {
|
||||
static Future<bool> preferencesContainsKey(String key) async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
static late SharedPreferences prefs;
|
||||
|
||||
static init() async {
|
||||
prefs = await SharedPreferences.getInstance();
|
||||
}
|
||||
|
||||
static bool preferencesContainsKey(String key) {
|
||||
return prefs.containsKey(key);
|
||||
}
|
||||
|
||||
static void preferencesSaveString(String key, String value) async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setString(key, value);
|
||||
}
|
||||
|
||||
static Future<String?> preferencesGetString(String key, String? defaultValue) async {
|
||||
if (await preferencesContainsKey(key)) {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
static String? preferencesGetString(String key, String? defaultValue) {
|
||||
if (preferencesContainsKey(key)) {
|
||||
return prefs.getString(key);
|
||||
}
|
||||
|
||||
@@ -36,13 +39,11 @@ class Util {
|
||||
}
|
||||
|
||||
static void preferencesSaveInt(String key, int value) async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setInt(key, value);
|
||||
}
|
||||
|
||||
static Future<int?> preferencesGetInt(String key, int? defaultValue) async {
|
||||
if (await preferencesContainsKey(key)) {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
static int? preferencesGetInt(String key, int? defaultValue) {
|
||||
if (preferencesContainsKey(key)) {
|
||||
return prefs.getInt(key);
|
||||
}
|
||||
|
||||
@@ -50,21 +51,19 @@ class Util {
|
||||
}
|
||||
|
||||
static void preferencesSaveBool(String key, bool value) async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setBool(key, value);
|
||||
}
|
||||
|
||||
static Future<bool> preferencesGetBool(String key, bool defaultValue) async {
|
||||
if (await preferencesContainsKey(key)) {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
static bool preferencesGetBool(String key, bool defaultValue) {
|
||||
if (preferencesContainsKey(key)) {
|
||||
return prefs.getBool(key) as bool;
|
||||
}
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
static Future<String> getAppUuid() async {
|
||||
var currentUuid = await preferencesGetString('uuid', null);
|
||||
static String getAppUuid() {
|
||||
var currentUuid = preferencesGetString('uuid', null);
|
||||
|
||||
if (currentUuid == null) {
|
||||
currentUuid ??= const Uuid().v4();
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 332.0.0+332
|
||||
version: 335.0.0+335
|
||||
|
||||
environment:
|
||||
sdk: '>=2.19.6 <3.0.0'
|
||||
|
||||
Reference in new issue
Block a user