Erweiterungen
This commit is contained in:
1 parent
c604dc9d55
commit
31fe4c5a06
20 files changed
+1804
-654
No files matched your search
@@ -1,62 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kumi_popup_window/kumi_popup_window.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
KumiPopupWindow showTaskArrivedPopup(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: 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.2,
|
||||
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(35.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(taskInfo.task.topic),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton(taskInfo.task.topic, () => {
|
||||
onFinished()
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
},
|
||||
);
|
||||
showTaskArrivedPopup(BuildContext context, TaskInfo taskInfo, Function() onFinished) async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context)
|
||||
{
|
||||
return AlertDialog(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: Colors.white,
|
||||
content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
||||
return SizedBox(
|
||||
key: GlobalKey(),
|
||||
height: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.height * 0.2,
|
||||
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(35.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(taskInfo.task.topic),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton(taskInfo.task.topic, () =>
|
||||
{
|
||||
Navigator.of(context).pop(),
|
||||
|
||||
onFinished()
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user