2024-09-08 21:21:21 +08:00
|
|
|
import 'dart:io';
|
2024-04-30 23:38:49 +08:00
|
|
|
import 'dart:ui';
|
|
|
|
|
|
2024-09-26 14:29:04 +08:00
|
|
|
import 'package:collection/collection.dart';
|
2024-07-15 22:06:09 +08:00
|
|
|
import 'package:fl_clash/enum/enum.dart';
|
2024-09-26 14:29:04 +08:00
|
|
|
import 'package:fl_clash/models/models.dart';
|
2024-04-30 23:38:49 +08:00
|
|
|
import 'package:flutter/material.dart';
|
2024-07-19 02:14:58 +08:00
|
|
|
import 'system.dart';
|
2024-04-30 23:38:49 +08:00
|
|
|
|
2024-05-11 17:02:34 +08:00
|
|
|
const appName = "FlClash";
|
2024-05-20 15:15:09 +08:00
|
|
|
const coreName = "clash.meta";
|
2024-07-26 08:05:22 +08:00
|
|
|
const packageName = "com.follow.clash";
|
2024-05-20 15:15:09 +08:00
|
|
|
const httpTimeoutDuration = Duration(milliseconds: 5000);
|
|
|
|
|
const moreDuration = Duration(milliseconds: 100);
|
2024-06-23 00:26:24 +08:00
|
|
|
const animateDuration = Duration(milliseconds: 100);
|
2024-05-20 15:15:09 +08:00
|
|
|
const defaultUpdateDuration = Duration(days: 1);
|
|
|
|
|
const mmdbFileName = "geoip.metadb";
|
2024-06-03 18:02:05 +08:00
|
|
|
const asnFileName = "ASN.mmdb";
|
2024-07-08 17:34:14 +08:00
|
|
|
const geoIpFileName = "GeoIP.dat";
|
|
|
|
|
const geoSiteFileName = "GeoSite.dat";
|
2024-09-08 21:21:21 +08:00
|
|
|
final double kHeaderHeight = system.isDesktop
|
|
|
|
|
? !Platform.isMacOS
|
|
|
|
|
? 40
|
|
|
|
|
: 26
|
|
|
|
|
: 0;
|
2024-07-08 17:34:14 +08:00
|
|
|
const GeoXMap defaultGeoXMap = {
|
2024-07-15 22:06:09 +08:00
|
|
|
"mmdb":
|
|
|
|
|
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb",
|
|
|
|
|
"asn":
|
2024-09-20 14:32:57 +08:00
|
|
|
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb",
|
2024-07-15 22:06:09 +08:00
|
|
|
"geoip":
|
2024-09-20 14:32:57 +08:00
|
|
|
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat",
|
2024-07-15 22:06:09 +08:00
|
|
|
"geosite":
|
|
|
|
|
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat"
|
2024-07-08 17:34:14 +08:00
|
|
|
};
|
2024-05-20 15:15:09 +08:00
|
|
|
const profilesDirectoryName = "profiles";
|
|
|
|
|
const localhost = "127.0.0.1";
|
|
|
|
|
const clashConfigKey = "clash_config";
|
|
|
|
|
const configKey = "config";
|
|
|
|
|
const listItemPadding = EdgeInsets.symmetric(horizontal: 16);
|
|
|
|
|
const double dialogCommonWidth = 300;
|
|
|
|
|
const repository = "chen08209/FlClash";
|
2024-06-11 20:50:57 +08:00
|
|
|
const defaultExternalController = "127.0.0.1:9090";
|
2024-05-20 15:15:09 +08:00
|
|
|
const maxMobileWidth = 600;
|
|
|
|
|
const maxLaptopWidth = 840;
|
2024-06-12 19:28:58 +08:00
|
|
|
const geodataLoaderMemconservative = "memconservative";
|
|
|
|
|
const geodataLoaderStandard = "standard";
|
2024-07-02 08:08:31 +08:00
|
|
|
const defaultTestUrl = "https://www.gstatic.com/generate_204";
|
2024-05-20 15:15:09 +08:00
|
|
|
final filter = ImageFilter.blur(
|
|
|
|
|
sigmaX: 5,
|
|
|
|
|
sigmaY: 5,
|
|
|
|
|
tileMode: TileMode.mirror,
|
|
|
|
|
);
|
2024-05-11 17:02:34 +08:00
|
|
|
|
2024-09-26 14:29:04 +08:00
|
|
|
const navigationItemListEquality = ListEquality<NavigationItem>();
|
|
|
|
|
const connectionListEquality = ListEquality<Connection>();
|
|
|
|
|
const stringListEquality = ListEquality<String>();
|
|
|
|
|
const logListEquality = ListEquality<Log>();
|
|
|
|
|
const groupListEquality = ListEquality<Group>();
|
|
|
|
|
const externalProviderListEquality = ListEquality<ExternalProvider>();
|
|
|
|
|
const packageListEquality = ListEquality<Package>();
|
|
|
|
|
const hotKeyActionListEquality = ListEquality<HotKeyAction>();
|
|
|
|
|
const stringAndStringMapEquality = MapEquality<String, String>();
|
|
|
|
|
const stringAndStringMapEntryIterableEquality =
|
|
|
|
|
IterableEquality<MapEntry<String, String>>();
|
|
|
|
|
const stringAndIntQMapEquality = MapEquality<String, int?>();
|
|
|
|
|
const stringSetEquality = SetEquality<String>();
|
|
|
|
|
const keyboardModifierListEquality = SetEquality<KeyboardModifier>();
|
|
|
|
|
|
2024-07-15 22:06:09 +08:00
|
|
|
const viewModeColumnsMap = {
|
|
|
|
|
ViewMode.mobile: [2, 1],
|
|
|
|
|
ViewMode.laptop: [3, 2],
|
|
|
|
|
ViewMode.desktop: [4, 3],
|
|
|
|
|
};
|
|
|
|
|
|
2024-05-20 15:15:09 +08:00
|
|
|
const defaultPrimaryColor = Colors.brown;
|