move reportUrl and reportProjectId from config to setting
This commit is contained in:
@@ -2,35 +2,25 @@ import 'package:flutter/material.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
enum Flavor { UNSET, DEV, STAGING, PRODUCTION, LOCAL }
|
||||
|
||||
const FlavorNames = ["Unset", "Development", "Staging", "Production", "Local"];
|
||||
|
||||
class Config {
|
||||
static Config _instance = Config(
|
||||
flavor: Flavor.UNSET,
|
||||
apiURL: "",
|
||||
bucketName: "",
|
||||
reportProjectID: "",
|
||||
reportURL: "");
|
||||
static Config _instance = Config(flavor: Flavor.UNSET, apiURL: "");
|
||||
|
||||
final Flavor flavor;
|
||||
final String name;
|
||||
final Color color;
|
||||
final String apiURL;
|
||||
final String reportURL;
|
||||
final Level level;
|
||||
final String reportProjectID;
|
||||
final String bucketName;
|
||||
|
||||
factory Config(
|
||||
{required Flavor flavor,
|
||||
required String apiURL,
|
||||
required String reportURL,
|
||||
required String reportProjectID,
|
||||
required String bucketName,
|
||||
Color color= Colors.blue,
|
||||
Level level= Level.SEVERE}) {
|
||||
_instance = Config._internal(flavor, FlavorNames[flavor.index], color,
|
||||
apiURL, reportURL, level, reportProjectID, bucketName);
|
||||
Color color = Colors.blue,
|
||||
Level level = Level.SEVERE}) {
|
||||
_instance = Config._internal(
|
||||
flavor, FlavorNames[flavor.index], color, apiURL, level);
|
||||
|
||||
Logger.root.level = level;
|
||||
Logger.root.onRecord.listen((record) {
|
||||
@@ -41,8 +31,7 @@ class Config {
|
||||
return _instance;
|
||||
}
|
||||
|
||||
Config._internal(this.flavor, this.name, this.color, this.apiURL,
|
||||
this.reportURL, this.level, this.reportProjectID, this.bucketName);
|
||||
Config._internal(this.flavor, this.name, this.color, this.apiURL, this.level);
|
||||
|
||||
static Config get instance {
|
||||
return _instance;
|
||||
|
||||
Reference in New Issue
Block a user