outsourced all methods and dialogs as far as possible (I think)
This commit is contained in:
21
lib/screens/sharedMethods/save_main_entry.dart
Normal file
21
lib/screens/sharedMethods/save_main_entry.dart
Normal 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"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user