begin cleanup of view_cams and begin of making it usable with exursion and place
time refactoring refactoring again
This commit is contained in:
74
lib/screens/helper/view_entries_dialog_helper.dart
Normal file
74
lib/screens/helper/view_entries_dialog_helper.dart
Normal file
@@ -0,0 +1,74 @@
|
||||
import 'package:fforte/enums/databases.dart';
|
||||
import 'package:fforte/l10n/app_localizations.dart';
|
||||
import 'package:fforte/screens/sharedMethods/delete_main_entries.dart';
|
||||
import 'package:fforte/screens/sharedMethods/delete_templates.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ViewEntriesDialogHelper {
|
||||
static void deleteAllMainEntries(
|
||||
BuildContext context,
|
||||
DatabasesEnum dbType,
|
||||
) async {
|
||||
return showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(AppLocalizations.of(context)!.deleteEverything),
|
||||
content: SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: <Widget>[
|
||||
Text(AppLocalizations.of(context)!.deleteEverythingContent),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
DeleteMainEntries.deleteAll(dbType);
|
||||
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.deleteEverything),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.cancel),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
static void deleteAllTemplates(BuildContext context, DatabasesEnum dbType) async{
|
||||
return showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(AppLocalizations.of(context)!.deleteEverything),
|
||||
content: SingleChildScrollView(
|
||||
child: ListBody(children: <Widget>[
|
||||
Text(AppLocalizations.of(context)!.deleteEverythingContent)
|
||||
]),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
DeleteTemplates.deleteAll(dbType);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.deleteEverything)),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.cancel))
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user