-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
142 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:open_media_server_app/globals.dart'; | ||
import 'package:open_media_server_app/globals/preference_globals.dart'; | ||
|
||
class AuthGlobals { | ||
static String get redirectUriWeb { | ||
if (kDebugMode) { | ||
return "http://localhost:8000/redirect.html"; | ||
} else { | ||
return "https://${Globals.BaseUrl}/redirect.html"; | ||
return "https://${PreferenceGlobals.BaseUrl}/redirect.html"; | ||
} | ||
} | ||
|
||
static String? appLoginCodeRoute; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
class Globals { | ||
static String BaseUrl = "http://localhost:8080"; | ||
|
||
static String Title = "Open Media Station"; | ||
static String PictureNotFoundUrl = | ||
"https://static.vecteezy.com/system/resources/previews/005/337/799/original/icon-image-not-found-free-vector.jpg"; | ||
|
||
static bool isTv = false; | ||
static bool isAndroidTv = false; | ||
static bool isMobile = false; | ||
static bool isWeb = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'package:device_info_plus/device_info_plus.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
|
||
class PlatformGlobals { | ||
static bool isTv = false; | ||
static bool isAndroidTv = false; | ||
static bool isMobile = false; | ||
static bool isWeb = false; | ||
|
||
static Future setGlobals() async { | ||
PlatformGlobals.isMobile = defaultTargetPlatform == TargetPlatform.iOS || | ||
defaultTargetPlatform == TargetPlatform.android; | ||
|
||
if (defaultTargetPlatform == TargetPlatform.android) { | ||
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); | ||
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo; | ||
PlatformGlobals.isTv = | ||
androidInfo.systemFeatures.contains('android.software.leanback'); | ||
} | ||
|
||
if (PlatformGlobals.isTv) { | ||
PlatformGlobals.isMobile = false; | ||
} | ||
|
||
if (PlatformGlobals.isTv && | ||
defaultTargetPlatform == TargetPlatform.android) { | ||
PlatformGlobals.isAndroidTv = true; | ||
} | ||
|
||
if (kIsWeb) { | ||
PlatformGlobals.isWeb = true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import 'package:open_media_server_app/helpers/preferences.dart'; | ||
|
||
class PreferenceGlobals { | ||
static String BaseUrl = Preferences.prefs!.getString("BaseUrl")!; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.