outsourced all methods and dialogs as far as possible (I think)

This commit is contained in:
Nico
2025-05-07 21:58:24 +02:00
parent 86ffd77888
commit c86d3503fb
16 changed files with 479 additions and 257 deletions

View File

@@ -0,0 +1,21 @@
import 'package:fforte/methods/place_db_helper.dart';
class SaveMainEntryMethod {
static void saveEntry(
{required Map<String, dynamic> entryData,
required bool isTemplate,
bool sent = false}) async {
var placeDB = PlaceDBHelper();
// Get the ID of the newly added or updated place
int newPlaceId = await placeDB.addMainEntry(entryData);
if (sent == true) {
placeDB.updateSent(newPlaceId); // Update 'Sent' using the correct ID
}
if (isTemplate) {
await placeDB.deleteTemplateById(entryData["CID"]);
}
}
}