Entferne PocketBase-Abhängigkeit und Analytics-Skript hinzugefügt
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:pocketbase/pocketbase.dart'; // Import the PocketBase package
|
||||
import 'expectation_input_page.dart';
|
||||
import '../widgets/clearance_field.dart';
|
||||
|
||||
@@ -33,7 +32,6 @@ class FinalClearanceDisplayState extends State<FinalClearanceDisplay> {
|
||||
late String altitude;
|
||||
late String squawk;
|
||||
late String frequency;
|
||||
final PocketBase pb = PocketBase('https://backend.degnedict.de'); // Initialize PocketBase
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -43,24 +41,8 @@ class FinalClearanceDisplayState extends State<FinalClearanceDisplay> {
|
||||
altitude = widget.altitude;
|
||||
squawk = widget.squawk;
|
||||
frequency = widget.frequency;
|
||||
|
||||
_createPageViewRecord(); // Create a record with the current timestamp
|
||||
}
|
||||
|
||||
// Function to create a new record with a timestamp in epoch milliseconds in your PocketBase collection
|
||||
Future<void> _createPageViewRecord() async {
|
||||
try {
|
||||
// Get the current time in epoch milliseconds
|
||||
int currentTimeInMillis = DateTime.now().millisecondsSinceEpoch;
|
||||
|
||||
// Create a new record in the collection with the current epoch time
|
||||
await pb.collection('IFRbuddyUsage').create(body: {
|
||||
'timestamp': currentTimeInMillis, // Save current timestamp as epoch time (milliseconds)
|
||||
});
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
// Navigate back to the first page (ExpectationInputPage)
|
||||
void _navigateHome(BuildContext context) {
|
||||
Navigator.pushAndRemoveUntil(
|
||||
|
||||
Reference in New Issue
Block a user