2023-05-31 20:04:38 +02:00
|
|
|
// ignore_for_file: prefer_const_constructors
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
2023-06-23 12:12:02 +02:00
|
|
|
class GlobalMethod {
|
|
|
|
static void showErrorDialog(
|
|
|
|
{required String error, required BuildContext ctx}) {
|
2023-05-31 20:04:38 +02:00
|
|
|
showDialog(
|
|
|
|
context: ctx,
|
|
|
|
builder: (context) {
|
|
|
|
return AlertDialog(
|
2023-06-23 12:12:02 +02:00
|
|
|
title: Row(
|
|
|
|
children: const [
|
2023-05-31 20:04:38 +02:00
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
child: Icon(Icons.logout, color: Colors.grey, size: 35),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
child: Text('Error Occured'),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
content: Text(
|
|
|
|
error,
|
|
|
|
style: const TextStyle(
|
|
|
|
color: Colors.black12,
|
|
|
|
fontSize: 20,
|
|
|
|
fontStyle: FontStyle.italic,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
actions: [
|
|
|
|
TextButton(
|
|
|
|
onPressed: () {
|
2023-06-23 12:12:02 +02:00
|
|
|
Navigator.canPop(context)
|
|
|
|
? Navigator.pop(context)
|
|
|
|
: null; // Zurücknavigieren, falls möglich
|
2023-05-31 20:04:38 +02:00
|
|
|
},
|
|
|
|
child: const Text(
|
|
|
|
'oki doki',
|
|
|
|
style: TextStyle(color: Colors.redAccent, fontSize: 20),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-06-23 12:12:02 +02:00
|
|
|
static void getPicture() {}
|
2023-05-31 20:04:38 +02:00
|
|
|
}
|