From c881689ff8b46d881555e83d4d575ff073ac55b3 Mon Sep 17 00:00:00 2001 From: yaso Date: Wed, 27 Nov 2024 20:00:45 +0200 Subject: [PATCH] homescreen pull down to refresh app --- .../lib/mih_packages/mih_home/mih_home.dart | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Frontend/lib/mih_packages/mih_home/mih_home.dart b/Frontend/lib/mih_packages/mih_home/mih_home.dart index 838e8890..8b933863 100644 --- a/Frontend/lib/mih_packages/mih_home/mih_home.dart +++ b/Frontend/lib/mih_packages/mih_home/mih_home.dart @@ -11,7 +11,7 @@ import 'package:mobile_scanner/mobile_scanner.dart'; // import 'package:simple_barcode_scanner/simple_barcode_scanner.dart'; import '../../main.dart'; import 'package:supertokens_flutter/http.dart' as http; -// import "package:universal_html/html.dart" as html; +import "package:universal_html/html.dart" as html; import '../../mih_apis/mih_location_api.dart'; import '../../mih_components/mih_inputs_and_buttons/mih_search_input.dart'; @@ -948,27 +948,27 @@ class _MIHHomeState extends State { } Future refreshNotifications() async { - //html.window.location.reload(); - var responseNotification = await http.get(Uri.parse( - "$baseAPI/notifications/${widget.signedInUser.app_id}?amount=$amount")); - List notifi; - if (responseNotification.statusCode == 200) { - String body = responseNotification.body; - // var decodedData = jsonDecode(body); - // MIHNotification notifications = MIHNotification.fromJson(decodedData); + html.window.location.reload(); + // var responseNotification = await http.get(Uri.parse( + // "$baseAPI/notifications/${widget.signedInUser.app_id}?amount=$amount")); + // List notifi; + // if (responseNotification.statusCode == 200) { + // String body = responseNotification.body; + // // var decodedData = jsonDecode(body); + // // MIHNotification notifications = MIHNotification.fromJson(decodedData); - Iterable l = jsonDecode(body); - //print("Here2"); - List notifications = List.from( - l.map((model) => MIHNotification.fromJson(model))); - notifi = notifications; - } else { - notifi = []; - } - setState(() { - notifiList = notifi; - }); - notificationPopUp(); + // Iterable l = jsonDecode(body); + // //print("Here2"); + // List notifications = List.from( + // l.map((model) => MIHNotification.fromJson(model))); + // notifi = notifications; + // } else { + // notifi = []; + // } + // setState(() { + // notifiList = notifi; + // }); + // notificationPopUp(); } void notificationPopUp() {