39 lines
1.2 KiB
Dart
39 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../app_language.dart';
|
|
|
|
Future<bool> showDeactivateDialog(BuildContext context) async {
|
|
final t = TranslationService.t;
|
|
return await showDialog<bool>(
|
|
context: context,
|
|
builder: (ctx) => AlertDialog(
|
|
title: Text(t('confirm_deactivation')),
|
|
content: Text(t('deactivation_msg')),
|
|
actions: [
|
|
TextButton(onPressed: () => Navigator.pop(ctx, false), child: Text(t('cancel'))),
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx, true),
|
|
child: Text(t('deactivate'), style: const TextStyle(color: Colors.red)),
|
|
),
|
|
],
|
|
),
|
|
) ?? false;
|
|
}
|
|
|
|
Future<bool> showConfirmDialog(BuildContext context) async {
|
|
final t = TranslationService.t;
|
|
return await showDialog<bool>(
|
|
context: context,
|
|
builder: (ctx) => AlertDialog(
|
|
title: Text(t('confirm_delete')),
|
|
content: Text(t('delete_msg')),
|
|
actions: [
|
|
TextButton(onPressed: () => Navigator.pop(ctx, false), child: Text(t('cancel'))),
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx, true),
|
|
child: Text(t('delete'), style: const TextStyle(color: Colors.red)),
|
|
),
|
|
],
|
|
),
|
|
) ?? false;
|
|
}
|