forked from yaso_meth/mih-project
Enable android dev and prod
This commit is contained in:
@@ -13,8 +13,8 @@ abstract class AppEnviroment {
|
||||
switch (env) {
|
||||
case Enviroment.dev:
|
||||
{
|
||||
baseApiUrl = "http://localhost:8080"; //"http://10.0.2.2:8080";
|
||||
baseFileUrl = "http://localhost:9000"; //"http://10.0.2.2:9000";
|
||||
baseApiUrl = "http://10.0.2.2:8080"; //"http://localhost:8080";
|
||||
baseFileUrl = "http://10.0.2.2:9000"; //"http://localhost:9000";
|
||||
whatsappAccessToken =
|
||||
"EAAPINXuNFdYBOzBjTcvZA2iPXEHbHRF9uNXyP3ihkPRUcBqKNru5g9NKRRKkFaiaITEzO3BMo6CjdUmlDH4qYTW2mzDrZB4Q21ZCEZBgECZCu27vfaOXJZCYQLNxwoXkrZBRYv8ZAP37f69r3z9JxLQxdxn9gwqA3oNZAlBBRapJQzxOr6pZBTdI3bbjbu17ZBIwRcF4JCqPDCNLEZCI3bmHwEd2i2niNMYZD";
|
||||
//fingerPrintPluginKey = 'h5X7a5j14iUZCobI1ZeX';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
// import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -10,7 +11,7 @@ import 'package:mobile_scanner/mobile_scanner.dart';
|
||||
// import 'package:simple_barcode_scanner/screens/web.dart';
|
||||
// import 'package:simple_barcode_scanner/simple_barcode_scanner.dart';
|
||||
import '../../main.dart';
|
||||
// import 'package:supertokens_flutter/http.dart' as http;
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
import "package:universal_html/html.dart" as html;
|
||||
|
||||
import '../../mih_apis/mih_location_api.dart';
|
||||
@@ -949,27 +950,30 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
}
|
||||
|
||||
Future<void> refreshNotifications() async {
|
||||
html.window.location.reload();
|
||||
// var responseNotification = await http.get(Uri.parse(
|
||||
// "$baseAPI/notifications/${widget.signedInUser.app_id}?amount=$amount"));
|
||||
// List<MIHNotification> notifi;
|
||||
// if (responseNotification.statusCode == 200) {
|
||||
// String body = responseNotification.body;
|
||||
// // var decodedData = jsonDecode(body);
|
||||
// // MIHNotification notifications = MIHNotification.fromJson(decodedData);
|
||||
if (MzanziInnovationHub.of(context)!.theme.getPlatform() == "Web") {
|
||||
html.window.location.reload();
|
||||
} else {
|
||||
var responseNotification = await http.get(Uri.parse(
|
||||
"$baseAPI/notifications/${widget.signedInUser.app_id}?amount=$amount"));
|
||||
List<MIHNotification> 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<MIHNotification> notifications = List<MIHNotification>.from(
|
||||
// l.map((model) => MIHNotification.fromJson(model)));
|
||||
// notifi = notifications;
|
||||
// } else {
|
||||
// notifi = [];
|
||||
// }
|
||||
// setState(() {
|
||||
// notifiList = notifi;
|
||||
// });
|
||||
// notificationPopUp();
|
||||
Iterable l = jsonDecode(body);
|
||||
//print("Here2");
|
||||
List<MIHNotification> notifications = List<MIHNotification>.from(
|
||||
l.map((model) => MIHNotification.fromJson(model)));
|
||||
notifi = notifications;
|
||||
} else {
|
||||
notifi = [];
|
||||
}
|
||||
setState(() {
|
||||
notifiList = notifi;
|
||||
});
|
||||
notificationPopUp();
|
||||
}
|
||||
}
|
||||
|
||||
void notificationPopUp() {
|
||||
|
||||
Reference in New Issue
Block a user