Erweiterungen
This commit is contained in:
1 parent
dbe821b08d
commit
ebe61c1674
7 files changed
+298
-302
No files matched your search
@@ -1,134 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:isar/isar.dart';
|
|
||||||
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
|
||||||
import 'package:stadtbote/content_views/utils/header_info.dart';
|
|
||||||
import 'package:intl/intl.dart';
|
|
||||||
import 'package:stadtbote/popups/accept_job_popup.dart';
|
|
||||||
|
|
||||||
import '../main.dart';
|
|
||||||
import '../model/job.dart';
|
|
||||||
import '../tools/util.dart';
|
|
||||||
|
|
||||||
class AssignedJobsPage extends ContentViewWidget {
|
|
||||||
const AssignedJobsPage({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<AssignedJobsPage> createState() => _AssignedJobsPageState();
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<HeaderInfo> getHeaderInfo(BuildContext context) async {
|
|
||||||
return HeaderInfo(
|
|
||||||
titleWidget: const Text(
|
|
||||||
'Zugewiesene Aufträge',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 24.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
rightButtonEnabled: false,
|
|
||||||
rightButtonVisible: false,
|
|
||||||
rightButtonImage: null,
|
|
||||||
rightButtonOnPressed: () async {
|
|
||||||
//BroadcastReceiver().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: EmployeeEditProfileWidget());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _AssignedJobsPageState extends State<AssignedJobsPage> {
|
|
||||||
late List<Job> _jobs;
|
|
||||||
|
|
||||||
late bool _initCompleted = false;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
Future.delayed(const Duration(seconds: 0), () async {
|
|
||||||
_jobs = await MyApp.isarInstance.jobs.filter().stateEqualTo(0).findAll();
|
|
||||||
|
|
||||||
_initCompleted = true;
|
|
||||||
|
|
||||||
setState(() {});
|
|
||||||
});
|
|
||||||
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
if (!_initCompleted) {
|
|
||||||
return Util.getWaitWidget(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
late List<Widget> jobWidgets = _createjobWidgets();
|
|
||||||
|
|
||||||
return ListView(
|
|
||||||
children: jobWidgets
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Widget> _createjobWidgets() {
|
|
||||||
List<Widget> jobWidgets = [];
|
|
||||||
|
|
||||||
for (var job in _jobs) {
|
|
||||||
jobWidgets.add(
|
|
||||||
ListTile(
|
|
||||||
onTap: () {
|
|
||||||
_clicked(job);
|
|
||||||
},
|
|
||||||
title: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
border: Border.all(color: Colors.grey, width: 0.5),
|
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(13))
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.all(15.0),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
Text(
|
|
||||||
DateFormat('dd.MM.yyyy HH:mm').format(DateTime.parse(job.ordertime)).toString(),
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
job.crFilter != null ? job.crFilter.toString() : "Kein CR-Filter vorhanden",
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
const Icon(Icons.arrow_back, size: 30.0, color: Colors.black),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
Text(
|
|
||||||
job.vhtId.toString()
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
job.id.toString(),
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
job.tours[0].comp,
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
job.tours[0].street,
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
job.tours[0].city,
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return jobWidgets;
|
|
||||||
}
|
|
||||||
|
|
||||||
void _clicked(Job job) {
|
|
||||||
showAcceptJobPopup(context, job);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +1,14 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_broadcast_receiver/flutter_broadcast_receiver.dart';
|
import 'package:flutter_broadcast_receiver/flutter_broadcast_receiver.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
import 'package:stadtbote/content_views/accepted_jobs_page.dart';
|
import 'package:stadtbote/content_views/accepted_jobs_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/finished_jobs_page.dart';
|
||||||
import 'package:stadtbote/content_views/messages_page.dart';
|
import 'package:stadtbote/content_views/messages_page.dart';
|
||||||
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
||||||
import 'package:stadtbote/content_views/utils/header_info.dart';
|
import 'package:stadtbote/content_views/utils/header_info.dart';
|
||||||
import 'package:stadtbote/model/job.dart';
|
import 'package:stadtbote/model/job.dart';
|
||||||
import 'package:stadtbote/model/status.dart';
|
import 'package:stadtbote/model/status.dart';
|
||||||
import 'package:stadtbote/popups/accept_job_popup.dart';
|
import 'package:stadtbote/popups/accept_jobs_popup.dart';
|
||||||
import 'package:stadtbote/popups/infos_popup.dart';
|
import 'package:stadtbote/popups/infos_popup.dart';
|
||||||
import 'package:stadtbote/tools/messages/job_received_message.dart';
|
import 'package:stadtbote/tools/messages/job_received_message.dart';
|
||||||
import 'package:stadtbote/tools/messages/session_info_update.dart';
|
import 'package:stadtbote/tools/messages/session_info_update.dart';
|
||||||
@@ -105,34 +103,6 @@ class _MainPageState extends State<MainPage> {
|
|||||||
children: [
|
children: [
|
||||||
ValueListenableBuilder<int>(
|
ValueListenableBuilder<int>(
|
||||||
valueListenable: _assignedJobsValueNotifier,
|
valueListenable: _assignedJobsValueNotifier,
|
||||||
builder: (context, value, child) {
|
|
||||||
return badges.Badge(
|
|
||||||
showBadge: value > 0,
|
|
||||||
position: badges.BadgePosition.topEnd(top: -12, end: -5),
|
|
||||||
badgeContent: Text(
|
|
||||||
value.toString(),
|
|
||||||
style: const TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 13.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
badgeStyle: badges.BadgeStyle(
|
|
||||||
badgeColor: Colors.red,
|
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
borderRadius: BorderRadius.circular(4),
|
|
||||||
borderSide: const BorderSide(color: Colors.white, width: 0),
|
|
||||||
elevation: 0,
|
|
||||||
),
|
|
||||||
child: getDefaultButton(
|
|
||||||
'Zugewiesene Aufträge',
|
|
||||||
image: Image.asset('assets/zugewiesene_auftraege.png', width: 30, height: 30),
|
|
||||||
() => {BroadcastReceiver().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: const AssignedJobsPage())})
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
ValueListenableBuilder<int>(
|
|
||||||
valueListenable: _acceptedJobsValueNotifier,
|
|
||||||
builder: (context, value, child) {
|
builder: (context, value, child) {
|
||||||
return badges.Badge(
|
return badges.Badge(
|
||||||
showBadge: value > 0,
|
showBadge: value > 0,
|
||||||
@@ -152,13 +122,43 @@ class _MainPageState extends State<MainPage> {
|
|||||||
elevation: 0,
|
elevation: 0,
|
||||||
),
|
),
|
||||||
child: getDefaultButton(
|
child: getDefaultButton(
|
||||||
'Angenommene Aufträge',
|
'Zugewiesene Aufträge',
|
||||||
image: Image.asset('assets/angenommene_auftraege.png', width: 30, height: 30),
|
image: Image.asset('assets/zugewiesene_auftraege.png', width: 30, height: 30),
|
||||||
() => {BroadcastReceiver().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: const AcceptedJobsPage())})
|
() => {showAcceptJobsPopup(context)}),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
|
ValueListenableBuilder<int>(
|
||||||
|
valueListenable: _acceptedJobsValueNotifier,
|
||||||
|
builder: (context, value, child) {
|
||||||
|
return badges.Badge(
|
||||||
|
showBadge: value > 0,
|
||||||
|
position: badges.BadgePosition.topEnd(top: -12, end: -5),
|
||||||
|
badgeContent: Text(
|
||||||
|
value.toString(),
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 13.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
badgeStyle: badges.BadgeStyle(
|
||||||
|
badgeColor: Colors.red,
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
borderSide: const BorderSide(color: Colors.white, width: 0),
|
||||||
|
elevation: 0,
|
||||||
|
),
|
||||||
|
child: getDefaultButton(
|
||||||
|
'Angenommene Aufträge',
|
||||||
|
image: Image.asset('assets/angenommene_auftraege.png', width: 30, height: 30),
|
||||||
|
() => {
|
||||||
|
BroadcastReceiver()
|
||||||
|
.publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: const AcceptedJobsPage())
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
getDefaultButton(
|
getDefaultButton(
|
||||||
'Erledigte Aufträge',
|
'Erledigte Aufträge',
|
||||||
image: Image.asset('assets/erledigte_auftraege.png', width: 30, height: 30),
|
image: Image.asset('assets/erledigte_auftraege.png', width: 30, height: 30),
|
||||||
@@ -187,8 +187,9 @@ class _MainPageState extends State<MainPage> {
|
|||||||
child: getDefaultButton(
|
child: getDefaultButton(
|
||||||
'Nachrichten',
|
'Nachrichten',
|
||||||
image: Image.asset('assets/nachrichten.png', width: 30, height: 30),
|
image: Image.asset('assets/nachrichten.png', width: 30, height: 30),
|
||||||
() => {BroadcastReceiver().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: const MessagesPage())})
|
() => {
|
||||||
);
|
BroadcastReceiver().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: const MessagesPage())
|
||||||
|
}));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
@@ -266,6 +267,6 @@ class _MainPageState extends State<MainPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _showAcceptanceDialog(Job job) {
|
void _showAcceptanceDialog(Job job) {
|
||||||
showAcceptJobPopup(context, job);
|
showAcceptJobsPopup(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+7
-1
@@ -134,7 +134,13 @@ class _MainState extends State<Main> {
|
|||||||
key: GlobalKey(),
|
key: GlobalKey(),
|
||||||
child: WillPopScope(
|
child: WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
return false;
|
if (contentStack.isNotEmpty) {
|
||||||
|
_popContentView();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: PreferredSize(
|
appBar: PreferredSize(
|
||||||
|
|||||||
@@ -1,130 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:intl/intl.dart';
|
|
||||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
|
||||||
import 'package:stadtbote/main.dart';
|
|
||||||
import 'package:stadtbote/model/job.dart';
|
|
||||||
import 'package:stadtbote/tools/util.dart';
|
|
||||||
|
|
||||||
void showAcceptJobPopup(BuildContext context, Job job) async {
|
|
||||||
showPopupWindow(
|
|
||||||
context,
|
|
||||||
//childSize:Size(240, MediaQuery.of(context).size.width * 0.8),
|
|
||||||
gravity: KumiPopupGravity.center,
|
|
||||||
//curve: Curves.elasticOut,
|
|
||||||
bgColor: Colors.grey.withOpacity(0.5),
|
|
||||||
clickOutDismiss: true,
|
|
||||||
clickBackDismiss: true,
|
|
||||||
customAnimation: false,
|
|
||||||
customPop: false,
|
|
||||||
customPage: false,
|
|
||||||
// targetRenderBox: (btnKey.currentContext.findRenderObject() as RenderBox),
|
|
||||||
//needSafeDisplay: true,
|
|
||||||
underStatusBar: false,
|
|
||||||
underAppBar: false,
|
|
||||||
//offsetX: -180,
|
|
||||||
//offsetY: 50,
|
|
||||||
duration: const Duration(milliseconds: 200),
|
|
||||||
onShowStart: (pop) {},
|
|
||||||
onShowFinish: (pop) {},
|
|
||||||
onDismissStart: (pop) {},
|
|
||||||
onDismissFinish: (pop) {},
|
|
||||||
onClickOut: (pop) {},
|
|
||||||
onClickBack: (pop) {},
|
|
||||||
childFun: (pop) {
|
|
||||||
return SizedBox(
|
|
||||||
key: GlobalKey(),
|
|
||||||
height: MediaQuery.of(context).size.height * 0.5,
|
|
||||||
width: MediaQuery.of(context).size.width * 0.8,
|
|
||||||
child: Container(
|
|
||||||
height: 100,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
color: Colors.white,
|
|
||||||
border: Border.all(
|
|
||||||
color: Colors.grey,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
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('Auftragsnummer: ${job.id}'),
|
|
||||||
Text(job.tours[0].comp),
|
|
||||||
Text(job.tours[0].street),
|
|
||||||
Text(job.tours[0].city),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
Container(
|
|
||||||
height: 200,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
color: const Color(0xfffff4e4),
|
|
||||||
border: Border.all(
|
|
||||||
color: Colors.grey,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: const SingleChildScrollView(
|
|
||||||
child: Text('asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd '),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: getDefaultButton(
|
|
||||||
'Ablehnen',
|
|
||||||
() => {_sendAnswer()}),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 20),
|
|
||||||
Expanded(
|
|
||||||
child: getDefaultButton(
|
|
||||||
'Annehmen',
|
|
||||||
() => {}),
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
private void SendAnswer(int item)
|
|
||||||
{
|
|
||||||
JObject payloadObject;
|
|
||||||
|
|
||||||
var location = App.CurrentLocation;
|
|
||||||
if (location != null)
|
|
||||||
payloadObject = new JObject(
|
|
||||||
new JProperty("reaction", new JObject(
|
|
||||||
new JProperty("id", _jobViewModel.IdString),
|
|
||||||
new JProperty("ver", _jobViewModel.Version),
|
|
||||||
new JProperty("item", item),
|
|
||||||
new JProperty("track", new JObject(
|
|
||||||
new JProperty("time", DateTime.Now.ToString("o")),
|
|
||||||
new JProperty("pos", new JObject(
|
|
||||||
new JProperty("lat", location.Latitude),
|
|
||||||
new JProperty("long", location.Longitude),
|
|
||||||
new JProperty("acc", location.Accuracy))))))));
|
|
||||||
else
|
|
||||||
payloadObject = new JObject(
|
|
||||||
new JProperty("reaction", new JObject(
|
|
||||||
new JProperty("id", _jobViewModel.IdString),
|
|
||||||
new JProperty("ver", _jobViewModel.Version),
|
|
||||||
new JProperty("item", item),
|
|
||||||
new JProperty("track", new JObject(
|
|
||||||
new JProperty("time", DateTime.Now.ToString("o")))))));
|
|
||||||
|
|
||||||
App.Core.SendJsonMessageAsync("job", payloadObject);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
_sendAnswer() {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
import 'package:expandable/expandable.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:isar/isar.dart';
|
||||||
|
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||||
|
import 'package:stadtbote/main.dart';
|
||||||
|
import 'package:stadtbote/model/job.dart';
|
||||||
|
import 'package:stadtbote/tools/constants.dart';
|
||||||
|
import 'package:stadtbote/tools/util.dart';
|
||||||
|
import 'package:badges/badges.dart' as badges;
|
||||||
|
|
||||||
|
void showAcceptJobsPopup(BuildContext context) async {
|
||||||
|
var entries = await _createListEntries();
|
||||||
|
|
||||||
|
showPopupWindow(
|
||||||
|
context,
|
||||||
|
//childSize:Size(240, MediaQuery.of(context).size.width * 0.8),
|
||||||
|
gravity: KumiPopupGravity.center,
|
||||||
|
//curve: Curves.elasticOut,
|
||||||
|
bgColor: Colors.grey.withOpacity(0.5),
|
||||||
|
clickOutDismiss: true,
|
||||||
|
clickBackDismiss: true,
|
||||||
|
customAnimation: false,
|
||||||
|
customPop: false,
|
||||||
|
customPage: false,
|
||||||
|
// targetRenderBox: (btnKey.currentContext.findRenderObject() as RenderBox),
|
||||||
|
//needSafeDisplay: true,
|
||||||
|
underStatusBar: false,
|
||||||
|
underAppBar: false,
|
||||||
|
//offsetX: -180,
|
||||||
|
//offsetY: 50,
|
||||||
|
duration: const Duration(milliseconds: 200),
|
||||||
|
onShowStart: (pop) {},
|
||||||
|
onShowFinish: (pop) {},
|
||||||
|
onDismissStart: (pop) {},
|
||||||
|
onDismissFinish: (pop) {},
|
||||||
|
onClickOut: (pop) {},
|
||||||
|
onClickBack: (pop) {},
|
||||||
|
childFun: (pop) {
|
||||||
|
_createListEntries();
|
||||||
|
|
||||||
|
return SizedBox(
|
||||||
|
key: GlobalKey(),
|
||||||
|
height: MediaQuery.of(context).size.height * 0.85,
|
||||||
|
width: MediaQuery.of(context).size.width * 0.85,
|
||||||
|
child: Container(
|
||||||
|
height: 100,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
color: Colors.white,
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors.grey,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: SingleChildScrollView(child: Column(children: entries)),
|
||||||
|
));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<Widget>> _createListEntries() async {
|
||||||
|
List<Widget> entries = [];
|
||||||
|
|
||||||
|
var jobs = await MyApp.isarInstance.jobs.filter().stateEqualTo(0).findAll();
|
||||||
|
jobs.addAll(await MyApp.isarInstance.jobs.filter().stateEqualTo(0).findAll());
|
||||||
|
jobs.addAll(await MyApp.isarInstance.jobs.filter().stateEqualTo(0).findAll());
|
||||||
|
jobs.addAll(await MyApp.isarInstance.jobs.filter().stateEqualTo(0).findAll());
|
||||||
|
for (var job in jobs) {
|
||||||
|
entries.add(ExpandableNotifier(
|
||||||
|
child: ListTile(
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||||
|
title: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(
|
||||||
|
color: Constants.colorPrimary,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: badges.Badge(
|
||||||
|
position: badges.BadgePosition.topEnd(top: -10, end: -5),
|
||||||
|
showBadge: true,
|
||||||
|
badgeContent: const Text(
|
||||||
|
'Neu',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 10.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
badgeStyle: badges.BadgeStyle(
|
||||||
|
shape: badges.BadgeShape.square,
|
||||||
|
badgeColor: Colors.green,
|
||||||
|
padding: const EdgeInsets.all(5),
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
|
borderSide: const BorderSide(color: Constants.colorPrimary, width: 0),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
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('Auftragsnummer: ${job.id}'),
|
||||||
|
Text(job.tours[0].comp),
|
||||||
|
Text(job.tours[0].street),
|
||||||
|
Text(job.tours[0].city),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
ScrollOnExpand(
|
||||||
|
scrollOnExpand: true,
|
||||||
|
scrollOnCollapse: false,
|
||||||
|
child: ExpandablePanel(
|
||||||
|
theme: const ExpandableThemeData(
|
||||||
|
headerAlignment: ExpandablePanelHeaderAlignment.center,
|
||||||
|
tapBodyToCollapse: true,
|
||||||
|
),
|
||||||
|
header: const Padding(
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
child: Text(
|
||||||
|
"Weitere Infos....",
|
||||||
|
style: TextStyle(fontSize: 15, color: Colors.black, fontWeight: FontWeight.bold),
|
||||||
|
)),
|
||||||
|
collapsed: SizedBox(),
|
||||||
|
expanded: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
height: 200,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
color: const Color(0xfffff4e4),
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors.grey,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Text('asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd '),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Row(children: [
|
||||||
|
Expanded(
|
||||||
|
child: getDefaultButton('Ablehnen', () => {_sendAnswer()}),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 20),
|
||||||
|
Expanded(
|
||||||
|
child: getDefaultButton('Annehmen', () => {}),
|
||||||
|
)
|
||||||
|
])
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
return entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
private void SendAnswer(int item)
|
||||||
|
{
|
||||||
|
JObject payloadObject;
|
||||||
|
|
||||||
|
var location = App.CurrentLocation;
|
||||||
|
if (location != null)
|
||||||
|
payloadObject = new JObject(
|
||||||
|
new JProperty("reaction", new JObject(
|
||||||
|
new JProperty("id", _jobViewModel.IdString),
|
||||||
|
new JProperty("ver", _jobViewModel.Version),
|
||||||
|
new JProperty("item", item),
|
||||||
|
new JProperty("track", new JObject(
|
||||||
|
new JProperty("time", DateTime.Now.ToString("o")),
|
||||||
|
new JProperty("pos", new JObject(
|
||||||
|
new JProperty("lat", location.Latitude),
|
||||||
|
new JProperty("long", location.Longitude),
|
||||||
|
new JProperty("acc", location.Accuracy))))))));
|
||||||
|
else
|
||||||
|
payloadObject = new JObject(
|
||||||
|
new JProperty("reaction", new JObject(
|
||||||
|
new JProperty("id", _jobViewModel.IdString),
|
||||||
|
new JProperty("ver", _jobViewModel.Version),
|
||||||
|
new JProperty("item", item),
|
||||||
|
new JProperty("track", new JObject(
|
||||||
|
new JProperty("time", DateTime.Now.ToString("o")))))));
|
||||||
|
|
||||||
|
App.Core.SendJsonMessageAsync("job", payloadObject);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
_sendAnswer() {}
|
||||||
@@ -281,6 +281,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.0.0"
|
||||||
|
expandable:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: expandable
|
||||||
|
sha256: "9604d612d4d1146dafa96c6d8eec9c2ff0994658d6d09fed720ab788c7f5afc2"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.0.1"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -488,6 +496,54 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.2.0"
|
version: "3.2.0"
|
||||||
|
geolocator:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: geolocator
|
||||||
|
sha256: e946395fc608842bb2f6c914807e9183f86f3cb787f6b8f832753e5251036f02
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "10.1.0"
|
||||||
|
geolocator_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geolocator_android
|
||||||
|
sha256: "93906636752ea4d4e778afa981fdfe7409f545b3147046300df194330044d349"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.3.1"
|
||||||
|
geolocator_apple:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geolocator_apple
|
||||||
|
sha256: "79babf44b692ec5e789d322dc736ef71586056e8e6828f747c9e005456b248bf"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.5"
|
||||||
|
geolocator_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geolocator_platform_interface
|
||||||
|
sha256: "6c8d494d6948757c56720b778af742f6973f31fca1f702a7539b8917e4a2468a"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.2.0"
|
||||||
|
geolocator_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geolocator_web
|
||||||
|
sha256: "59083f7e0871b78299918d92bf930a14377f711d2d1156c558cd5ebae6c20d58"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.0"
|
||||||
|
geolocator_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geolocator_windows
|
||||||
|
sha256: a92fae29779d5c6dc60e8411302f5221ade464968fe80a36d330e80a71f087af
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.2"
|
||||||
glob:
|
glob:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ dependencies:
|
|||||||
signature: ^5.4.0
|
signature: ^5.4.0
|
||||||
flutter_chat_types: ^3.6.2
|
flutter_chat_types: ^3.6.2
|
||||||
flutter_chat_ui: ^1.6.10
|
flutter_chat_ui: ^1.6.10
|
||||||
|
geolocator: ^10.1.0
|
||||||
|
expandable: ^5.0.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Reference in new issue
Block a user