move reportUrl and reportProjectId from config to setting
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:fcs/config.dart';
|
||||
import 'package:fcs/constants.dart';
|
||||
import 'package:fcs/domain/entities/package.dart';
|
||||
import 'package:fcs/helpers/api_helper.dart';
|
||||
import 'package:fcs/helpers/firebase_helper.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
import '../services/services.dart';
|
||||
|
||||
class PackageDataProvider {
|
||||
final log = Logger('PackageDataProvider');
|
||||
|
||||
@@ -70,7 +71,7 @@ class PackageDataProvider {
|
||||
try {
|
||||
var data = await requestAPI(
|
||||
"/api/fts/$packages_collection/$escapePackage/$limit", "GET",
|
||||
url: Config.instance.reportURL, token: await getToken());
|
||||
url: Services.setting.reportURL, token: await getToken());
|
||||
|
||||
if (data == null) return [];
|
||||
|
||||
@@ -105,7 +106,7 @@ class PackageDataProvider {
|
||||
};
|
||||
var result = await requestAPI("/api/data/packages", "POST",
|
||||
token: await getToken(),
|
||||
url: Config.instance.reportURL,
|
||||
url: Services.setting.reportURL,
|
||||
payload: jsonEncode(data));
|
||||
if (result == null) return packages;
|
||||
result.forEach((d) {
|
||||
|
||||
@@ -4,8 +4,7 @@ import 'package:fcs/domain/entities/pickup.dart';
|
||||
import 'package:fcs/helpers/api_helper.dart';
|
||||
import 'package:fcs/helpers/firebase_helper.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
import '../../config.dart';
|
||||
import '../services/services.dart';
|
||||
|
||||
class PickupDataProvider {
|
||||
final log = Logger('PickupDataProvider');
|
||||
@@ -34,7 +33,7 @@ class PickupDataProvider {
|
||||
};
|
||||
var result = await requestAPI("/api/data/pickups", "POST",
|
||||
token: await getToken(),
|
||||
url: Config.instance.reportURL,
|
||||
url: Services.setting.reportURL,
|
||||
payload: jsonEncode(data));
|
||||
if (result == null) return pickups;
|
||||
result.forEach((d) {
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:fcs/config.dart';
|
||||
import 'package:fcs/constants.dart';
|
||||
import 'package:fcs/domain/entities/user.dart';
|
||||
import 'package:fcs/helpers/api_helper.dart';
|
||||
import 'package:fcs/helpers/firebase_helper.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
import '../services/services.dart';
|
||||
|
||||
class UserDataProvider {
|
||||
final log = Logger('UserDataProvider');
|
||||
|
||||
@@ -66,7 +67,7 @@ class UserDataProvider {
|
||||
try {
|
||||
var data = await requestAPI(
|
||||
"/api/fts/$user_collection/$escapeBuyer/$limit", "GET",
|
||||
url: Config.instance.reportURL, token: await getToken());
|
||||
url: Services.setting.reportURL, token: await getToken());
|
||||
|
||||
if (data == null) return [];
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import 'package:fcs/data/services/rate_service.dart';
|
||||
import 'package:fcs/data/services/shipment_imp.dart';
|
||||
import 'package:fcs/data/services/shipment_service.dart';
|
||||
|
||||
import '../../domain/entities/setting.dart';
|
||||
import 'auth_imp.dart';
|
||||
import 'auth_service.dart';
|
||||
import 'common_imp.dart';
|
||||
@@ -37,6 +38,8 @@ import 'user_service.dart';
|
||||
|
||||
class Services {
|
||||
static final Services instance = Services._();
|
||||
static Setting setting = Setting();
|
||||
|
||||
|
||||
late AuthService _authService;
|
||||
late UserService _userService;
|
||||
|
||||
Reference in New Issue
Block a user