Erweiterungen
This commit is contained in:
1 parent
d2c63d6107
commit
9f5e1f52a2
4 files changed
+17
-6
No files matched your search
@@ -89,6 +89,7 @@ class _AcceptedJobsPageState extends State<AcceptedJobsPage> {
|
||||
children: <Widget>[
|
||||
Text(
|
||||
DateFormat('dd.MM.yyyy HH:mm').format(DateTime.parse(job.ordertime)).toString(),
|
||||
style: TextStyle(backgroundColor: isJobInFuture(job) ? Colors.yellow : Colors.white),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
Text(
|
||||
|
||||
@@ -114,7 +114,11 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> {
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(DateFormat('dd.MM.yyyy HH:mm').format(DateTime.parse(job.ordertime)).toString(), textAlign: TextAlign.left),
|
||||
Text(
|
||||
DateFormat('dd.MM.yyyy HH:mm').format(DateTime.parse(job.ordertime)).toString(),
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(backgroundColor: isJobInFuture(job) ? Colors.yellow : Colors.white),
|
||||
),
|
||||
Text('Auftragsnummer: ${job.id}'),
|
||||
Text(job.tours[0].comp),
|
||||
Text(job.tours[0].street),
|
||||
|
||||
@@ -77,8 +77,11 @@ Future<void> showAcceptJobsPopup(BuildContext context, List<Job> jobs) async {
|
||||
children: [
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text(DateFormat('dd.MM.yyyy HH:mm').format(DateTime.parse(job.ordertime)).toString(),
|
||||
textAlign: TextAlign.left),
|
||||
child: Text(
|
||||
DateFormat('dd.MM.yyyy HH:mm').format(DateTime.parse(job.ordertime)).toString(),
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(backgroundColor: isJobInFuture(job) ? Colors.yellow : Colors.white),
|
||||
),
|
||||
),
|
||||
SizedBox(width: double.infinity, child: Text('Auftragsnummer: ${job.id}', textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.tours[0].comp, textAlign: TextAlign.left)),
|
||||
@@ -88,9 +91,7 @@ Future<void> showAcceptJobsPopup(BuildContext context, List<Job> jobs) async {
|
||||
children: [
|
||||
Image.asset("assets/${mapVehicleTypeToImageName(job.vhtId)}", width: 60, height: 60),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
mapVehicleTypeToText(job.vhtId)
|
||||
),
|
||||
Text(mapVehicleTypeToText(job.vhtId)),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:stadtbote/model/job.dart';
|
||||
import 'package:stadtbote/tools/constants.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
@@ -364,3 +365,7 @@ class DecimalTextInputFormatter extends TextInputFormatter {
|
||||
return TextEditingValue(text: filteredText ?? oldValue.text);
|
||||
}
|
||||
}
|
||||
|
||||
bool isJobInFuture(Job job) {
|
||||
return DateTime.parse(job.ordertime).add(Duration(minutes: job.offsWarn)).toUtc().millisecondsSinceEpoch > DateTime.now().toUtc().millisecondsSinceEpoch;
|
||||
}
|
||||
Reference in new issue
Block a user