Erweiterungen
This commit is contained in:
1 parent
07b9d71eb3
commit
01912b53af
4 files changed
+173
No files matched your search
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||||
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
||||||
@@ -8,6 +9,7 @@ import 'package:stadtbote/popups/tasks_popups/arrived_popup.dart';
|
|||||||
import 'package:stadtbote/popups/tasks_popups/commision_number_popup.dart';
|
import 'package:stadtbote/popups/tasks_popups/commision_number_popup.dart';
|
||||||
import 'package:stadtbote/popups/tasks_popups/receipt_giver_popup.dart';
|
import 'package:stadtbote/popups/tasks_popups/receipt_giver_popup.dart';
|
||||||
import 'package:stadtbote/popups/tasks_popups/scan_barcodes_popup.dart';
|
import 'package:stadtbote/popups/tasks_popups/scan_barcodes_popup.dart';
|
||||||
|
import 'package:stadtbote/popups/tasks_popups/signature_popup.dart';
|
||||||
import 'package:stadtbote/popups/tasks_popups/station_notice_popup.dart';
|
import 'package:stadtbote/popups/tasks_popups/station_notice_popup.dart';
|
||||||
import 'package:stadtbote/popups/tasks_popups/take_photos_popup.dart';
|
import 'package:stadtbote/popups/tasks_popups/take_photos_popup.dart';
|
||||||
|
|
||||||
@@ -180,6 +182,10 @@ class _TaskListPageState extends State<TaskListPage> {
|
|||||||
|
|
||||||
void _processTask(TaskInfo taskInfo) {
|
void _processTask(TaskInfo taskInfo) {
|
||||||
switch(taskInfo.task.type) {
|
switch(taskInfo.task.type) {
|
||||||
|
case 2:
|
||||||
|
_processSignature(taskInfo);
|
||||||
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
_processTaskArrivedOrFinished(taskInfo);
|
_processTaskArrivedOrFinished(taskInfo);
|
||||||
break;
|
break;
|
||||||
@@ -241,4 +247,16 @@ class _TaskListPageState extends State<TaskListPage> {
|
|||||||
_popup.dismiss(context)
|
_popup.dismiss(context)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _processSignature(TaskInfo taskInfo) {
|
||||||
|
SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]);
|
||||||
|
|
||||||
|
Future.delayed(const Duration(seconds: 1), () async {
|
||||||
|
_popup = showSignaturePopup(context, taskInfo, () => {
|
||||||
|
_popup.dismiss(context),
|
||||||
|
|
||||||
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
import 'dart:math';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart';
|
||||||
|
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||||
|
import 'package:signature/signature.dart';
|
||||||
|
import 'package:stadtbote/model/task_info.dart';
|
||||||
|
import 'package:stadtbote/tools/util.dart';
|
||||||
|
|
||||||
|
KumiPopupWindow showSignaturePopup(BuildContext context, TaskInfo taskInfo, Function() onFinished) {
|
||||||
|
return 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: false,
|
||||||
|
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) {
|
||||||
|
final SignatureController controller = SignatureController();
|
||||||
|
|
||||||
|
var popupHeight = MediaQuery.of(context).size.height * 0.85;
|
||||||
|
var popupWidth = MediaQuery.of(context).size.width * 0.85;
|
||||||
|
|
||||||
|
return SizedBox(
|
||||||
|
key: GlobalKey(),
|
||||||
|
height: popupHeight,
|
||||||
|
width: popupWidth,
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
color: Colors.white,
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors.grey,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(20.0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text(taskInfo.task.topic),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Expanded(
|
||||||
|
child: Signature(
|
||||||
|
controller: controller,
|
||||||
|
width: 500,
|
||||||
|
height: 200,
|
||||||
|
backgroundColor: Colors.lightBlueAccent,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
getDefaultButton('Übernehmen', buttonHeight: 50, () => {
|
||||||
|
onFinished()
|
||||||
|
})
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
@@ -390,6 +390,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.17"
|
version: "2.0.17"
|
||||||
|
flutter_svg:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_svg
|
||||||
|
sha256: f991fdb1533c3caeee0cdc14b04f50f0c3916f0dbcbc05237ccbe4e3c6b93f3f
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.5"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -456,6 +464,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.2"
|
version: "4.0.2"
|
||||||
|
image:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: image
|
||||||
|
sha256: "028f61960d56f26414eb616b48b04eb37d700cbe477b7fb09bf1d7ce57fd9271"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.1.3"
|
||||||
image_picker:
|
image_picker:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -704,6 +720,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.2"
|
version: "1.8.2"
|
||||||
|
path_parsing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_parsing
|
||||||
|
sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.1"
|
||||||
path_provider:
|
path_provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -792,6 +816,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.3"
|
version: "0.1.3"
|
||||||
|
petitparser:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: petitparser
|
||||||
|
sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.1.0"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -936,6 +968,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.4"
|
version: "1.0.4"
|
||||||
|
signature:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: signature
|
||||||
|
sha256: d95143b8e310b395ea0be59a46bb69fa24106cb6ec79815fc56fd320268e24e6
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.4.0"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -1133,6 +1173,30 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.7"
|
version: "3.0.7"
|
||||||
|
vector_graphics:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vector_graphics
|
||||||
|
sha256: ea8d3fc7b2e0f35de38a7465063ecfcf03d8217f7962aa2a6717132cb5d43a79
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.5"
|
||||||
|
vector_graphics_codec:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vector_graphics_codec
|
||||||
|
sha256: a5eaa5d19e123ad4f61c3718ca1ed921c4e6254238d9145f82aa214955d9aced
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.5"
|
||||||
|
vector_graphics_compiler:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vector_graphics_compiler
|
||||||
|
sha256: "15edc42f7eaa478ce854eaf1fbb9062a899c0e4e56e775dd73b7f4709c97c4ca"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.5"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1181,6 +1245,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.3"
|
version: "1.0.3"
|
||||||
|
xml:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: xml
|
||||||
|
sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.2.2"
|
||||||
xxh3:
|
xxh3:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ dependencies:
|
|||||||
latlong2: ^0.8.2
|
latlong2: ^0.8.2
|
||||||
flutter_barcode_scanner: ^2.0.0
|
flutter_barcode_scanner: ^2.0.0
|
||||||
carousel_slider: ^4.2.1
|
carousel_slider: ^4.2.1
|
||||||
|
signature: ^5.4.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Reference in new issue
Block a user