Initial commit: Penyerahan final Source code Tugas Akhir

This commit is contained in:
ferdiakhh
2025-07-10 19:15:14 +07:00
commit e1f2206b8a
687 changed files with 80132 additions and 0 deletions

View File

@ -0,0 +1,43 @@
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:initial_folder/models/wishlist_model.dart';
import 'package:initial_folder/services/wishlist_service.dart';
class WishlistPostProvider with ChangeNotifier {
WishlistPostModel? _wishlistPostModel;
WishlistPostModel? get wishlistPostModel => _wishlistPostModel;
setwishlistPostModel(WishlistPostModel? wishlistPostModel) {
_wishlistPostModel = wishlistPostModel;
notifyListeners();
}
Future<bool> addWishlist(int wishlistItem) async {
try {
WishlistPostModel? wishlistPostModel =
await WishlistService().addWishlist(wishlistItem);
_wishlistPostModel = wishlistPostModel;
return true;
} on SocketException {
return false;
} catch (e) {
print("Exception: $e");
return false;
}
}
Future<bool> deleteWishlist(int wishlistItem) async {
try {
WishlistPostModel? wishlistPostModel =
await WishlistService().deleteWishlist(wishlistItem);
_wishlistPostModel = wishlistPostModel;
return true;
} on SocketException {
return false;
} catch (e) {
print("Exception: $e");
return false;
}
}
}