initial commit
This commit is contained in:
1 parent
d106356ca6
commit
a863656758
50 files changed
+523
-529
No files matched your search
@@ -10,15 +10,11 @@ import 'package:flutter/material.dart';
|
||||
abstract final class AppColors {
|
||||
AppColors._();
|
||||
|
||||
// ── Primary: Cyan ──────────────────────────────────────────────────────────
|
||||
static const Color cyan = Color(0xFF00E5FF);
|
||||
static const Color cyan15 = Color(0x2600E5FF); // 15 % opacity
|
||||
static const Color cyan25 = Color(0x4000E5FF); // 25 % opacity
|
||||
static const Color cyan50 = Color(0x8000E5FF); // 50 % opacity
|
||||
static const Color cyan60 = Color(0x9900E5FF); // 60 % opacity
|
||||
static const Color cyan70 = Color(0xB300E5FF); // 70 % opacity
|
||||
static const Color cyan05 = Color(0x0D00E5FF); // 5 % opacity
|
||||
static const Color cyanGlow = Color(0x8800E5FF); // glowing border
|
||||
// ── Accent ────────────────────────────────────────────────────────────────
|
||||
static const Color accent = Color(0xFFFFD600); // yellow
|
||||
static const Color accent50 = Color(0x80FFD600); // 50 % opacity
|
||||
static const Color accent60 = Color(0x99FFD600); // 60 % opacity
|
||||
static const Color accent70 = Color(0xB3FFD600); // 70 % opacity
|
||||
|
||||
// ── Backgrounds ────────────────────────────────────────────────────────────
|
||||
static const Color bgDeep = Color(0xFF0D1117); // intro / scaffold
|
||||
@@ -32,13 +28,11 @@ abstract final class AppColors {
|
||||
static const Color slate15 = Color(0x264A5568); // 15 % opacity
|
||||
static const Color slate50 = Color(0x804A5568); // 50 % opacity
|
||||
static const Color slate70 = Color(0xB34A5568); // 70 % opacity
|
||||
static const Color slateAA = Color(0xAA4A5568); // ~67 % (legacy usage)
|
||||
|
||||
// ── Text ───────────────────────────────────────────────────────────────────
|
||||
static const Color textWhite = Colors.white;
|
||||
static const Color textDim = Colors.white54;
|
||||
static const Color textWhite80 = Color(0xCCFFFFFF); // 80 % white
|
||||
static const Color textMuted = Color(0xFFA0AEC0); // dialog body text
|
||||
static const Color textMuted = Color(0xFFA0AEC0); // dialog body text
|
||||
|
||||
// ── Semantic ───────────────────────────────────────────────────────────────
|
||||
static const Color green = Color(0xFF00E676);
|
||||
@@ -49,26 +43,4 @@ abstract final class AppColors {
|
||||
static const Color glassBg = Color(0x22FFFFFF); // subtle glass background
|
||||
static const Color glassBorder = Color(0x33FFFFFF); // muted translucent border
|
||||
|
||||
// ── Intro screen snackbars ─────────────────────────────────────────────────
|
||||
static const Color snackSuccess = Color(0xFF006064);
|
||||
static const Color snackError = Color(0xFF5D4037);
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
// FUTURE — Yellow palette (not yet wired into the UI)
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
static const Color yellow = Color(0xFFFFD600);
|
||||
static const Color yellowDark = Color(0xFFFFAB00);
|
||||
static const Color yellowLight = Color(0xFFFFFF00);
|
||||
static const Color yellowFaded = Color(0x1AFFD600);
|
||||
static const Color yellowAmber = Color(0xFFFFC107);
|
||||
static const Color yellowMustard = Color(0xFFC6A700);
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
// FUTURE — Black palette (not yet wired into the UI)
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
static const Color black = Color(0xFF000000);
|
||||
static const Color blackOff = Color(0xFF0A0A0A);
|
||||
static const Color blackFaded = Color(0xAA000000);
|
||||
static const Color blackWarm = Color(0xFF121212);
|
||||
static const Color blackCharcoal = Color(0xFF1A1A1A);
|
||||
}
|
||||
@@ -17,6 +17,7 @@ enum VpnStatus {
|
||||
}
|
||||
|
||||
class VpnConnection extends ChangeNotifier {
|
||||
bool _cancelled = false;
|
||||
VpnStatus _status = VpnStatus.disconnected;
|
||||
VpnStatus get status => _status;
|
||||
|
||||
@@ -103,6 +104,7 @@ class VpnConnection extends ChangeNotifier {
|
||||
if (_status == VpnStatus.connected || _status == VpnStatus.connecting) {
|
||||
return false;
|
||||
}
|
||||
_cancelled = false;
|
||||
|
||||
if (!kIsWeb && !_initialized) {
|
||||
_errorMessage = 'VPN service unavailable.';
|
||||
@@ -147,7 +149,13 @@ class VpnConnection extends ChangeNotifier {
|
||||
return false;
|
||||
}
|
||||
|
||||
// ── Step 2: Parse and start VLESS tunnel ───────────────────────────
|
||||
// ── Step 2: Check for cancellation ────────────────────────────────
|
||||
if (_cancelled) {
|
||||
_setStatus(VpnStatus.disconnected, 'Tap to connect');
|
||||
return false;
|
||||
}
|
||||
|
||||
// ── Step 3: Parse and start VLESS tunnel ───────────────────────────
|
||||
try {
|
||||
final parsed = FlutterVless.parse(vlessUrl);
|
||||
final config = parsed.getFullConfiguration();
|
||||
@@ -193,6 +201,7 @@ class VpnConnection extends ChangeNotifier {
|
||||
|
||||
// ── Disconnect ────────────────────────────────────────────────────────────
|
||||
Future<void> disconnect() async {
|
||||
_cancelled = true;
|
||||
if (_status == VpnStatus.disconnected || _status == VpnStatus.disconnecting) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user