Files
stadtbote-app/lib/popups/tasks_popups/arrived_popup.dart
T
2024-05-29 20:34:22 +02:00

46 lines
1.9 KiB
Dart

import 'package:flutter/material.dart';
import 'package:stadtbote/model/task_info.dart';
import 'package:stadtbote/tools/util.dart';
showTaskArrivedPopup(BuildContext context, TaskInfo taskInfo, Function() onFinished) async {
await showDialog(
context: context,
builder: (BuildContext context) {
return WillPopScope(
onWillPop: () async {
return await taskDialogSecurityException(context);
}, // False will prevent and true will allow to dismiss
child: 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()}),
],
),
),
));
})));
});
}