add service for appwrite
This commit is contained in:
@@ -7,6 +7,9 @@
|
|||||||
|
|
||||||
# The following line activates a set of recommended lints for Flutter apps,
|
# The following line activates a set of recommended lints for Flutter apps,
|
||||||
# packages, and plugins designed to encourage good coding practices.
|
# packages, and plugins designed to encourage good coding practices.
|
||||||
|
analyzer:
|
||||||
|
errors:
|
||||||
|
avoid_print: ignore
|
||||||
include: package:flutter_lints/flutter.yaml
|
include: package:flutter_lints/flutter.yaml
|
||||||
|
|
||||||
linter:
|
linter:
|
||||||
|
|||||||
12
lib/configs/environment.dart
Normal file
12
lib/configs/environment.dart
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
class Environment {
|
||||||
|
static const String appwritePublicEndpoint =
|
||||||
|
'https://appwrite.joshihomeserver.ipv64.net/v1';
|
||||||
|
static const String appwriteProjectId = '6894f2b0001f127bab72';
|
||||||
|
static const String appwriteProjectName = 'Flutter Projects';
|
||||||
|
static const String appwriteRealtimeCollectionId = '699e0b3d0006563a668b';
|
||||||
|
static const String appwriteDatabaseId = '68a22ef90021b90f0f43';
|
||||||
|
static const String appwriteUserEMail = 'wei@a1.net';
|
||||||
|
static const String appwritePasswd = '123456789';
|
||||||
|
//static const String locationIQKey = 'pk.dea65023dc6fed25c96902bb97fb231d';
|
||||||
|
//static const String locationIQBaseUrl = 'https://eu1.locationiq.com/v1/reverse?key=$locationIQKey&';
|
||||||
|
}
|
||||||
@@ -1,11 +1,14 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../models/home_model.dart';
|
import '../models/home_model.dart';
|
||||||
|
import '../services/appwrite_service.dart';
|
||||||
import '../widgets/add_weight_dialog.dart';
|
import '../widgets/add_weight_dialog.dart';
|
||||||
|
|
||||||
class HomeController extends GetxController {
|
class HomeController extends GetxController {
|
||||||
|
final isLoggedIn = false.obs;
|
||||||
final isloading = false.obs;
|
final isloading = false.obs;
|
||||||
final List<WeightModel> weights = <WeightModel>[].obs;
|
final List<WeightModel> weights = <WeightModel>[].obs;
|
||||||
|
final appwriteService = AppwriteService();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
@@ -19,26 +22,48 @@ class HomeController extends GetxController {
|
|||||||
@override
|
@override
|
||||||
void onClose() {}
|
void onClose() {}
|
||||||
|
|
||||||
void _loadDataList() {
|
void _loadDataList() async {
|
||||||
isloading.value = true;
|
isloading.value = true;
|
||||||
if (weights.isNotEmpty) {
|
if (weights.isNotEmpty) {
|
||||||
weights.clear();
|
weights.clear();
|
||||||
}
|
}
|
||||||
// Simulate loading data from a database or API
|
isLoggedIn.value = await appwriteService.login();
|
||||||
weights.assignAll(WeightModel.sampleData);
|
if (isLoggedIn.value) {
|
||||||
|
final documents = await appwriteService.getDocumentsFromCollection();
|
||||||
|
if (documents.isEmpty) {
|
||||||
|
print(
|
||||||
|
'Keine Dokumente gefunden. Stelle sicher, dass die Collection Einträge enthält.',
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
print(
|
||||||
|
'Dokumente erfolgreich geladen: ${documents.length} Einträge gefunden.',
|
||||||
|
);
|
||||||
|
weights.assignAll(
|
||||||
|
documents.map((doc) => WeightModel.fromJson(doc.data)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print('Fehler beim Einloggen. Keine Daten geladen.');
|
||||||
|
}
|
||||||
isloading.value = false;
|
isloading.value = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void addWeightEntry(WeightModel entry) {
|
void addWeightEntry(WeightModel entry) {
|
||||||
weights.add(entry);
|
weights.add(entry);
|
||||||
|
var map = WeightModel.toMapForAppwrite(entry);
|
||||||
|
appwriteService.createDocumentInCollection(map);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void editWeightEntry(WeightModel updated) {
|
void editWeightEntry(WeightModel updated) {
|
||||||
final idx = weights.indexWhere((w) => w.id == updated.id);
|
final idx = weights.indexWhere(
|
||||||
|
(w) => w.documentId == updated.documentId && w.date == updated.date,
|
||||||
|
);
|
||||||
if (idx != -1) {
|
if (idx != -1) {
|
||||||
weights[idx] = updated;
|
weights[idx] = updated;
|
||||||
|
var map = WeightModel.toMapForAppwrite(updated);
|
||||||
|
appwriteService.updateDocumentInCollection(updated.documentId, map);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,8 +92,9 @@ class HomeController extends GetxController {
|
|||||||
|
|
||||||
// ── Dialog-Logik ─────────────────────────────────────────────────────────
|
// ── Dialog-Logik ─────────────────────────────────────────────────────────
|
||||||
|
|
||||||
Future<void> openAddDialog(String personName) async {
|
Future<void> openAddDialog(String personName, String userId) async {
|
||||||
final entry = await AddWeightDialog.show(
|
final entry = await AddWeightDialog.show(
|
||||||
|
userId: userId,
|
||||||
personName: personName,
|
personName: personName,
|
||||||
lastWeight: getLastWeight(personName),
|
lastWeight: getLastWeight(personName),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,33 +1,35 @@
|
|||||||
class WeightModel {
|
class WeightModel {
|
||||||
|
final String documentId;
|
||||||
final String name;
|
final String name;
|
||||||
final double weight;
|
final double weight;
|
||||||
final DateTime date;
|
final DateTime date;
|
||||||
final String id;
|
|
||||||
final double weightChange;
|
final double weightChange;
|
||||||
|
|
||||||
WeightModel({
|
WeightModel({
|
||||||
required this.weight,
|
required this.weight,
|
||||||
required this.date,
|
required this.date,
|
||||||
required this.id,
|
required this.weightChange,
|
||||||
required this.weightChange, required this.name,
|
required this.name,
|
||||||
|
required this.documentId,
|
||||||
});
|
});
|
||||||
|
|
||||||
static WeightModel fromJson(Map<String, dynamic> json) {
|
static WeightModel fromJson(Map<String, dynamic> json) {
|
||||||
return WeightModel(
|
return WeightModel(
|
||||||
weight: json['weight'],
|
weight: json['weight'],
|
||||||
date: DateTime.parse(json['date']),
|
date: DateTime.parse(json['date']),
|
||||||
id: json['id'],
|
weightChange: json['weightChange'],
|
||||||
weightChange: json['weightChange'], name: json['name'],
|
name: json['name'],
|
||||||
|
documentId: json['\$id'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> toJson(WeightModel weightModel) {
|
static Map<String, dynamic> toMapForAppwrite(WeightModel weightModel) {
|
||||||
return {
|
return {
|
||||||
'weight': weightModel.weight,
|
'weight': weightModel.weight,
|
||||||
'date': weightModel.date.toIso8601String(),
|
'date': weightModel.date.toIso8601String(),
|
||||||
'id': weightModel.id,
|
|
||||||
'weightChange': weightModel.weightChange,
|
'weightChange': weightModel.weightChange,
|
||||||
'name': weightModel.name,
|
'name': weightModel.name,
|
||||||
|
//'\$id': weightModel.documentId,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,47 +37,54 @@ class WeightModel {
|
|||||||
static final empty = WeightModel(
|
static final empty = WeightModel(
|
||||||
weight: 0.0,
|
weight: 0.0,
|
||||||
date: DateTime.now(),
|
date: DateTime.now(),
|
||||||
id: '00',
|
weightChange: 0.0,
|
||||||
weightChange: 0.0, name: 'Joe',
|
name: 'Joe',
|
||||||
|
documentId: '00',
|
||||||
);
|
);
|
||||||
|
|
||||||
// Sample data for testing and demonstration purposes
|
// Sample data for testing and demonstration purposes
|
||||||
static List<WeightModel> sampleData = [
|
// static List<WeightModel> sampleData = [
|
||||||
WeightModel(
|
// WeightModel(
|
||||||
weight: 70.0,
|
// weight: 70.0,
|
||||||
date: DateTime(2024, 1, 1),
|
// date: DateTime(2024, 1, 1),
|
||||||
id: '01',
|
// weightChange: 0.0,
|
||||||
weightChange: 0.0, name: 'Joe',
|
// name: 'Joe',
|
||||||
),
|
// documentId: '699e0c79003da44797d9',
|
||||||
WeightModel(
|
// ),
|
||||||
weight: 69.5,
|
// WeightModel(
|
||||||
date: DateTime(2024, 1, 15),
|
// weight: 69.2,
|
||||||
id: '02',
|
// date: DateTime(2024, 1, 15),
|
||||||
weightChange: -0.5, name: 'Joe',
|
// weightChange: -0.5,
|
||||||
),
|
// name: 'Joe',
|
||||||
WeightModel(
|
// documentId: '699e0ca5002697256161',
|
||||||
weight: 68.0,
|
// ),
|
||||||
date: DateTime(2024, 2, 1),
|
// WeightModel(
|
||||||
id: '03',
|
// weight: 68.0,
|
||||||
weightChange: -1.5, name: 'Joe',
|
// date: DateTime(2024, 2, 1),
|
||||||
),
|
// weightChange: -1.5,
|
||||||
WeightModel(
|
// name: 'Joe',
|
||||||
weight: 100.0,
|
// documentId: '699e0cdc00352f911abe',
|
||||||
date: DateTime(2024, 1, 1),
|
// ),
|
||||||
id: '04',
|
// WeightModel(
|
||||||
weightChange: 0.0, name: 'Karl',
|
// weight: 100.0,
|
||||||
),
|
// date: DateTime(2024, 1, 1),
|
||||||
WeightModel(
|
// weightChange: 0.0,
|
||||||
weight: 95.5,
|
// name: 'Karl',
|
||||||
date: DateTime(2024, 1, 15),
|
// documentId: '699e0cfd0014079d20b7',
|
||||||
id: '05',
|
// ),
|
||||||
weightChange: -4.5, name: 'Karl',
|
// WeightModel(
|
||||||
),
|
// weight: 95.5,
|
||||||
WeightModel(
|
// date: DateTime(2024, 1, 15),
|
||||||
weight: 90.0,
|
// weightChange: -4.5,
|
||||||
date: DateTime(2024, 2, 1),
|
// name: 'Karl',
|
||||||
id: '06',
|
// documentId: '699e0d2100090bef253b',
|
||||||
weightChange: -5.5, name: 'Karl',
|
// ),
|
||||||
),
|
// WeightModel(
|
||||||
];
|
// weight: 90.0,
|
||||||
|
// date: DateTime(2024, 2, 1),
|
||||||
|
// weightChange: -5.5,
|
||||||
|
// name: 'Karl',
|
||||||
|
// documentId: '699e0d40001f669c6a15',
|
||||||
|
// ),
|
||||||
|
// ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,17 +79,19 @@ class HomePage extends GetView<HomeController> {
|
|||||||
? SliverGrid(
|
? SliverGrid(
|
||||||
gridDelegate:
|
gridDelegate:
|
||||||
const SliverGridDelegateWithMaxCrossAxisExtent(
|
const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
maxCrossAxisExtent: 600,
|
maxCrossAxisExtent: 600,
|
||||||
mainAxisSpacing: 16,
|
mainAxisSpacing: 16,
|
||||||
crossAxisSpacing: 16,
|
crossAxisSpacing: 16,
|
||||||
childAspectRatio: 0.95,
|
childAspectRatio: 0.95,
|
||||||
),
|
),
|
||||||
delegate: SliverChildBuilderDelegate(
|
delegate: SliverChildBuilderDelegate(
|
||||||
(context, i) => PersonWeightCard(
|
(context, i) => PersonWeightCard(
|
||||||
personName: names[i],
|
personName: names[i],
|
||||||
entries: grouped[names[i]]!,
|
entries: grouped[names[i]]!,
|
||||||
onAddWeight: () =>
|
onAddWeight: () => homeCtrl.openAddDialog(
|
||||||
homeCtrl.openAddDialog(names[i]),
|
names[i],
|
||||||
|
grouped[names[i]]!.first.documentId,
|
||||||
|
),
|
||||||
onEditEntry: (entry) =>
|
onEditEntry: (entry) =>
|
||||||
homeCtrl.openEditDialog(entry),
|
homeCtrl.openEditDialog(entry),
|
||||||
),
|
),
|
||||||
@@ -103,8 +105,10 @@ class HomePage extends GetView<HomeController> {
|
|||||||
child: PersonWeightCard(
|
child: PersonWeightCard(
|
||||||
personName: names[i],
|
personName: names[i],
|
||||||
entries: grouped[names[i]]!,
|
entries: grouped[names[i]]!,
|
||||||
onAddWeight: () =>
|
onAddWeight: () => homeCtrl.openAddDialog(
|
||||||
homeCtrl.openAddDialog(names[i]),
|
names[i],
|
||||||
|
grouped[names[i]]!.first.documentId,
|
||||||
|
),
|
||||||
onEditEntry: (entry) =>
|
onEditEntry: (entry) =>
|
||||||
homeCtrl.openEditDialog(entry),
|
homeCtrl.openEditDialog(entry),
|
||||||
),
|
),
|
||||||
@@ -122,5 +126,3 @@ class HomePage extends GetView<HomeController> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
155
lib/services/appwrite_service.dart
Normal file
155
lib/services/appwrite_service.dart
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
|
||||||
|
import 'package:appwrite/models.dart';
|
||||||
|
import 'package:appwrite/appwrite.dart';
|
||||||
|
|
||||||
|
import '../configs/environment.dart';
|
||||||
|
|
||||||
|
class AppwriteService {
|
||||||
|
static final String endpoint = Environment.appwritePublicEndpoint;
|
||||||
|
static final String projectId = Environment.appwriteProjectId;
|
||||||
|
static final String projectName = Environment.appwriteProjectName;
|
||||||
|
static final String realtimeCollectionId =
|
||||||
|
Environment.appwriteRealtimeCollectionId;
|
||||||
|
static final String databaseId = Environment.appwriteDatabaseId;
|
||||||
|
static final String userEMail = Environment.appwriteUserEMail;
|
||||||
|
static final String passwd = Environment.appwritePasswd;
|
||||||
|
|
||||||
|
final Client _client = Client().setProject(projectId).setEndpoint(endpoint);
|
||||||
|
|
||||||
|
// ignore: unused_field
|
||||||
|
late final Account _account;
|
||||||
|
// ignore: unused_field
|
||||||
|
late final Databases _databases;
|
||||||
|
|
||||||
|
AppwriteService._internal() {
|
||||||
|
_account = Account(_client);
|
||||||
|
_databases = Databases(_client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static final AppwriteService _instance = AppwriteService._internal();
|
||||||
|
|
||||||
|
/// Singleton instance getter
|
||||||
|
factory AppwriteService() => _instance;
|
||||||
|
|
||||||
|
// login with e-Mail and password
|
||||||
|
Future<bool> login() async {
|
||||||
|
await logout();
|
||||||
|
try {
|
||||||
|
final session = await _account.createEmailPasswordSession(
|
||||||
|
email: userEMail,
|
||||||
|
password: passwd,
|
||||||
|
);
|
||||||
|
print('Login erfolgreich: ${session.$id}');
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
print('Login fehlgeschlagen: $e');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// logout current user
|
||||||
|
Future<bool> logout() async {
|
||||||
|
try {
|
||||||
|
await _account.deleteSession(sessionId: 'current');
|
||||||
|
print('Logout erfolgreich');
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
print('Logout fehlgeschlagen: $e');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Get current user ID
|
||||||
|
Future<String?> getCurrentUserId() async {
|
||||||
|
try {
|
||||||
|
final user = await _account.get();
|
||||||
|
return user.$id;
|
||||||
|
} catch (e) {
|
||||||
|
print('Fehler beim Abrufen der Benutzer-ID: $e');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get List<Document> from Realtime Collection
|
||||||
|
Future<List<Document>> getDocumentsFromCollection() async {
|
||||||
|
try {
|
||||||
|
final documents = await _databases.listDocuments(
|
||||||
|
databaseId: databaseId,
|
||||||
|
collectionId: realtimeCollectionId,
|
||||||
|
queries: [Query.orderAsc('name'), Query.orderDesc('date')],
|
||||||
|
);
|
||||||
|
return documents.documents;
|
||||||
|
} catch (e) {
|
||||||
|
print('Fehler beim Abrufen der Dokumente: $e');
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get Document per Id from Realtime Collection
|
||||||
|
Future<Document?> getDocumentById(String documentId) async {
|
||||||
|
try {
|
||||||
|
final document = await _databases.getDocument(
|
||||||
|
databaseId: databaseId,
|
||||||
|
collectionId: realtimeCollectionId,
|
||||||
|
documentId: documentId,
|
||||||
|
);
|
||||||
|
return document;
|
||||||
|
} catch (e) {
|
||||||
|
print('Fehler beim Abrufen des Dokuments: $e');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save a new document to Realtime Collection
|
||||||
|
Future<bool> createDocumentInCollection(Map<String, dynamic> data) async {
|
||||||
|
try {
|
||||||
|
await _databases.createDocument(
|
||||||
|
databaseId: databaseId,
|
||||||
|
collectionId: realtimeCollectionId,
|
||||||
|
documentId: ID.unique(),
|
||||||
|
data: data,
|
||||||
|
);
|
||||||
|
print('Dokument erfolgreich erstellt');
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
print('Fehler beim Erstellen des Dokuments: $e');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update an existing document in Realtime Collection
|
||||||
|
Future<bool> updateDocumentInCollection(
|
||||||
|
String documentId,
|
||||||
|
Map<String, dynamic> data,
|
||||||
|
) async {
|
||||||
|
try {
|
||||||
|
await _databases.updateDocument(
|
||||||
|
databaseId: databaseId,
|
||||||
|
collectionId: realtimeCollectionId,
|
||||||
|
documentId: documentId,
|
||||||
|
data: data,
|
||||||
|
);
|
||||||
|
print('Dokument erfolgreich aktualisiert');
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
print('Fehler beim Aktualisieren des Dokuments: $e');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete a document from Realtime Collection
|
||||||
|
Future<bool> deleteDocumentFromCollection(String documentId) async {
|
||||||
|
try {
|
||||||
|
await _databases.deleteDocument(
|
||||||
|
databaseId: databaseId,
|
||||||
|
collectionId: realtimeCollectionId,
|
||||||
|
documentId: documentId,
|
||||||
|
);
|
||||||
|
print('Dokument erfolgreich gelöscht');
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
print('Fehler beim Löschen des Dokuments: $e');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import 'package:intl/intl.dart';
|
|||||||
import '../models/home_model.dart';
|
import '../models/home_model.dart';
|
||||||
|
|
||||||
class AddWeightDialog extends StatefulWidget {
|
class AddWeightDialog extends StatefulWidget {
|
||||||
|
final String userId;
|
||||||
final String personName;
|
final String personName;
|
||||||
|
|
||||||
/// Letztes bekanntes Gewicht dieser Person – wird für weightChange benötigt.
|
/// Letztes bekanntes Gewicht dieser Person – wird für weightChange benötigt.
|
||||||
@@ -16,6 +17,7 @@ class AddWeightDialog extends StatefulWidget {
|
|||||||
|
|
||||||
const AddWeightDialog({
|
const AddWeightDialog({
|
||||||
super.key,
|
super.key,
|
||||||
|
required this.userId,
|
||||||
required this.personName,
|
required this.personName,
|
||||||
required this.lastWeight,
|
required this.lastWeight,
|
||||||
this.existingEntry,
|
this.existingEntry,
|
||||||
@@ -23,11 +25,16 @@ class AddWeightDialog extends StatefulWidget {
|
|||||||
|
|
||||||
/// Öffnet den Dialog zum Hinzufügen eines neuen Eintrags.
|
/// Öffnet den Dialog zum Hinzufügen eines neuen Eintrags.
|
||||||
static Future<WeightModel?> show({
|
static Future<WeightModel?> show({
|
||||||
|
required String userId,
|
||||||
required String personName,
|
required String personName,
|
||||||
required double lastWeight,
|
required double lastWeight,
|
||||||
}) {
|
}) {
|
||||||
return Get.dialog<WeightModel>(
|
return Get.dialog<WeightModel>(
|
||||||
AddWeightDialog(personName: personName, lastWeight: lastWeight),
|
AddWeightDialog(
|
||||||
|
userId: userId,
|
||||||
|
personName: personName,
|
||||||
|
lastWeight: lastWeight,
|
||||||
|
),
|
||||||
barrierColor: Colors.black.withValues(alpha: 0.55),
|
barrierColor: Colors.black.withValues(alpha: 0.55),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -40,6 +47,7 @@ class AddWeightDialog extends StatefulWidget {
|
|||||||
}) {
|
}) {
|
||||||
return Get.dialog<WeightModel>(
|
return Get.dialog<WeightModel>(
|
||||||
AddWeightDialog(
|
AddWeightDialog(
|
||||||
|
userId: entry.documentId,
|
||||||
personName: entry.name,
|
personName: entry.name,
|
||||||
lastWeight: previousWeight,
|
lastWeight: previousWeight,
|
||||||
existingEntry: entry,
|
existingEntry: entry,
|
||||||
@@ -135,9 +143,10 @@ class _AddWeightDialogState extends State<AddWeightDialog>
|
|||||||
final name = _nameController.text.trim();
|
final name = _nameController.text.trim();
|
||||||
final entry = WeightModel(
|
final entry = WeightModel(
|
||||||
// Im Edit-Modus dieselbe ID behalten
|
// Im Edit-Modus dieselbe ID behalten
|
||||||
id:
|
documentId:
|
||||||
widget.existingEntry?.id ??
|
widget.existingEntry?.documentId ??
|
||||||
DateTime.now().millisecondsSinceEpoch.toString(),
|
DateTime.now().millisecondsSinceEpoch.toString(),
|
||||||
|
|
||||||
name: name,
|
name: name,
|
||||||
weight: _parsedWeight!,
|
weight: _parsedWeight!,
|
||||||
date: _selectedDate,
|
date: _selectedDate,
|
||||||
|
|||||||
367
pubspec.lock
367
pubspec.lock
@@ -1,6 +1,14 @@
|
|||||||
# Generated by pub
|
# Generated by pub
|
||||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||||
packages:
|
packages:
|
||||||
|
appwrite:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: appwrite
|
||||||
|
sha256: "3e1f618c8f75bafa49ef7b1b445f64c53cf4620a195443f4d119bbc95a666d0a"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "14.0.0"
|
||||||
async:
|
async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -33,6 +41,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.2"
|
version: "1.1.2"
|
||||||
|
code_assets:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: code_assets
|
||||||
|
sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.0"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -41,6 +57,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.19.1"
|
version: "1.19.1"
|
||||||
|
cookie_jar:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: cookie_jar
|
||||||
|
sha256: a6ac027d3ed6ed756bfce8f3ff60cb479e266f3b0fdabd6242b804b6765e52de
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.8"
|
||||||
|
crypto:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: crypto
|
||||||
|
sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.7"
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -49,6 +81,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.8"
|
version: "1.0.8"
|
||||||
|
device_info_plus:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: device_info_plus
|
||||||
|
sha256: a7fd703482b391a87d60b6061d04dfdeab07826b96f9abd8f5ed98068acc0074
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "10.1.2"
|
||||||
|
device_info_plus_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: device_info_plus_platform_interface
|
||||||
|
sha256: e1ea89119e34903dca74b883d0dd78eb762814f97fb6c76f35e9ff74d261a18f
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "7.0.3"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -57,6 +105,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.3"
|
version: "1.3.3"
|
||||||
|
ffi:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: ffi
|
||||||
|
sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.0"
|
||||||
|
file:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file
|
||||||
|
sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "7.0.1"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -75,6 +139,27 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_web_auth_2:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_web_auth_2
|
||||||
|
sha256: "4d3d2fd3d26bf1a26b3beafd4b4b899c0ffe10dc99af25abc58ffe24e991133c"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.2"
|
||||||
|
flutter_web_auth_2_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_web_auth_2_platform_interface
|
||||||
|
sha256: e8669e262005a8354389ba2971f0fc1c36188481234ff50d013aaf993f30f739
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0"
|
||||||
|
flutter_web_plugins:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
get:
|
get:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -83,6 +168,38 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.7.3"
|
version: "4.7.3"
|
||||||
|
glob:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: glob
|
||||||
|
sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.3"
|
||||||
|
hooks:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: hooks
|
||||||
|
sha256: "7a08a0d684cb3b8fb604b78455d5d352f502b68079f7b80b831c62220ab0a4f6"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.1"
|
||||||
|
http:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http
|
||||||
|
sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.6.0"
|
||||||
|
http_parser:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http_parser
|
||||||
|
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.1.2"
|
||||||
intl:
|
intl:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -123,6 +240,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.0"
|
version: "6.1.0"
|
||||||
|
logging:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: logging
|
||||||
|
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.3.0"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -147,6 +272,38 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.17.0"
|
version: "1.17.0"
|
||||||
|
native_toolchain_c:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: native_toolchain_c
|
||||||
|
sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.17.4"
|
||||||
|
objective_c:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: objective_c
|
||||||
|
sha256: "100a1c87616ab6ed41ec263b083c0ef3261ee6cd1dc3b0f35f8ddfa4f996fe52"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "9.3.0"
|
||||||
|
package_info_plus:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: package_info_plus
|
||||||
|
sha256: "16eee997588c60225bda0488b6dcfac69280a6b7a3cf02c741895dd370a02968"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "8.3.1"
|
||||||
|
package_info_plus_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: package_info_plus_platform_interface
|
||||||
|
sha256: "202a487f08836a592a6bd4f901ac69b3a8f146af552bbd14407b6b41e1c3f086"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.2.1"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -155,6 +312,78 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.1"
|
version: "1.9.1"
|
||||||
|
path_provider:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider
|
||||||
|
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.5"
|
||||||
|
path_provider_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_android
|
||||||
|
sha256: f2c65e21139ce2c3dad46922be8272bb5963516045659e71bb16e151c93b580e
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.22"
|
||||||
|
path_provider_foundation:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_foundation
|
||||||
|
sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.6.0"
|
||||||
|
path_provider_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_linux
|
||||||
|
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.1"
|
||||||
|
path_provider_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_platform_interface
|
||||||
|
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.2"
|
||||||
|
path_provider_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_windows
|
||||||
|
sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.0"
|
||||||
|
platform:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: platform
|
||||||
|
sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.6"
|
||||||
|
plugin_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: plugin_platform_interface
|
||||||
|
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.8"
|
||||||
|
pub_semver:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: pub_semver
|
||||||
|
sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.0"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -208,6 +437,86 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.9"
|
version: "0.7.9"
|
||||||
|
typed_data:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: typed_data
|
||||||
|
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.4.0"
|
||||||
|
universal_io:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: universal_io
|
||||||
|
sha256: f63cbc48103236abf48e345e07a03ce5757ea86285ed313a6a032596ed9301e2
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.1"
|
||||||
|
url_launcher:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher
|
||||||
|
sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.3.2"
|
||||||
|
url_launcher_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_android
|
||||||
|
sha256: "767344bf3063897b5cf0db830e94f904528e6dd50a6dfaf839f0abf509009611"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.3.28"
|
||||||
|
url_launcher_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_ios
|
||||||
|
sha256: "580fe5dfb51671ae38191d316e027f6b76272b026370708c2d898799750a02b0"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.4.1"
|
||||||
|
url_launcher_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_linux
|
||||||
|
sha256: d5e14138b3bc193a0f63c10a53c94b91d399df0512b1f29b94a043db7482384a
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.2.2"
|
||||||
|
url_launcher_macos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_macos
|
||||||
|
sha256: "368adf46f71ad3c21b8f06614adb38346f193f3a59ba8fe9a2fd74133070ba18"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.2.5"
|
||||||
|
url_launcher_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_platform_interface
|
||||||
|
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.2"
|
||||||
|
url_launcher_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_web
|
||||||
|
sha256: d0412fcf4c6b31ecfdb7762359b7206ffba3bbffd396c6d9f9c4616ece476c1f
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.2"
|
||||||
|
url_launcher_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_windows
|
||||||
|
sha256: "712c70ab1b99744ff066053cbe3e80c73332b38d46e5e945c98689b2e66fc15f"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.5"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -232,6 +541,62 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.1.1"
|
||||||
|
web_socket:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: web_socket
|
||||||
|
sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.1"
|
||||||
|
web_socket_channel:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: web_socket_channel
|
||||||
|
sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.3"
|
||||||
|
win32:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: win32
|
||||||
|
sha256: d7cb55e04cd34096cd3a79b3330245f54cb96a370a1c27adb3c84b917de8b08e
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.15.0"
|
||||||
|
win32_registry:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: win32_registry
|
||||||
|
sha256: "21ec76dfc731550fd3e2ce7a33a9ea90b828fdf19a5c3bcf556fa992cfa99852"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.5"
|
||||||
|
window_to_front:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: window_to_front
|
||||||
|
sha256: "7aef379752b7190c10479e12b5fd7c0b9d92adc96817d9e96c59937929512aee"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.3"
|
||||||
|
xdg_directories:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: xdg_directories
|
||||||
|
sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.0"
|
||||||
|
yaml:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: yaml
|
||||||
|
sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.3"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.11.0 <4.0.0"
|
dart: ">=3.11.0 <4.0.0"
|
||||||
flutter: ">=3.18.0-18.0.pre.54"
|
flutter: ">=3.38.4"
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ dependencies:
|
|||||||
sdk: flutter
|
sdk: flutter
|
||||||
get: ^4.7.3
|
get: ^4.7.3
|
||||||
intl: ^0.20.2
|
intl: ^0.20.2
|
||||||
|
appwrite: ^14.0.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_lints: ^6.0.0
|
flutter_lints: ^6.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user