mirror of
https://github.com/foss42/apidash.git
synced 2025-12-03 11:27:50 +08:00
feat: implement local http server in desktop platforms for oauth2
This commit is contained in:
19
packages/better_networking/lib/utils/platform_utils.dart
Normal file
19
packages/better_networking/lib/utils/platform_utils.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
/// Platform detection utilities for the better_networking package.
|
||||
class PlatformUtils {
|
||||
/// Returns true if running on desktop platforms (macOS, Windows, Linux).
|
||||
static bool get isDesktop =>
|
||||
!kIsWeb && (Platform.isMacOS || Platform.isWindows || Platform.isLinux);
|
||||
|
||||
/// Returns true if running on mobile platforms (iOS, Android).
|
||||
static bool get isMobile => !kIsWeb && (Platform.isIOS || Platform.isAndroid);
|
||||
|
||||
/// Returns true if running on web.
|
||||
static bool get isWeb => kIsWeb;
|
||||
|
||||
/// Returns true if OAuth should use localhost callback server.
|
||||
/// This is true for desktop platforms.
|
||||
static bool get shouldUseLocalhostCallback => isDesktop;
|
||||
}
|
||||
Reference in New Issue
Block a user