cpd_job_app/lib/services/global_methods.dart

52 lines
1.3 KiB
Dart
Raw Normal View History

2023-05-31 20:04:38 +02:00
// ignore_for_file: prefer_const_constructors
import 'package:flutter/material.dart';
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(
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: () {
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),
),
),
],
);
},
);
}
static void getPicture() {}
2023-05-31 20:04:38 +02:00
}