feat: implement local http server in desktop platforms for oauth2

This commit is contained in:
Udhay-Adithya
2025-08-03 12:59:34 +05:30
parent 98d7375071
commit 84ddbfa1ac
11 changed files with 826 additions and 53 deletions

View 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;
}