Line data Source code
1 : part of apptive_grid_network; 2 : 3 : /// Possible Stages/Environment ApptiveGrid can point to 4 29 : enum ApptiveGridEnvironment { 5 : /// Alpha Environment 6 : alpha, 7 : 8 : /// Beta Environment 9 : beta, 10 : 11 : /// Production Environment 12 : production 13 : } 14 : 15 : /// Extensions for [ApptiveGridEnvironment] 16 : extension EnvironmentExtension on ApptiveGridEnvironment { 17 : /// Returns the API url for the selected [ApptiveGridEnvironment] 18 2 : String get url { 19 : switch (this) { 20 2 : case ApptiveGridEnvironment.alpha: 21 : return 'https://alpha.apptivegrid.de'; 22 2 : case ApptiveGridEnvironment.beta: 23 : return 'https://beta.apptivegrid.de'; 24 2 : case ApptiveGridEnvironment.production: 25 : return 'https://app.apptivegrid.de'; 26 : } 27 : } 28 : 29 : /// Returns the realm that needs to be used for Authentication 30 2 : String get authRealm { 31 : switch (this) { 32 2 : case ApptiveGridEnvironment.alpha: 33 2 : case ApptiveGridEnvironment.beta: 34 : return 'apptivegrid-test'; 35 2 : case ApptiveGridEnvironment.production: 36 : return 'apptivegrid'; 37 : } 38 : } 39 : }