diff --git a/.fvmrc b/.fvmrc
index bf47b4e322..19e8577e95 100644
--- a/.fvmrc
+++ b/.fvmrc
@@ -1,3 +1,3 @@
{
- "flutter": "3.41.4"
+ "flutter": "3.41.6"
}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index d59d18da45..9b9fcd935c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -150,4 +150,7 @@ dist
test*.dart
-ohos/build-profile.json5
\ No newline at end of file
+ohos/build-profile.json5
+
+.agents
+skills-lock.json
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
index 5e8c02344a..8128334d62 100644
--- a/android/app/build.gradle.kts
+++ b/android/app/build.gradle.kts
@@ -18,8 +18,10 @@ android {
targetCompatibility = JavaVersion.VERSION_17
}
- kotlinOptions {
- jvmTarget = JavaVersion.VERSION_17.toString()
+ kotlin {
+ compilerOptions {
+ jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
+ }
}
defaultConfig {
@@ -62,10 +64,10 @@ android {
value = "PiliPlus dev",
)
}
- proguardFiles(
- getDefaultProguardFile("proguard-android-optimize.txt"),
- "proguard-rules.pro"
- )
+// proguardFiles(
+// getDefaultProguardFile("proguard-android-optimize.txt"),
+// "proguard-rules.pro"
+// )
}
debug {
applicationIdSuffix = ".debug"
diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist
index 1dc6cf7652..391a902b2b 100644
--- a/ios/Flutter/AppFrameworkInfo.plist
+++ b/ios/Flutter/AppFrameworkInfo.plist
@@ -20,7 +20,5 @@
????
CFBundleVersion
1.0
- MinimumOSVersion
- 13.0
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index 4de46aa111..fdadabedd7 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -8,6 +8,8 @@ PODS:
- Flutter
- auto_orientation (0.0.1):
- Flutter
+ - battery_plus (1.0.0):
+ - Flutter
- chat_bottom_container (0.0.1):
- Flutter
- connectivity_plus (0.0.1):
@@ -68,9 +70,9 @@ PODS:
- Flutter
- GT3Captcha-iOS
- GT3Captcha-iOS (0.15.8.3)
- - image_cropper (0.0.4):
+ - image_cropper (0.0.5):
- Flutter
- - TOCropViewController (~> 2.8.0)
+ - TOCropViewController (~> 3.1.1)
- image_picker_ios (0.0.1):
- Flutter
- live_photo_maker (0.0.3):
@@ -84,9 +86,6 @@ PODS:
- OrderedSet (6.0.3)
- package_info_plus (0.4.5):
- Flutter
- - path_provider_foundation (0.0.1):
- - Flutter
- - FlutterMacOS
- permission_handler_apple (9.3.0):
- Flutter
- saver_gallery (0.0.1):
@@ -105,7 +104,7 @@ PODS:
- Flutter
- FlutterMacOS
- SwiftyGif (5.4.5)
- - TOCropViewController (2.8.0)
+ - TOCropViewController (3.1.1)
- url_launcher_ios (0.0.1):
- Flutter
- wakelock_plus (0.0.1):
@@ -116,6 +115,7 @@ DEPENDENCIES:
- audio_service (from `.symlinks/plugins/audio_service/darwin`)
- audio_session (from `.symlinks/plugins/audio_session/ios`)
- auto_orientation (from `.symlinks/plugins/auto_orientation/ios`)
+ - battery_plus (from `.symlinks/plugins/battery_plus/ios`)
- chat_bottom_container (from `.symlinks/plugins/chat_bottom_container/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
@@ -134,7 +134,6 @@ DEPENDENCIES:
- media_kit_native_event_loop (from `.symlinks/plugins/media_kit_native_event_loop/ios`)
- media_kit_video (from `.symlinks/plugins/media_kit_video/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- saver_gallery (from `.symlinks/plugins/saver_gallery/ios`)
- screen_brightness_ios (from `.symlinks/plugins/screen_brightness_ios/ios`)
@@ -163,6 +162,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/audio_session/ios"
auto_orientation:
:path: ".symlinks/plugins/auto_orientation/ios"
+ battery_plus:
+ :path: ".symlinks/plugins/battery_plus/ios"
chat_bottom_container:
:path: ".symlinks/plugins/chat_bottom_container/ios"
connectivity_plus:
@@ -199,8 +200,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/media_kit_video/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
- path_provider_foundation:
- :path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
saver_gallery:
@@ -219,44 +218,44 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/wakelock_plus/ios"
SPEC CHECKSUMS:
- app_links: 6d01271b3907b0ee7325c5297c75d697c4226c4d
- audio_service: cab6c1a0eaf01b5a35b567e11fa67d3cc1956910
- audio_session: 19e9480dbdd4e5f6c4543826b2e8b0e4ab6145fe
- auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
- chat_bottom_container: d8b077152c91b0ab90001e900748ea50353a5520
- connectivity_plus: 2a701ffec2c0ae28a48cf7540e279787e77c447d
- device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
+ app_links: a754cbec3c255bd4bbb4d236ecc06f28cd9a7ce8
+ audio_service: aa99a6ba2ae7565996015322b0bb024e1d25c6fd
+ audio_session: 9bb7f6c970f21241b19f5a3658097ae459681ba0
+ auto_orientation: a1600c9ed72e6e96982fb4e1214463343342432a
+ battery_plus: b42253f6d2dde71712f8c36fef456d99121c5977
+ chat_bottom_container: f1eb8323db77a87db50f361142c679f11e892d1b
+ connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd
+ device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
- file_picker: b159e0c068aef54932bb15dc9fd1571818edaf49
+ file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
- flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4
- flutter_mailer: 2ef5a67087bc8c6c4cefd04a178bf1ae2c94cd83
- flutter_native_splash: df59bb2e1421aa0282cb2e95618af4dcb0c56c29
- flutter_volume_controller: e4d5832f08008180f76e30faf671ffd5a425e529
- fluttertoast: 21eecd6935e7064cc1fcb733a4c5a428f3f24f0f
- gt3_flutter_plugin: 5bd2c08d3c19cbb6ee3b08f4358439e54c8ab2ee
+ flutter_inappwebview_ios: b89ba3482b96fb25e00c967aae065701b66e9b99
+ flutter_mailer: 3a8cd4f36c960fb04528d5471097270c19fec1c4
+ flutter_native_splash: c32d145d68aeda5502d5f543ee38c192065986cf
+ flutter_volume_controller: c2be490cb0487e8b88d0d9fc2b7e1c139a4ebccb
+ fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1
+ gt3_flutter_plugin: 37090e5fa66ff2a52939eb9d208fc36fa49d36e5
GT3Captcha-iOS: 5e3b1077834d8a9d6f4d64a447a30af3e14affe6
- image_cropper: b8ef14d3fcff4040b0f9da2ca28d98219a5cba0e
- image_picker_ios: 4f2f91b01abdb52842a8e277617df877e40f905b
- live_photo_maker: 7d57bfc70a120b4673c10871f354f4b1b6fde5fd
- media_kit_libs_ios_video: a5fe24bc7875ccd6378a0978c13185e1344651c1
- media_kit_native_event_loop: e6b2ab20cf0746eb1c33be961fcf79667304fa2a
- media_kit_video: 5da63f157170e5bf303bf85453b7ef6971218a2e
+ image_cropper: e405d3e44183f8e8edbec2e49b01ff9c819c7ac8
+ image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326
+ live_photo_maker: 29280ca88323bd5a33aafd00d98624d5cf522176
+ media_kit_libs_ios_video: 5a18affdb97d1f5d466dc79988b13eff6c5e2854
+ media_kit_native_event_loop: 5fba1a849a6c87a34985f1e178a0de5bd444a0cf
+ media_kit_video: 1746e198cb697d1ffb734b1d05ec429d1fcd1474
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
- package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
- path_provider_foundation: 0b743cbb62d8e47eab856f09262bb8c1ddcfe6ba
- permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
- saver_gallery: 76172dc4bf6b40e66d694948ada9ff402304dd87
- screen_brightness_ios: 6a6f7794b67f07c4f1e24f6374b2d8ad367ffb39
+ package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
+ permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
+ saver_gallery: af2d0c762dafda254e0ad025ef0dabd6506cd490
+ screen_brightness_ios: 9953fd7da5bd480f1a93990daeec2eb42d4f3b52
SDWebImage: 16309af6d214ba3f77a7c6f6fdda888cb313a50a
- share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
- shared_preferences_foundation: 5086985c1d43c5ba4d5e69a4e8083a389e2909e6
- sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
+ share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
+ shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
+ sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
- TOCropViewController: 797deaf39c90e6e9ddd848d88817f6b9a8a09888
- url_launcher_ios: bb13df5870e8c4234ca12609d04010a21be43dfa
- wakelock_plus: 76957ab028e12bfa4e66813c99e46637f367fc7e
+ TOCropViewController: 9002a9b12d8104d7478cdc306d80f0efea7fe2c5
+ url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
+ wakelock_plus: e29112ab3ef0b318e58cfa5c32326458be66b556
PODFILE CHECKSUM: f62db4fb414ebdecb264109948f76dfef35fdc3d
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 8b0ece2667..63c1578bed 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -131,5 +131,13 @@
UIStatusBarHidden
+ NSLocalNetworkUsageDescription
+ 需要访问本地网络以发现和连接 DLNA 投屏设备
+ NSBonjourServices
+
+ _ssdp._udp
+ _upnp._tcp
+ _http._tcp
+
diff --git a/lib/common/assets.dart b/lib/common/assets.dart
new file mode 100644
index 0000000000..97996d3640
--- /dev/null
+++ b/lib/common/assets.dart
@@ -0,0 +1,56 @@
+abstract final class Assets {
+ static const digitalNum = 'digital_id_num';
+
+ static const logo = 'assets/images/logo/logo.png';
+ static const logo2 = 'assets/images/logo/logo_2.png';
+ static const logoIco = 'assets/images/logo/ico/app_icon.ico';
+ static const logoLarge = 'assets/images/logo/desktop/logo_large.png';
+
+ static const vipIcon = 'assets/images/big-vip.png';
+ static const avatarPlaceHolder = 'assets/images/noface.jpeg';
+ static const loading = 'assets/images/loading.png';
+ static const buffering = 'assets/images/loading.webp';
+ static const play = 'assets/images/play.png';
+ static const topicHeader = 'assets/images/topic-header-bg.png';
+ static const trendingBanner = 'assets/images/trending_banner.png';
+ static const ai = 'assets/images/ai.png';
+
+ static const livingChart = 'assets/images/live.gif';
+ static const livingStatic = 'assets/images/live.png';
+ static const livingRect = 'assets/images/live/live.gif';
+ static const livingBackground = 'assets/images/live/default_bg.webp';
+
+ static const thunder1 = 'assets/images/paycoins/ic_thunder_1.png';
+ static const thunder2 = 'assets/images/paycoins/ic_thunder_2.png';
+ static const thunder3 = 'assets/images/paycoins/ic_thunder_3.png';
+ static const notEnough = 'assets/images/paycoins/ic_22_not_enough_pay.png';
+ static const mario = 'assets/images/paycoins/ic_22_mario.png';
+ static const gunSister = 'assets/images/paycoins/ic_22_gun_sister.png';
+ static const payBox = 'assets/images/paycoins/ic_pay_coins_box.png';
+ static const coinsOne = 'assets/images/paycoins/ic_coins_one.png';
+ static const coinsTwo = 'assets/images/paycoins/ic_coins_two.png';
+ static const left = 'assets/images/paycoins/ic_left.png';
+ static const leftDisable = 'assets/images/paycoins/ic_left_disable.png';
+ static const right = 'assets/images/paycoins/ic_right.png';
+ static const rightDisable = 'assets/images/paycoins/ic_right_disable.png';
+ static const panelClose = 'assets/images/paycoins/ic_panel_close.png';
+
+ static const List mpvAnime4KShaders = [
+ 'Anime4K_Clamp_Highlights.glsl',
+ 'Anime4K_Restore_CNN_VL.glsl',
+ 'Anime4K_Upscale_CNN_x2_VL.glsl',
+ 'Anime4K_AutoDownscalePre_x2.glsl',
+ 'Anime4K_AutoDownscalePre_x4.glsl',
+ 'Anime4K_Upscale_CNN_x2_M.glsl',
+ ];
+
+ static const mpvAnime4KShadersLite = [
+ 'Anime4K_Clamp_Highlights.glsl',
+ 'Anime4K_Restore_CNN_M.glsl',
+ 'Anime4K_Restore_CNN_S.glsl',
+ 'Anime4K_Upscale_CNN_x2_M.glsl',
+ 'Anime4K_AutoDownscalePre_x2.glsl',
+ 'Anime4K_AutoDownscalePre_x4.glsl',
+ 'Anime4K_Upscale_CNN_x2_S.glsl',
+ ];
+}
diff --git a/lib/common/constants.dart b/lib/common/constants.dart
index cc00d4ee7d..2524471608 100644
--- a/lib/common/constants.dart
+++ b/lib/common/constants.dart
@@ -1,30 +1,3 @@
-import 'package:flutter/material.dart';
-
-abstract final class StyleString {
- static const double cardSpace = 8;
- static const double safeSpace = 12;
- static const BorderRadius mdRadius = BorderRadius.all(imgRadius);
- static const Radius imgRadius = Radius.circular(10);
- static const double aspectRatio = 16 / 10;
- static const double aspectRatio16x9 = 16 / 9;
- static const double imgMaxRatio = 2.6;
- static const bottomSheetRadius = BorderRadius.vertical(
- top: Radius.circular(18),
- );
- static const dialogFixedConstraints = BoxConstraints(
- minWidth: 420,
- maxWidth: 420,
- );
- static const topBarHeight = 52.0;
- static const buttonStyle = ButtonStyle(
- visualDensity: VisualDensity(
- horizontal: -2,
- vertical: -1.25,
- ),
- tapTargetSize: .shrinkWrap,
- );
-}
-
abstract final class Constants {
static const appName = 'PiliPlus';
static const sourceCodeUrl = 'https://github.com/dev4harmony/PiliPlus';
@@ -68,244 +41,4 @@ abstract final class Constants {
// 'itemOpusStyle,opusBigCover,onlyfansVote,endFooterHidden,decorationCard,onlyfansAssetsV2,ugcDelete,onlyfansQaCard,editable,opusPrivateVisible,avatarAutoTheme,sunflowerStyle,cardsEnhance,eva3CardOpus,eva3CardVideo,eva3CardComment,eva3CardVote,eva3CardUser'
static const dynFeatures = 'itemOpusStyle,listOnlyfans,onlyfansQaCard';
-
- // 超分辨率滤镜
- static const List mpvAnime4KShaders = [
- 'Anime4K_Clamp_Highlights.glsl',
- 'Anime4K_Restore_CNN_VL.glsl',
- 'Anime4K_Upscale_CNN_x2_VL.glsl',
- 'Anime4K_AutoDownscalePre_x2.glsl',
- 'Anime4K_AutoDownscalePre_x4.glsl',
- 'Anime4K_Upscale_CNN_x2_M.glsl',
- ];
-
- // 超分辨率滤镜 (轻量)
- static const mpvAnime4KShadersLite = [
- 'Anime4K_Clamp_Highlights.glsl',
- 'Anime4K_Restore_CNN_M.glsl',
- 'Anime4K_Restore_CNN_S.glsl',
- 'Anime4K_Upscale_CNN_x2_M.glsl',
- 'Anime4K_AutoDownscalePre_x2.glsl',
- 'Anime4K_AutoDownscalePre_x4.glsl',
- 'Anime4K_Upscale_CNN_x2_S.glsl',
- ];
-
- //内容来自 https://passport.bilibili.com/web/generic/country/list
- static const internationalDialingPrefix = [
- (id: 1, cname: "中国大陆", countryId: 86),
- (id: 5, cname: "中国香港特别行政区", countryId: 852),
- (id: 2, cname: "中国澳门特别行政区", countryId: 853),
- (id: 3, cname: "中国台湾", countryId: 886),
- (id: 4, cname: "美国", countryId: 1),
- (id: 6, cname: "比利时", countryId: 32),
- (id: 7, cname: "澳大利亚", countryId: 61),
- (id: 8, cname: "法国", countryId: 33),
- (id: 9, cname: "加拿大", countryId: 1),
- (id: 10, cname: "日本", countryId: 81),
- (id: 11, cname: "新加坡", countryId: 65),
- (id: 12, cname: "韩国", countryId: 82),
- (id: 13, cname: "马来西亚", countryId: 60),
- (id: 14, cname: "英国", countryId: 44),
- (id: 15, cname: "意大利", countryId: 39),
- (id: 16, cname: "德国", countryId: 49),
- (id: 18, cname: "俄罗斯", countryId: 7),
- (id: 19, cname: "新西兰", countryId: 64),
- (id: 153, cname: "瓦利斯群岛和富图纳群岛", countryId: 1681),
- (id: 152, cname: "葡萄牙", countryId: 351),
- (id: 151, cname: "帕劳", countryId: 680),
- (id: 150, cname: "诺福克岛", countryId: 672),
- (id: 149, cname: "挪威", countryId: 47),
- (id: 148, cname: "纽埃岛", countryId: 683),
- (id: 147, cname: "尼日利亚", countryId: 234),
- (id: 146, cname: "尼日尔", countryId: 227),
- (id: 145, cname: "尼加拉瓜", countryId: 505),
- (id: 144, cname: "尼泊尔", countryId: 977),
- (id: 143, cname: "瑙鲁", countryId: 674),
- (id: 154, cname: "格鲁吉亚", countryId: 995),
- (id: 155, cname: "瑞典", countryId: 46),
- (id: 165, cname: "沙特阿拉伯", countryId: 966),
- (id: 164, cname: "桑给巴尔岛", countryId: 259),
- (id: 163, cname: "塞舌尔共和国", countryId: 248),
- (id: 162, cname: "塞浦路斯", countryId: 357),
- (id: 161, cname: "塞内加尔", countryId: 221),
- (id: 160, cname: "塞拉利昂", countryId: 232),
- (id: 159, cname: "萨摩亚,东部", countryId: 684),
- (id: 158, cname: "萨摩亚,西部", countryId: 685),
- (id: 157, cname: "萨尔瓦多", countryId: 503),
- (id: 156, cname: "瑞士", countryId: 41),
- (id: 166, cname: "圣多美和普林西比", countryId: 239),
- (id: 142, cname: "塞尔维亚", countryId: 381),
- (id: 141, cname: "南非", countryId: 27),
- (id: 128, cname: "毛里塔尼亚", countryId: 222),
- (id: 127, cname: "毛里求斯", countryId: 230),
- (id: 126, cname: "马歇尔岛", countryId: 692),
- (id: 125, cname: "马提尼克岛", countryId: 596),
- (id: 124, cname: "马其顿", countryId: 389),
- (id: 123, cname: "马里亚纳岛", countryId: 1670),
- (id: 122, cname: "马里", countryId: 223),
- (id: 121, cname: "马拉维", countryId: 265),
- (id: 120, cname: "马耳他", countryId: 356),
- (id: 119, cname: "马尔代夫", countryId: 960),
- (id: 129, cname: "蒙古", countryId: 976),
- (id: 130, cname: "蒙特塞拉特岛", countryId: 1664),
- (id: 140, cname: "纳米比亚", countryId: 264),
- (id: 139, cname: "墨西哥", countryId: 52),
- (id: 138, cname: "莫桑比克", countryId: 258),
- (id: 137, cname: "摩纳哥", countryId: 377),
- (id: 136, cname: "摩洛哥", countryId: 212),
- (id: 135, cname: "摩尔多瓦", countryId: 373),
- (id: 134, cname: "缅甸", countryId: 95),
- (id: 133, cname: "密克罗尼西亚", countryId: 691),
- (id: 132, cname: "秘鲁", countryId: 51),
- (id: 131, cname: "孟加拉国", countryId: 880),
- (id: 118, cname: "马达加斯加", countryId: 261),
- (id: 167, cname: "圣卢西亚", countryId: 1784),
- (id: 216, cname: "智利", countryId: 56),
- (id: 203, cname: "牙买加", countryId: 1876),
- (id: 202, cname: "叙利亚", countryId: 963),
- (id: 201, cname: "匈牙利", countryId: 36),
- (id: 200, cname: "科特迪瓦", countryId: 225),
- (id: 199, cname: "希腊", countryId: 30),
- (id: 198, cname: "西班牙", countryId: 34),
- (id: 197, cname: "乌兹别克斯坦", countryId: 998),
- (id: 196, cname: "乌拉圭", countryId: 598),
- (id: 195, cname: "乌克兰", countryId: 380),
- (id: 194, cname: "乌干达", countryId: 256),
- (id: 204, cname: "亚美尼亚", countryId: 374),
- (id: 205, cname: "也门", countryId: 967),
- (id: 215, cname: "直布罗陀", countryId: 350),
- (id: 214, cname: "乍得", countryId: 235),
- (id: 213, cname: "赞比亚", countryId: 260),
- (id: 212, cname: "越南", countryId: 84),
- (id: 211, cname: "约旦", countryId: 962),
- (id: 210, cname: "印尼", countryId: 62),
- (id: 209, cname: "印度", countryId: 91),
- (id: 208, cname: "以色列", countryId: 972),
- (id: 207, cname: "伊朗", countryId: 98),
- (id: 206, cname: "伊拉克", countryId: 964),
- (id: 193, cname: "文莱", countryId: 673),
- (id: 192, cname: "委内瑞拉", countryId: 58),
- (id: 191, cname: "维珍群岛(英属)", countryId: 1284),
- (id: 178, cname: "泰国", countryId: 66),
- (id: 177, cname: "索马里", countryId: 252),
- (id: 176, cname: "所罗门群岛", countryId: 677),
- (id: 175, cname: "苏里南", countryId: 597),
- (id: 174, cname: "苏丹", countryId: 249),
- (id: 173, cname: "斯威士兰", countryId: 268),
- (id: 172, cname: "斯洛文尼亚", countryId: 386),
- (id: 171, cname: "斯洛伐克", countryId: 421),
- (id: 170, cname: "斯里兰卡", countryId: 94),
- (id: 169, cname: "圣皮埃尔和密克隆群岛", countryId: 508),
- (id: 179, cname: "坦桑尼亚", countryId: 255),
- (id: 180, cname: "汤加", countryId: 676),
- (id: 190, cname: "维珍群岛(美属)", countryId: 1340),
- (id: 189, cname: "瓦努阿图", countryId: 678),
- (id: 188, cname: "托克劳岛", countryId: 690),
- (id: 187, cname: "土库曼斯坦", countryId: 993),
- (id: 186, cname: "土耳其", countryId: 90),
- (id: 185, cname: "图瓦卢", countryId: 688),
- (id: 184, cname: "突尼斯", countryId: 216),
- (id: 183, cname: "阿森松岛", countryId: 247),
- (id: 182, cname: "特立尼达和多巴哥", countryId: 1868),
- (id: 181, cname: "特克斯和凯科斯", countryId: 1649),
- (id: 168, cname: "圣马力诺", countryId: 378),
- (id: 67, cname: "法属圭亚那", countryId: 594),
- (id: 54, cname: "不丹", countryId: 975),
- (id: 53, cname: "博茨瓦纳", countryId: 267),
- (id: 52, cname: "伯利兹", countryId: 501),
- (id: 51, cname: "玻利维亚", countryId: 591),
- (id: 50, cname: "波兰", countryId: 48),
- (id: 49, cname: "波黑", countryId: 387),
- (id: 48, cname: "波多黎各", countryId: 1787),
- (id: 47, cname: "冰岛", countryId: 354),
- (id: 46, cname: "贝宁", countryId: 229),
- (id: 45, cname: "保加利亚", countryId: 359),
- (id: 55, cname: "布基纳法索", countryId: 226),
- (id: 56, cname: "布隆迪", countryId: 257),
- (id: 66, cname: "法属波利尼西亚", countryId: 689),
- (id: 65, cname: "法罗岛", countryId: 298),
- (id: 64, cname: "厄立特里亚", countryId: 291),
- (id: 63, cname: "厄瓜多尔", countryId: 593),
- (id: 62, cname: "多米尼加代表", countryId: 1809),
- (id: 61, cname: "多米尼加", countryId: 1767),
- (id: 60, cname: "多哥", countryId: 228),
- (id: 59, cname: "迪戈加西亚岛", countryId: 246),
- (id: 58, cname: "丹麦", countryId: 45),
- (id: 57, cname: "赤道几内亚", countryId: 240),
- (id: 44, cname: "百慕大群岛", countryId: 1441),
- (id: 43, cname: "白俄罗斯", countryId: 375),
- (id: 42, cname: "巴西", countryId: 55),
- (id: 29, cname: "爱尔兰", countryId: 353),
- (id: 28, cname: "埃塞俄比亚", countryId: 251),
- (id: 27, cname: "埃及", countryId: 20),
- (id: 26, cname: "阿塞拜疆", countryId: 994),
- (id: 25, cname: "阿曼", countryId: 968),
- (id: 24, cname: "阿联酋", countryId: 971),
- (id: 23, cname: "阿根廷", countryId: 54),
- (id: 22, cname: "阿富汗", countryId: 93),
- (id: 21, cname: "阿尔及利亚", countryId: 213),
- (id: 20, cname: "阿尔巴尼亚", countryId: 355),
- (id: 30, cname: "爱沙尼亚", countryId: 372),
- (id: 31, cname: "安道尔", countryId: 376),
- (id: 41, cname: "巴拿马", countryId: 507),
- (id: 40, cname: "巴林", countryId: 973),
- (id: 39, cname: "巴拉圭", countryId: 595),
- (id: 38, cname: "巴基斯坦", countryId: 92),
- (id: 37, cname: "巴哈马群岛", countryId: 1242),
- (id: 36, cname: "巴布亚新几内亚", countryId: 675),
- (id: 35, cname: "巴巴多斯", countryId: 1246),
- (id: 34, cname: "奥地利", countryId: 43),
- (id: 33, cname: "安提瓜岛和巴布达", countryId: 1268),
- (id: 32, cname: "安哥拉", countryId: 244),
- (id: 68, cname: "非洲中部", countryId: 236),
- (id: 117, cname: "罗马尼亚", countryId: 40),
- (id: 104, cname: "科威特", countryId: 965),
- (id: 103, cname: "科摩罗", countryId: 269),
- (id: 102, cname: "开曼群岛", countryId: 1345),
- (id: 101, cname: "卡塔尔", countryId: 974),
- (id: 100, cname: "喀麦隆", countryId: 237),
- (id: 99, cname: "聚会岛", countryId: 262),
- (id: 98, cname: "津巴布韦", countryId: 263),
- (id: 97, cname: "捷克", countryId: 420),
- (id: 96, cname: "柬埔寨", countryId: 855),
- (id: 95, cname: "加蓬", countryId: 241),
- (id: 105, cname: "克罗地亚", countryId: 385),
- (id: 106, cname: "肯尼亚", countryId: 254),
- (id: 116, cname: "卢旺达", countryId: 250),
- (id: 115, cname: "卢森堡", countryId: 352),
- (id: 114, cname: "利比亚", countryId: 218),
- (id: 113, cname: "利比里亚", countryId: 231),
- (id: 112, cname: "立陶宛", countryId: 370),
- (id: 111, cname: "黎巴嫩", countryId: 961),
- (id: 110, cname: "老挝", countryId: 856),
- (id: 109, cname: "莱索托", countryId: 266),
- (id: 108, cname: "拉脱维亚", countryId: 371),
- (id: 107, cname: "库克岛", countryId: 682),
- (id: 94, cname: "加纳", countryId: 233),
- (id: 93, cname: "几内亚比绍", countryId: 245),
- (id: 92, cname: "几内亚", countryId: 224),
- (id: 79, cname: "格林纳达", countryId: 1473),
- (id: 78, cname: "哥斯达黎加", countryId: 506),
- (id: 77, cname: "哥伦比亚", countryId: 57),
- (id: 76, cname: "刚果(金)", countryId: 243),
- (id: 75, cname: "刚果", countryId: 242),
- (id: 74, cname: "冈比亚", countryId: 220),
- (id: 73, cname: "福克兰岛", countryId: 500),
- (id: 72, cname: "佛得角", countryId: 238),
- (id: 71, cname: "芬兰", countryId: 358),
- (id: 70, cname: "斐济", countryId: 679),
- (id: 80, cname: "格陵兰岛", countryId: 299),
- (id: 81, cname: "古巴", countryId: 53),
- (id: 91, cname: "吉尔吉斯斯坦", countryId: 996),
- (id: 90, cname: "吉布提", countryId: 253),
- (id: 89, cname: "基里巴斯", countryId: 686),
- (id: 88, cname: "维克岛", countryId: 1808),
- (id: 87, cname: "洪都拉斯", countryId: 504),
- (id: 86, cname: "荷兰", countryId: 31),
- (id: 85, cname: "朝鲜", countryId: 850),
- (id: 84, cname: "海地", countryId: 509),
- (id: 83, cname: "关岛", countryId: 1671),
- (id: 82, cname: "瓜德罗普岛", countryId: 590),
- (id: 69, cname: "菲律宾", countryId: 63),
- ];
}
diff --git a/lib/common/dial_prefix.dart b/lib/common/dial_prefix.dart
new file mode 100644
index 0000000000..144fac9c1d
--- /dev/null
+++ b/lib/common/dial_prefix.dart
@@ -0,0 +1,220 @@
+abstract final class Login {
+ //内容来自 https://passport.bilibili.com/web/generic/country/list
+ static const dialPrefix = [
+ (id: 1, cname: "中国大陆", countryId: 86),
+ (id: 5, cname: "中国香港特别行政区", countryId: 852),
+ (id: 2, cname: "中国澳门特别行政区", countryId: 853),
+ (id: 3, cname: "中国台湾", countryId: 886),
+ (id: 4, cname: "美国", countryId: 1),
+ (id: 6, cname: "比利时", countryId: 32),
+ (id: 7, cname: "澳大利亚", countryId: 61),
+ (id: 8, cname: "法国", countryId: 33),
+ (id: 9, cname: "加拿大", countryId: 1),
+ (id: 10, cname: "日本", countryId: 81),
+ (id: 11, cname: "新加坡", countryId: 65),
+ (id: 12, cname: "韩国", countryId: 82),
+ (id: 13, cname: "马来西亚", countryId: 60),
+ (id: 14, cname: "英国", countryId: 44),
+ (id: 15, cname: "意大利", countryId: 39),
+ (id: 16, cname: "德国", countryId: 49),
+ (id: 18, cname: "俄罗斯", countryId: 7),
+ (id: 19, cname: "新西兰", countryId: 64),
+ (id: 153, cname: "瓦利斯群岛和富图纳群岛", countryId: 1681),
+ (id: 152, cname: "葡萄牙", countryId: 351),
+ (id: 151, cname: "帕劳", countryId: 680),
+ (id: 150, cname: "诺福克岛", countryId: 672),
+ (id: 149, cname: "挪威", countryId: 47),
+ (id: 148, cname: "纽埃岛", countryId: 683),
+ (id: 147, cname: "尼日利亚", countryId: 234),
+ (id: 146, cname: "尼日尔", countryId: 227),
+ (id: 145, cname: "尼加拉瓜", countryId: 505),
+ (id: 144, cname: "尼泊尔", countryId: 977),
+ (id: 143, cname: "瑙鲁", countryId: 674),
+ (id: 154, cname: "格鲁吉亚", countryId: 995),
+ (id: 155, cname: "瑞典", countryId: 46),
+ (id: 165, cname: "沙特阿拉伯", countryId: 966),
+ (id: 164, cname: "桑给巴尔岛", countryId: 259),
+ (id: 163, cname: "塞舌尔共和国", countryId: 248),
+ (id: 162, cname: "塞浦路斯", countryId: 357),
+ (id: 161, cname: "塞内加尔", countryId: 221),
+ (id: 160, cname: "塞拉利昂", countryId: 232),
+ (id: 159, cname: "萨摩亚,东部", countryId: 684),
+ (id: 158, cname: "萨摩亚,西部", countryId: 685),
+ (id: 157, cname: "萨尔瓦多", countryId: 503),
+ (id: 156, cname: "瑞士", countryId: 41),
+ (id: 166, cname: "圣多美和普林西比", countryId: 239),
+ (id: 142, cname: "塞尔维亚", countryId: 381),
+ (id: 141, cname: "南非", countryId: 27),
+ (id: 128, cname: "毛里塔尼亚", countryId: 222),
+ (id: 127, cname: "毛里求斯", countryId: 230),
+ (id: 126, cname: "马歇尔岛", countryId: 692),
+ (id: 125, cname: "马提尼克岛", countryId: 596),
+ (id: 124, cname: "马其顿", countryId: 389),
+ (id: 123, cname: "马里亚纳岛", countryId: 1670),
+ (id: 122, cname: "马里", countryId: 223),
+ (id: 121, cname: "马拉维", countryId: 265),
+ (id: 120, cname: "马耳他", countryId: 356),
+ (id: 119, cname: "马尔代夫", countryId: 960),
+ (id: 129, cname: "蒙古", countryId: 976),
+ (id: 130, cname: "蒙特塞拉特岛", countryId: 1664),
+ (id: 140, cname: "纳米比亚", countryId: 264),
+ (id: 139, cname: "墨西哥", countryId: 52),
+ (id: 138, cname: "莫桑比克", countryId: 258),
+ (id: 137, cname: "摩纳哥", countryId: 377),
+ (id: 136, cname: "摩洛哥", countryId: 212),
+ (id: 135, cname: "摩尔多瓦", countryId: 373),
+ (id: 134, cname: "缅甸", countryId: 95),
+ (id: 133, cname: "密克罗尼西亚", countryId: 691),
+ (id: 132, cname: "秘鲁", countryId: 51),
+ (id: 131, cname: "孟加拉国", countryId: 880),
+ (id: 118, cname: "马达加斯加", countryId: 261),
+ (id: 167, cname: "圣卢西亚", countryId: 1784),
+ (id: 216, cname: "智利", countryId: 56),
+ (id: 203, cname: "牙买加", countryId: 1876),
+ (id: 202, cname: "叙利亚", countryId: 963),
+ (id: 201, cname: "匈牙利", countryId: 36),
+ (id: 200, cname: "科特迪瓦", countryId: 225),
+ (id: 199, cname: "希腊", countryId: 30),
+ (id: 198, cname: "西班牙", countryId: 34),
+ (id: 197, cname: "乌兹别克斯坦", countryId: 998),
+ (id: 196, cname: "乌拉圭", countryId: 598),
+ (id: 195, cname: "乌克兰", countryId: 380),
+ (id: 194, cname: "乌干达", countryId: 256),
+ (id: 204, cname: "亚美尼亚", countryId: 374),
+ (id: 205, cname: "也门", countryId: 967),
+ (id: 215, cname: "直布罗陀", countryId: 350),
+ (id: 214, cname: "乍得", countryId: 235),
+ (id: 213, cname: "赞比亚", countryId: 260),
+ (id: 212, cname: "越南", countryId: 84),
+ (id: 211, cname: "约旦", countryId: 962),
+ (id: 210, cname: "印尼", countryId: 62),
+ (id: 209, cname: "印度", countryId: 91),
+ (id: 208, cname: "以色列", countryId: 972),
+ (id: 207, cname: "伊朗", countryId: 98),
+ (id: 206, cname: "伊拉克", countryId: 964),
+ (id: 193, cname: "文莱", countryId: 673),
+ (id: 192, cname: "委内瑞拉", countryId: 58),
+ (id: 191, cname: "维珍群岛(英属)", countryId: 1284),
+ (id: 178, cname: "泰国", countryId: 66),
+ (id: 177, cname: "索马里", countryId: 252),
+ (id: 176, cname: "所罗门群岛", countryId: 677),
+ (id: 175, cname: "苏里南", countryId: 597),
+ (id: 174, cname: "苏丹", countryId: 249),
+ (id: 173, cname: "斯威士兰", countryId: 268),
+ (id: 172, cname: "斯洛文尼亚", countryId: 386),
+ (id: 171, cname: "斯洛伐克", countryId: 421),
+ (id: 170, cname: "斯里兰卡", countryId: 94),
+ (id: 169, cname: "圣皮埃尔和密克隆群岛", countryId: 508),
+ (id: 179, cname: "坦桑尼亚", countryId: 255),
+ (id: 180, cname: "汤加", countryId: 676),
+ (id: 190, cname: "维珍群岛(美属)", countryId: 1340),
+ (id: 189, cname: "瓦努阿图", countryId: 678),
+ (id: 188, cname: "托克劳岛", countryId: 690),
+ (id: 187, cname: "土库曼斯坦", countryId: 993),
+ (id: 186, cname: "土耳其", countryId: 90),
+ (id: 185, cname: "图瓦卢", countryId: 688),
+ (id: 184, cname: "突尼斯", countryId: 216),
+ (id: 183, cname: "阿森松岛", countryId: 247),
+ (id: 182, cname: "特立尼达和多巴哥", countryId: 1868),
+ (id: 181, cname: "特克斯和凯科斯", countryId: 1649),
+ (id: 168, cname: "圣马力诺", countryId: 378),
+ (id: 67, cname: "法属圭亚那", countryId: 594),
+ (id: 54, cname: "不丹", countryId: 975),
+ (id: 53, cname: "博茨瓦纳", countryId: 267),
+ (id: 52, cname: "伯利兹", countryId: 501),
+ (id: 51, cname: "玻利维亚", countryId: 591),
+ (id: 50, cname: "波兰", countryId: 48),
+ (id: 49, cname: "波黑", countryId: 387),
+ (id: 48, cname: "波多黎各", countryId: 1787),
+ (id: 47, cname: "冰岛", countryId: 354),
+ (id: 46, cname: "贝宁", countryId: 229),
+ (id: 45, cname: "保加利亚", countryId: 359),
+ (id: 55, cname: "布基纳法索", countryId: 226),
+ (id: 56, cname: "布隆迪", countryId: 257),
+ (id: 66, cname: "法属波利尼西亚", countryId: 689),
+ (id: 65, cname: "法罗岛", countryId: 298),
+ (id: 64, cname: "厄立特里亚", countryId: 291),
+ (id: 63, cname: "厄瓜多尔", countryId: 593),
+ (id: 62, cname: "多米尼加代表", countryId: 1809),
+ (id: 61, cname: "多米尼加", countryId: 1767),
+ (id: 60, cname: "多哥", countryId: 228),
+ (id: 59, cname: "迪戈加西亚岛", countryId: 246),
+ (id: 58, cname: "丹麦", countryId: 45),
+ (id: 57, cname: "赤道几内亚", countryId: 240),
+ (id: 44, cname: "百慕大群岛", countryId: 1441),
+ (id: 43, cname: "白俄罗斯", countryId: 375),
+ (id: 42, cname: "巴西", countryId: 55),
+ (id: 29, cname: "爱尔兰", countryId: 353),
+ (id: 28, cname: "埃塞俄比亚", countryId: 251),
+ (id: 27, cname: "埃及", countryId: 20),
+ (id: 26, cname: "阿塞拜疆", countryId: 994),
+ (id: 25, cname: "阿曼", countryId: 968),
+ (id: 24, cname: "阿联酋", countryId: 971),
+ (id: 23, cname: "阿根廷", countryId: 54),
+ (id: 22, cname: "阿富汗", countryId: 93),
+ (id: 21, cname: "阿尔及利亚", countryId: 213),
+ (id: 20, cname: "阿尔巴尼亚", countryId: 355),
+ (id: 30, cname: "爱沙尼亚", countryId: 372),
+ (id: 31, cname: "安道尔", countryId: 376),
+ (id: 41, cname: "巴拿马", countryId: 507),
+ (id: 40, cname: "巴林", countryId: 973),
+ (id: 39, cname: "巴拉圭", countryId: 595),
+ (id: 38, cname: "巴基斯坦", countryId: 92),
+ (id: 37, cname: "巴哈马群岛", countryId: 1242),
+ (id: 36, cname: "巴布亚新几内亚", countryId: 675),
+ (id: 35, cname: "巴巴多斯", countryId: 1246),
+ (id: 34, cname: "奥地利", countryId: 43),
+ (id: 33, cname: "安提瓜岛和巴布达", countryId: 1268),
+ (id: 32, cname: "安哥拉", countryId: 244),
+ (id: 68, cname: "非洲中部", countryId: 236),
+ (id: 117, cname: "罗马尼亚", countryId: 40),
+ (id: 104, cname: "科威特", countryId: 965),
+ (id: 103, cname: "科摩罗", countryId: 269),
+ (id: 102, cname: "开曼群岛", countryId: 1345),
+ (id: 101, cname: "卡塔尔", countryId: 974),
+ (id: 100, cname: "喀麦隆", countryId: 237),
+ (id: 99, cname: "聚会岛", countryId: 262),
+ (id: 98, cname: "津巴布韦", countryId: 263),
+ (id: 97, cname: "捷克", countryId: 420),
+ (id: 96, cname: "柬埔寨", countryId: 855),
+ (id: 95, cname: "加蓬", countryId: 241),
+ (id: 105, cname: "克罗地亚", countryId: 385),
+ (id: 106, cname: "肯尼亚", countryId: 254),
+ (id: 116, cname: "卢旺达", countryId: 250),
+ (id: 115, cname: "卢森堡", countryId: 352),
+ (id: 114, cname: "利比亚", countryId: 218),
+ (id: 113, cname: "利比里亚", countryId: 231),
+ (id: 112, cname: "立陶宛", countryId: 370),
+ (id: 111, cname: "黎巴嫩", countryId: 961),
+ (id: 110, cname: "老挝", countryId: 856),
+ (id: 109, cname: "莱索托", countryId: 266),
+ (id: 108, cname: "拉脱维亚", countryId: 371),
+ (id: 107, cname: "库克岛", countryId: 682),
+ (id: 94, cname: "加纳", countryId: 233),
+ (id: 93, cname: "几内亚比绍", countryId: 245),
+ (id: 92, cname: "几内亚", countryId: 224),
+ (id: 79, cname: "格林纳达", countryId: 1473),
+ (id: 78, cname: "哥斯达黎加", countryId: 506),
+ (id: 77, cname: "哥伦比亚", countryId: 57),
+ (id: 76, cname: "刚果(金)", countryId: 243),
+ (id: 75, cname: "刚果", countryId: 242),
+ (id: 74, cname: "冈比亚", countryId: 220),
+ (id: 73, cname: "福克兰岛", countryId: 500),
+ (id: 72, cname: "佛得角", countryId: 238),
+ (id: 71, cname: "芬兰", countryId: 358),
+ (id: 70, cname: "斐济", countryId: 679),
+ (id: 80, cname: "格陵兰岛", countryId: 299),
+ (id: 81, cname: "古巴", countryId: 53),
+ (id: 91, cname: "吉尔吉斯斯坦", countryId: 996),
+ (id: 90, cname: "吉布提", countryId: 253),
+ (id: 89, cname: "基里巴斯", countryId: 686),
+ (id: 88, cname: "维克岛", countryId: 1808),
+ (id: 87, cname: "洪都拉斯", countryId: 504),
+ (id: 86, cname: "荷兰", countryId: 31),
+ (id: 85, cname: "朝鲜", countryId: 850),
+ (id: 84, cname: "海地", countryId: 509),
+ (id: 83, cname: "关岛", countryId: 1671),
+ (id: 82, cname: "瓜德罗普岛", countryId: 590),
+ (id: 69, cname: "菲律宾", countryId: 63),
+ ];
+}
diff --git a/lib/common/skeleton/fav_pgc_item.dart b/lib/common/skeleton/fav_pgc_item.dart
index 86fa755eed..2704b3ee00 100644
--- a/lib/common/skeleton/fav_pgc_item.dart
+++ b/lib/common/skeleton/fav_pgc_item.dart
@@ -1,5 +1,5 @@
-import 'package:PiliPlus/common/constants.dart';
import 'package:PiliPlus/common/skeleton/skeleton.dart';
+import 'package:PiliPlus/common/style.dart';
import 'package:PiliPlus/common/widgets/flutter/layout_builder.dart';
import 'package:flutter/material.dart' hide LayoutBuilder;
@@ -12,7 +12,7 @@ class FavPgcItemSkeleton extends StatelessWidget {
return Skeleton(
child: Padding(
padding: const EdgeInsets.symmetric(
- horizontal: StyleString.safeSpace,
+ horizontal: Style.safeSpace,
vertical: 5,
),
child: Row(
diff --git a/lib/common/skeleton/media_bangumi.dart b/lib/common/skeleton/media_bangumi.dart
index eb26f30c2a..eeeabcfda0 100644
--- a/lib/common/skeleton/media_bangumi.dart
+++ b/lib/common/skeleton/media_bangumi.dart
@@ -1,5 +1,5 @@
-import 'package:PiliPlus/common/constants.dart';
import 'package:PiliPlus/common/skeleton/skeleton.dart';
+import 'package:PiliPlus/common/style.dart';
import 'package:flutter/material.dart';
class MediaPgcSkeleton extends StatefulWidget {
@@ -15,11 +15,9 @@ class _MediaPgcSkeletonState extends State {
Color bgColor = Theme.of(context).colorScheme.onInverseSurface;
return Skeleton(
child: Padding(
- padding: const EdgeInsets.fromLTRB(
- StyleString.safeSpace,
- 7,
- StyleString.safeSpace,
- 7,
+ padding: const .symmetric(
+ horizontal: Style.safeSpace,
+ vertical: 7,
),
child: Row(
children: [
diff --git a/lib/common/skeleton/video_card_h.dart b/lib/common/skeleton/video_card_h.dart
index b25a6a9ddb..e328a6cd1c 100644
--- a/lib/common/skeleton/video_card_h.dart
+++ b/lib/common/skeleton/video_card_h.dart
@@ -1,5 +1,5 @@
-import 'package:PiliPlus/common/constants.dart';
import 'package:PiliPlus/common/skeleton/skeleton.dart';
+import 'package:PiliPlus/common/style.dart';
import 'package:flutter/material.dart';
class VideoCardHSkeleton extends StatelessWidget {
@@ -10,25 +10,25 @@ class VideoCardHSkeleton extends StatelessWidget {
final color = Theme.of(context).colorScheme.onInverseSurface;
return Skeleton(
child: Padding(
- padding: const EdgeInsets.symmetric(
- horizontal: StyleString.safeSpace,
+ padding: const .symmetric(
+ horizontal: Style.safeSpace,
vertical: 5,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(
- aspectRatio: StyleString.aspectRatio,
+ aspectRatio: Style.aspectRatio,
child: DecoratedBox(
decoration: BoxDecoration(
color: color,
- borderRadius: StyleString.mdRadius,
+ borderRadius: Style.mdRadius,
),
),
),
Expanded(
child: Padding(
- padding: const EdgeInsets.fromLTRB(10, 4, 6, 4),
+ padding: const .fromLTRB(10, 4, 6, 4),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
diff --git a/lib/common/skeleton/video_card_v.dart b/lib/common/skeleton/video_card_v.dart
index faa33a92b3..7a36f4d6c3 100644
--- a/lib/common/skeleton/video_card_v.dart
+++ b/lib/common/skeleton/video_card_v.dart
@@ -1,5 +1,5 @@
-import 'package:PiliPlus/common/constants.dart';
import 'package:PiliPlus/common/skeleton/skeleton.dart';
+import 'package:PiliPlus/common/style.dart';
import 'package:flutter/material.dart';
class VideoCardVSkeleton extends StatelessWidget {
@@ -13,11 +13,11 @@ class VideoCardVSkeleton extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(
- aspectRatio: StyleString.aspectRatio,
+ aspectRatio: Style.aspectRatio,
child: DecoratedBox(
decoration: BoxDecoration(
color: color,
- borderRadius: StyleString.mdRadius,
+ borderRadius: Style.mdRadius,
),
),
),
diff --git a/lib/common/style.dart b/lib/common/style.dart
new file mode 100644
index 0000000000..a50f36f798
--- /dev/null
+++ b/lib/common/style.dart
@@ -0,0 +1,24 @@
+import 'package:flutter/material.dart'
+ show BorderRadius, Radius, BoxConstraints, ButtonStyle, VisualDensity;
+
+abstract final class Style {
+ static const cardSpace = 8.0;
+ static const safeSpace = 12.0;
+ static const mdRadius = BorderRadius.all(imgRadius);
+ static const imgRadius = Radius.circular(10);
+ static const aspectRatio = 16 / 10;
+ static const aspectRatio16x9 = 16 / 9;
+ static const imgMaxRatio = 2.6;
+ static const bottomSheetRadius = BorderRadius.vertical(
+ top: Radius.circular(18),
+ );
+ static const dialogFixedConstraints = BoxConstraints(
+ minWidth: 420,
+ maxWidth: 420,
+ );
+ static const topBarHeight = 52.0;
+ static const buttonStyle = ButtonStyle(
+ visualDensity: VisualDensity(horizontal: -2, vertical: -1.25),
+ tapTargetSize: .shrinkWrap,
+ );
+}
diff --git a/lib/common/widgets/color_palette.dart b/lib/common/widgets/color_palette.dart
index 3dda88cfbf..ed6fe0a47a 100644
--- a/lib/common/widgets/color_palette.dart
+++ b/lib/common/widgets/color_palette.dart
@@ -1,4 +1,4 @@
-import 'package:PiliPlus/common/constants.dart';
+import 'package:PiliPlus/common/style.dart';
import 'package:flutter/material.dart';
class ColorPalette extends StatelessWidget {
@@ -62,7 +62,7 @@ class ColorPalette extends StatelessWidget {
padding: const EdgeInsets.all(6),
decoration: BoxDecoration(
color: colorScheme.onInverseSurface,
- borderRadius: StyleString.mdRadius,
+ borderRadius: Style.mdRadius,
),
child: child,
);
diff --git a/lib/common/widgets/custom_toast.dart b/lib/common/widgets/custom_toast.dart
index 30d0e84b51..edc416fb84 100644
--- a/lib/common/widgets/custom_toast.dart
+++ b/lib/common/widgets/custom_toast.dart
@@ -10,23 +10,21 @@ class CustomToast extends StatelessWidget {
@override
Widget build(BuildContext context) {
- final ThemeData theme = Theme.of(context);
+ final colorScheme = ColorScheme.of(context);
return Container(
margin: EdgeInsets.only(
bottom: MediaQuery.viewPaddingOf(context).bottom + 30,
),
padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 10),
decoration: BoxDecoration(
- color: theme.colorScheme.primaryContainer.withValues(
- alpha: toastOpacity,
- ),
+ color: colorScheme.primaryContainer.withValues(alpha: toastOpacity),
borderRadius: const BorderRadius.all(Radius.circular(20)),
),
child: Text(
msg,
style: TextStyle(
fontSize: 13,
- color: theme.colorScheme.onPrimaryContainer,
+ color: colorScheme.onPrimaryContainer,
),
),
);
@@ -41,7 +39,7 @@ class LoadingWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
- final ThemeData theme = Theme.of(context);
+ final theme = Theme.of(context);
final onSurfaceVariant = theme.colorScheme.onSurfaceVariant;
return Container(
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20),
@@ -58,7 +56,6 @@ class LoadingWidget extends StatelessWidget {
strokeWidth: 3,
valueColor: AlwaysStoppedAnimation(onSurfaceVariant),
),
-
//msg
Text(msg, style: TextStyle(color: onSurfaceVariant)),
],
diff --git a/lib/common/widgets/dialog/dialog.dart b/lib/common/widgets/dialog/dialog.dart
index 23ffcf14fa..9d9ff7b227 100644
--- a/lib/common/widgets/dialog/dialog.dart
+++ b/lib/common/widgets/dialog/dialog.dart
@@ -3,21 +3,16 @@ import 'package:get/get.dart';
Future showConfirmDialog({
required BuildContext context,
- required String title,
- Object? content,
+ required Widget title,
+ Widget? content,
// @Deprecated('use `bool result = await showConfirmDialog()` instead')
VoidCallback? onConfirm,
}) async {
- assert(content is String? || content is Widget);
return await showDialog(
context: context,
builder: (context) => AlertDialog(
- title: Text(title),
- content: content is String
- ? Text(content)
- : content is Widget
- ? content
- : null,
+ title: title,
+ content: content,
actions: [
TextButton(
onPressed: Get.back,
diff --git a/lib/common/widgets/dialog/export_import.dart b/lib/common/widgets/dialog/export_import.dart
index 5fd17661fb..53b2fdd693 100644
--- a/lib/common/widgets/dialog/export_import.dart
+++ b/lib/common/widgets/dialog/export_import.dart
@@ -2,7 +2,7 @@ import 'dart:async' show FutureOr;
import 'dart:convert' show utf8, jsonDecode;
import 'dart:io' show File;
-import 'package:PiliPlus/common/constants.dart' show StyleString;
+import 'package:PiliPlus/common/style.dart';
import 'package:PiliPlus/utils/extension/context_ext.dart';
import 'package:PiliPlus/utils/utils.dart';
import 'package:file_picker/file_picker.dart';
@@ -155,7 +155,7 @@ void importFromInput(
context: context,
builder: (context) => AlertDialog(
title: Text('输入$title'),
- constraints: StyleString.dialogFixedConstraints,
+ constraints: Style.dialogFixedConstraints,
content: TextFormField(
key: key,
minLines: 4,
@@ -211,7 +211,6 @@ void importFromInput(
Future showImportExportDialog(
BuildContext context, {
required String title,
- String? label,
required ValueGetter onExport,
required FutureOr Function(T json) onImport,
required ValueGetter localFileName,
diff --git a/lib/common/widgets/extra_hit_test_widget.dart b/lib/common/widgets/extra_hit_test_widget.dart
new file mode 100644
index 0000000000..356510f756
--- /dev/null
+++ b/lib/common/widgets/extra_hit_test_widget.dart
@@ -0,0 +1,31 @@
+import 'package:flutter/rendering.dart' show RenderProxyBox, BoxHitTestResult;
+import 'package:flutter/widgets.dart';
+
+class ExtraHitTestWidget extends SingleChildRenderObjectWidget {
+ const ExtraHitTestWidget({
+ super.key,
+ required this.width,
+ required Widget super.child,
+ });
+
+ final double width;
+
+ @override
+ RenderObject createRenderObject(BuildContext context) {
+ return RenderExtraHitTestWidget(width: width);
+ }
+}
+
+class RenderExtraHitTestWidget extends RenderProxyBox {
+ RenderExtraHitTestWidget({
+ required double width,
+ }) : _width = width;
+
+ final double _width;
+
+ @override
+ bool hitTestChildren(BoxHitTestResult result, {required Offset position}) {
+ return super.hitTestChildren(result, position: position) ||
+ position.dx <= _width;
+ }
+}
diff --git a/lib/common/widgets/flutter/pop_scope.dart b/lib/common/widgets/flutter/pop_scope.dart
index 85401dc0f6..33cffe2e1c 100644
--- a/lib/common/widgets/flutter/pop_scope.dart
+++ b/lib/common/widgets/flutter/pop_scope.dart
@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-import 'package:flutter/material.dart';
+import 'package:flutter/material.dart' hide PopScope;
+import 'package:get/get_core/src/get_main.dart';
+import 'package:get/get_navigation/src/extension_navigation.dart';
abstract class PopScopeState extends State
- implements PopEntry {
+ implements PopEntry