Erweiterungen

This commit is contained in:
Sven committed 2024-02-12 12:08:45 +01:00
1 parent e41008147f
commit b0dd1afb43
4 files changed
+68 -79

No files matched your search

+48 -70
View File
@@ -4,76 +4,54 @@ 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();
showSignaturePopup(BuildContext context, TaskInfo taskInfo, Function() onFinished) async {
await showDialog<void>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
contentPadding: EdgeInsets.zero,
shadowColor: Colors.transparent,
backgroundColor: Colors.white,
content: StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
final SignatureController controller = SignatureController();
var popupHeight = MediaQuery.of(context).size.height * 0.85;
var popupWidth = MediaQuery.of(context).size.width * 0.85;
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()
})
],
),
),
)
);
},
);
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, () => {Navigator.of(context).pop(), onFinished()})
],
),
),
));
},
));
});
}
/*
*/