diff --git a/README.md b/README.md index 3c1511f..6a0b475 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,6 @@ ## Packages -- flutter_ringtone_player - flutter_inappwebview - web_socket_channel - permission_handler diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 3e7ec42..7a7e654 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -20,7 +20,7 @@ plugins { dependencies { // Import the Firebase BoM - implementation(platform("com.google.firebase:firebase-bom:34.3.0")) + implementation(platform("com.google.firebase:firebase-bom:34.6.0")) // TODO: Add the dependencies for Firebase products you want to use // When using the BoM, don't specify versions in Firebase dependencies diff --git a/android/build.gradle.kts b/android/build.gradle.kts index 12bb5b5..fb354b6 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -1,6 +1,6 @@ plugins { // Add the dependency for the Google services Gradle plugin - id("com.google.gms.google-services") version "4.4.3" apply false + id("com.google.gms.google-services") version "4.4.4" apply false } allprojects { diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index e603bd3..8600ef6 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-all.zip diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index 45e4b27..8477e0f 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -18,8 +18,8 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.12.2" apply false - id("org.jetbrains.kotlin.android") version "2.2.20" apply false + id("com.android.application") version "8.13.1" apply false + id("org.jetbrains.kotlin.android") version "2.2.21" apply false } include(":app") diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 0000000..fa0b357 --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1,3 @@ +description: This file stores settings for Dart & Flutter DevTools. +documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states +extensions: diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 9e3e685..c3b9702 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -16,36 +16,36 @@ PODS: - FlutterMacOS - connectivity_plus (0.0.1): - Flutter - - Firebase/Auth (12.2.0): + - Firebase/Auth (12.4.0): - Firebase/CoreOnly - - FirebaseAuth (~> 12.2.0) - - Firebase/CoreOnly (12.2.0): - - FirebaseCore (~> 12.2.0) - - firebase_auth (6.1.0): - - Firebase/Auth (= 12.2.0) + - FirebaseAuth (~> 12.4.0) + - Firebase/CoreOnly (12.4.0): + - FirebaseCore (~> 12.4.0) + - firebase_auth (6.1.2): + - Firebase/Auth (= 12.4.0) - firebase_core - Flutter - - firebase_core (4.1.1): - - Firebase/CoreOnly (= 12.2.0) + - firebase_core (4.2.1): + - Firebase/CoreOnly (= 12.4.0) - Flutter - - FirebaseAppCheckInterop (12.2.0) - - FirebaseAuth (12.2.0): - - FirebaseAppCheckInterop (~> 12.2.0) - - FirebaseAuthInterop (~> 12.2.0) - - FirebaseCore (~> 12.2.0) - - FirebaseCoreExtension (~> 12.2.0) + - FirebaseAppCheckInterop (12.4.0) + - FirebaseAuth (12.4.0): + - FirebaseAppCheckInterop (~> 12.4.0) + - FirebaseAuthInterop (~> 12.4.0) + - FirebaseCore (~> 12.4.0) + - FirebaseCoreExtension (~> 12.4.0) - GoogleUtilities/AppDelegateSwizzler (~> 8.1) - GoogleUtilities/Environment (~> 8.1) - GTMSessionFetcher/Core (< 6.0, >= 3.4) - RecaptchaInterop (~> 101.0) - - FirebaseAuthInterop (12.2.0) - - FirebaseCore (12.2.0): - - FirebaseCoreInternal (~> 12.2.0) + - FirebaseAuthInterop (12.4.0) + - FirebaseCore (12.4.0): + - FirebaseCoreInternal (~> 12.4.0) - GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/Logger (~> 8.1) - - FirebaseCoreExtension (12.2.0): - - FirebaseCore (~> 12.2.0) - - FirebaseCoreInternal (12.2.0): + - FirebaseCoreExtension (12.4.0): + - FirebaseCore (~> 12.4.0) + - FirebaseCoreInternal (12.4.0): - "GoogleUtilities/NSData+zlib (~> 8.1)" - Flutter (1.0.0) - flutter_inappwebview_ios (0.0.1): @@ -55,8 +55,6 @@ PODS: - flutter_inappwebview_ios/Core (0.0.1): - Flutter - OrderedSet (~> 6.0.3) - - flutter_ringtone_player (0.0.1): - - Flutter - fluttertoast (0.0.2): - Flutter - google_sign_in_ios (0.0.1): @@ -130,7 +128,6 @@ DEPENDENCIES: - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - Flutter (from `Flutter`) - flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`) - - flutter_ringtone_player (from `.symlinks/plugins/flutter_ringtone_player/ios`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) @@ -175,8 +172,6 @@ EXTERNAL SOURCES: :path: Flutter flutter_inappwebview_ios: :path: ".symlinks/plugins/flutter_inappwebview_ios/ios" - flutter_ringtone_player: - :path: ".symlinks/plugins/flutter_ringtone_player/ios" fluttertoast: :path: ".symlinks/plugins/fluttertoast/ios" google_sign_in_ios: @@ -202,34 +197,33 @@ SPEC CHECKSUMS: AppCheckCore: cc8fd0a3a230ddd401f326489c99990b013f0c4f audioplayers_darwin: 4f9ca89d92d3d21cec7ec580e78ca888e5fb68bd connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd - Firebase: 26f6f8d460603af3df970ad505b16b15f5e2e9a1 - firebase_auth: 069b05a861a7c2f7a73112dd616a49a40f35ae52 - firebase_core: dfc4bd142bee4bc53a5d482397ca322c2dd3165d - FirebaseAppCheckInterop: a1b2598c64c5a8c42fd6f6a1c3d0938ae4324678 - FirebaseAuth: 059c11702bdb759bb49b6c7ec6ff67abf21f39c4 - FirebaseAuthInterop: 217702acd4cc6baa98ba9d6c054532e0de0b8a16 - FirebaseCore: 311c48a147ad4a0ab7febbaed89e8025c67510cd - FirebaseCoreExtension: 73af080c22a2f7b44cefa391dc08f7e4ee162cb5 - FirebaseCoreInternal: 56ea29f3dad2894f81b060f706f9d53509b6ed3b + Firebase: f07b15ae5a6ec0f93713e30b923d9970d144af3e + firebase_auth: 9225db04db5d8e3b46dc8940e04bc6aec6833e27 + firebase_core: f1aafb21c14f497e5498f7ffc4dc63cbb52b2594 + FirebaseAppCheckInterop: f734c802f21fe1da0837708f0f9a27218c8a4ed0 + FirebaseAuth: 4a2aed737c84114a9d9b33d11ae1b147d6b94889 + FirebaseAuthInterop: 858e6b754966e70740a4370dd1503dfffe6dbb49 + FirebaseCore: bb595f3114953664e3c1dc032f008a244147cfd3 + FirebaseCoreExtension: 7e1f7118ee970e001a8013719fb90950ee5e0018 + FirebaseCoreInternal: d7f5a043c2cd01a08103ab586587c1468047bca6 Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 flutter_inappwebview_ios: b89ba3482b96fb25e00c967aae065701b66e9b99 - flutter_ringtone_player: a77c42464250845611eaa44c27e8714acc800138 fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1 - google_sign_in_ios: 205742c688aea0e64db9da03c33121694a365109 + google_sign_in_ios: 00dfa94252eb10278b64828c81bcb7158a81a53a GoogleSignIn: c7f09cfbc85a1abf69187be091997c317cc33b77 GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 GTMAppAuth: 217a876b249c3c585a54fd6f73e6b58c4f5c4238 GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 - image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a + image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326 mobile_scanner: 9157936403f5a0644ca3779a38ff8404c5434a93 OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94 - path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564 + path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880 permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 RecaptchaInterop: 11e0b637842dfb48308d242afc3f448062325aba share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0 - url_launcher_ios: 694010445543906933d732453a59da0a173ae33d + url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b PODFILE CHECKSUM: e615128e67103d6c13341e7c9cf615f3bc73c500 diff --git a/lib/assets/medias/pay.wav b/lib/assets/medias/pay.wav new file mode 100644 index 0000000..7bc033f Binary files /dev/null and b/lib/assets/medias/pay.wav differ diff --git a/lib/configure/fluttertoast.dart b/lib/configure/fluttertoast.dart index cc15bf3..2c42f12 100644 --- a/lib/configure/fluttertoast.dart +++ b/lib/configure/fluttertoast.dart @@ -35,13 +35,13 @@ class Toaster { child: Container( alignment: Alignment.topCenter, padding: EdgeInsets.only( - top: 640.wmax * 10.sr, - left: 640.wmax * 20.sr, - right: 640.wmax * 15.sr, - bottom: 640.wmax * 10.sr, + top: 10.vp, + left: 20.vp, + right: 15.vp, + bottom: 10.vp, ), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(640.wmax * 32.sr), + borderRadius: BorderRadius.circular(32.vp), color: Colors.redAccent, ), child: Row( @@ -52,14 +52,14 @@ class Toaster { behavior: HitTestBehavior.opaque, child: Container( alignment: Alignment.center, - padding: EdgeInsets.only(left: 640.wmax * 10.sr), + padding: EdgeInsets.only(left: 10.vp), child: IntrinsicWidth( child: Text( message!, style: TextStyle( - fontSize: 640.wmax * 14.sr, - fontWeight: FontWeight.w600, color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 14.fp, height: 1.3, ), ), @@ -74,11 +74,11 @@ class Toaster { ), ), SizedBox( - width: 640.wmax * 24.sr, - height: 640.wmax * 24.sr, + width: 24.vp, + height: 24.vp, child: IconButton( color: Colors.white, - iconSize: 640.wmax * 24.sr, + iconSize: 24.vp, padding: const EdgeInsets.all(0), icon: const Icon(Icons.close), onPressed: () => fToast.removeCustomToast(), @@ -90,9 +90,9 @@ class Toaster { toastDuration: duration ?? const Duration(seconds: 3), positionedToastBuilder: (context, child, gravity) { return Positioned( - top: max(640.wmax * 48.sr, mediaPadding.top + 640.wmax * 6.sr), - left: 640.wmax * 20.sr, - right: 640.wmax * 20.sr, + top: max(48.vp, mediaPadding.top + 6.vp), + left: 20.vp, + right: 20.vp, child: child, ); }, @@ -127,13 +127,13 @@ class Toaster { child: Container( alignment: Alignment.topCenter, padding: EdgeInsets.only( - top: 640.wmax * 10.sr, - left: 640.wmax * 20.sr, - right: 640.wmax * 15.sr, - bottom: 640.wmax * 10.sr, + top: 10.vp, + left: 20.vp, + right: 15.vp, + bottom: 10.vp, ), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(640.wmax * 32.sr), + borderRadius: BorderRadius.circular(32.vp), color: Color(0xffffc107), ), child: Row( @@ -144,14 +144,14 @@ class Toaster { behavior: HitTestBehavior.opaque, child: Container( alignment: Alignment.center, - padding: EdgeInsets.only(left: 640.wmax * 10.sr), + padding: EdgeInsets.only(left: 10.vp), child: IntrinsicWidth( child: Text( message!, style: TextStyle( - fontSize: 640.wmax * 14.sr, - fontWeight: FontWeight.w600, color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 14.fp, height: 1.3, ), ), @@ -166,11 +166,11 @@ class Toaster { ), ), SizedBox( - width: 640.wmax * 24.sr, - height: 640.wmax * 24.sr, + width: 24.vp, + height: 24.vp, child: IconButton( color: Colors.white, - iconSize: 640.wmax * 24.sr, + iconSize: 24.vp, padding: const EdgeInsets.all(0), icon: const Icon(Icons.error_outline), onPressed: () => fToast.removeCustomToast(), @@ -182,9 +182,9 @@ class Toaster { toastDuration: duration ?? const Duration(seconds: 3), positionedToastBuilder: (context, child, gravity) { return Positioned( - top: max(640.wmax * 48.sr, mediaPadding.top + 640.wmax * 6.sr), - left: 640.wmax * 20.sr, - right: 640.wmax * 20.sr, + top: max(48.vp, mediaPadding.top + 6.vp), + left: 20.vp, + right: 20.vp, child: child, ); }, @@ -219,13 +219,13 @@ class Toaster { child: Container( alignment: Alignment.topCenter, padding: EdgeInsets.only( - top: 640.wmax * 10.sr, - left: 640.wmax * 20.sr, - right: 640.wmax * 15.sr, - bottom: 640.wmax * 10.sr, + top: 10.vp, + left: 20.vp, + right: 15.vp, + bottom: 10.vp, ), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(640.wmax * 32.sr), + borderRadius: BorderRadius.circular(32.vp), color: const Color(0xff52c41b), ), child: Row( @@ -236,14 +236,14 @@ class Toaster { behavior: HitTestBehavior.opaque, child: Container( alignment: Alignment.center, - padding: EdgeInsets.only(left: 640.wmax * 10.sr), + padding: EdgeInsets.only(left: 10.vp), child: IntrinsicWidth( child: Text( message!, style: TextStyle( - fontSize: 640.wmax * 14.sr, - fontWeight: FontWeight.w600, color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 14.fp, height: 1.3, ), ), @@ -258,11 +258,11 @@ class Toaster { ), ), SizedBox( - width: 640.wmax * 24.sr, - height: 640.wmax * 24.sr, + width: 24.vp, + height: 24.vp, child: IconButton( + iconSize: 24.vp, color: Colors.white, - iconSize: 640.wmax * 24.sr, padding: const EdgeInsets.all(0), icon: const Icon(Icons.check), onPressed: () => fToast.removeCustomToast(), @@ -274,9 +274,9 @@ class Toaster { toastDuration: duration ?? const Duration(seconds: 3), positionedToastBuilder: (context, child, gravity) { return Positioned( - top: max(640.wmax * 48.sr, mediaPadding.top + 640.wmax * 6.sr), - left: 640.wmax * 20.sr, - right: 640.wmax * 20.sr, + top: max(48.vp, mediaPadding.top + 6.vp), + left: 20.vp, + right: 20.vp, child: child, ); }, diff --git a/lib/configure/get_dialoger.dart b/lib/configure/get_dialoger.dart index 6c727cc..8f073eb 100644 --- a/lib/configure/get_dialoger.dart +++ b/lib/configure/get_dialoger.dart @@ -1,6 +1,7 @@ import 'package:get/get.dart'; import 'package:flutter/material.dart'; import 'package:dompet/service/bind.dart'; +import 'package:dompet/extension/size.dart'; class Dialoger { static Future show({ @@ -45,14 +46,14 @@ class Dialoger { if (cancel == null && showCancelButton == true) { cancel = TextButton( - style: TextButton.styleFrom( - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8), - ), onPressed: () { Navigator.of(Get.overlayContext!).pop(false); onCancel?.call(); }, + style: TextButton.styleFrom( + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8), + ), child: Text( textCancel ?? 'System_Cancel'.tr, style: TextStyle(color: cancelTextColor), @@ -62,14 +63,14 @@ class Dialoger { if (confirm == null && showConfirmButton == true) { confirm = TextButton( - style: TextButton.styleFrom( - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8), - ), onPressed: () { Navigator.of(Get.overlayContext!).pop(true); onConfirm?.call(); }, + style: TextButton.styleFrom( + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8), + ), child: Text( textConfirm ?? 'System_Confirm'.tr, style: TextStyle(color: confirmTextColor), @@ -84,20 +85,21 @@ class Dialoger { ]; } - messageStyle ??= const TextStyle( + messageStyle ??= TextStyle( color: Colors.black, fontWeight: FontWeight.w400, - fontSize: 14, + fontSize: 14.fp, ); - titleStyle ??= const TextStyle( + titleStyle ??= TextStyle( color: Colors.black, fontWeight: FontWeight.w600, - fontSize: 16, + fontSize: 16.fp, ); final mediaQueryController = Get.find(); final mediaQueryWidth = mediaQueryController.width.value; + final alertDialog = AlertDialog( title: Text( title ?? 'System_Prompt'.tr, diff --git a/lib/extension/size.dart b/lib/extension/size.dart index 06e2491..9fb3d09 100644 --- a/lib/extension/size.dart +++ b/lib/extension/size.dart @@ -1,3 +1,4 @@ +import 'dart:math' as math; import 'package:get/get.dart'; import 'package:dompet/service/media.dart'; @@ -26,6 +27,8 @@ extension IntegerExtension on int { } extension SizeExtension on num { + static const font = 1.0; + static const scale = 1.5; static const preset = 375.0; static final width = Get.find().width; static final height = Get.find().height; @@ -74,12 +77,12 @@ extension SizeExtension on num { return this > 100.vmax ? this / 1 : 100.vmax; } - double get wdp { - return this * width.value.sr; + double get vp { + return this * math.min(width.value.sr, scale); } - double get hdp { - return this * height.value.sr; + double get fp { + return this * math.min(width.value.sr, font); } double get sr { diff --git a/lib/logger/output.dart b/lib/logger/output.dart index cc8b700..4ef5346 100644 --- a/lib/logger/output.dart +++ b/lib/logger/output.dart @@ -162,11 +162,14 @@ class SafeFileOutput extends LogOutput { } for (final file in files) { - final name = basename(file.path); - final path = file.path; - formData.files.add( - MapEntry('files', MultipartFile.fromFileSync(path, filename: name)), + MapEntry( + 'files', + MultipartFile.fromBytes( + file.readAsBytesSync(), + filename: basename(file.path), + ), + ), ); } @@ -191,11 +194,14 @@ class SafeFileOutput extends LogOutput { return null; } - final name = basename(files.first.path); - final path = files.first.path; - formData.files.add( - MapEntry('file', MultipartFile.fromFileSync(path, filename: name)), + MapEntry( + 'files', + MultipartFile.fromBytes( + files.first.readAsBytesSync(), + filename: basename(files.first.path), + ), + ), ); return formData; diff --git a/lib/pages/card/index.dart b/lib/pages/card/index.dart index f68c80c..6b671ed 100644 --- a/lib/pages/card/index.dart +++ b/lib/pages/card/index.dart @@ -46,7 +46,7 @@ class PageCard extends GetView { Widget buildBack(BuildContext context) { final mediaTopBar = controller.mediaTopBar.value; final mediaPadding = controller.mediaPadding.value; - final height = max(640.wmax * 40.sr, mediaTopBar); + final height = max(40.vp, mediaTopBar); return Positioned( top: 0, @@ -58,12 +58,12 @@ class PageCard extends GetView { width: 680.wmax, height: height, margin: EdgeInsets.only( - top: max(mediaPadding.top, 640.wmax * 20.sr), - left: 640.wmax * 20.sr, + top: max(mediaPadding.top, 20.vp), + left: 20.vp, ), padding: EdgeInsets.only( - top: (height - 640.wmax * 36.sr) / 2, - bottom: (height - 640.wmax * 36.sr) / 2, + top: (height - 36.vp) / 2, + bottom: (height - 36.vp) / 2, ), child: Row( children: [ @@ -71,10 +71,10 @@ class PageCard extends GetView { behavior: HitTestBehavior.opaque, onTap: () => GetNavigate.back(), child: Image( - image: const AssetImage('lib/assets/images/auth/back.png'), - width: 640.wmax * 36.sr, - height: 640.wmax * 36.sr, fit: BoxFit.fill, + image: const AssetImage('lib/assets/images/auth/back.png'), + width: 36.vp, + height: 36.vp, ), ), ], @@ -93,22 +93,19 @@ class PageCard extends GetView { duration: duration, onEnd: () => isAnimating.value = false, margin: EdgeInsets.only( - top: isExpand.value ? 640.wmax * 103.sr : 640.wmax * 136.sr, - bottom: isExpand.value ? 640.wmax * 6.sr : 640.wmax * 61.sr, + top: isExpand.value ? 103.vp : 136.vp, + bottom: isExpand.value ? 6.vp : 61.vp, ), child: Container( color: Colors.white, alignment: Alignment.center, - padding: EdgeInsets.only( - left: 640.wmax * 32.sr, - right: 640.wmax * 32.sr, - ), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), child: Text( 'Bank Card'.tr, style: TextStyle( - fontSize: 640.wmax * 24.sr, - fontWeight: FontWeight.bold, color: const Color(0xff130138), + fontWeight: FontWeight.bold, + fontSize: 24.fp, height: 1.2, ), ), @@ -124,15 +121,13 @@ class PageCard extends GetView { return AnimatedContainer( duration: duration, onEnd: () => isAnimating.value = false, - margin: EdgeInsets.only( - bottom: isExpand.value ? 640.wmax * 56.sr : 640.wmax * 48.sr, - ), + margin: EdgeInsets.only(bottom: isExpand.value ? 56.vp : 48.vp), child: Container( color: Colors.white, alignment: Alignment.center, padding: EdgeInsets.only( - left: isExpand.value ? 640.wmax * 32.sr : 640.wmax * 17.sr, - right: isExpand.value ? 640.wmax * 32.sr : 640.wmax * 17.sr, + left: isExpand.value ? 32.vp : 17.vp, + right: isExpand.value ? 32.vp : 17.vp, ), child: Column( children: [buildCardImage(context), buildCardDetail(context)], @@ -160,12 +155,12 @@ class PageCard extends GetView { : 1; final width = isAnimating.value || isExpand.value - ? 640.wmax * 220.sr * scale - : 640.wmax * 240.sr; + ? 220.vp * scale + : 240.vp; final height = isAnimating.value || isExpand.value - ? 640.wmax * 311.sr * scale - : 640.wmax * 340.sr; + ? 311.vp * scale + : 340.vp; return Transform.rotate( angle: animationValue.value, @@ -180,12 +175,12 @@ class PageCard extends GetView { fit: BoxFit.fill, ), Positioned( - right: 640.wmax * 38.5.sr * scale, - bottom: 640.wmax * 21.sr * scale, + right: 38.5.vp * scale, + bottom: 21.vp * scale, child: Image.asset( 'lib/assets/images/card/visa.png', - width: 640.wmax * 29.2.sr * scale, - height: 640.wmax * 44.sr * scale, + width: 29.2.vp * scale, + height: 44.vp * scale, fit: BoxFit.fill, ), ), @@ -195,24 +190,21 @@ class PageCard extends GetView { ); }, ), - SizedBox( - width: 640.wmax, - height: isExpand.value ? 640.wmax * 13.sr : 640.wmax * 40.sr, - ), + SizedBox(width: 640.wmax, height: isExpand.value ? 13.vp : 40.vp), ], ), Positioned( left: 0, right: 0, - bottom: isExpand.value ? 640.wmax * 15.sr : 0, + bottom: isExpand.value ? 15.vp : 0, child: Offstage( offstage: isAnimating.value, child: Container( alignment: Alignment.topCenter, child: Image.asset( 'lib/assets/images/card/shadow.png', - width: 640.wmax * 206.sr, - height: 640.wmax * 79.sr, + width: 206.vp, + height: 79.vp, fit: BoxFit.fill, ), ), @@ -229,42 +221,39 @@ class PageCard extends GetView { final bankCard = controller.bankCard; return AnimatedContainer( - duration: duration, - onEnd: () => isAnimating.value = false, + onEnd: () { + isAnimating.value = false; + }, width: 640.wmax, - height: isExpand.value ? 640.wmax * 172.sr : 0, + height: isExpand.value ? 172.vp : 0, + duration: duration, child: ListView( shrinkWrap: false, physics: const NeverScrollableScrollPhysics(), - padding: EdgeInsets.only( - top: 0, - left: 640.wmax * 25.sr, - right: 640.wmax * 25.sr, - bottom: 0, - ), + padding: EdgeInsets.only(top: 0, left: 25.vp, right: 25.vp, bottom: 0), children: [ AnimatedOpacity( opacity: isExpand.value ? 1.0 : 0.0, duration: duration, child: SizedBox( - height: 640.wmax * 172.sr, + height: 172.vp, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - height: 640.wmax * 20.sr, + height: 20.vp, alignment: Alignment.centerLeft, child: Row( children: [ SizedBox( - width: 640.wmax * 80.sr, + width: 80.vp, child: Text( 'CardNo'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w500, color: const Color(0xffbdbdbd), + fontWeight: FontWeight.w500, + fontSize: 16.fp, height: 1, ), ), @@ -272,30 +261,30 @@ class PageCard extends GetView { Text( bankCard.value.cardNo.tr, style: TextStyle( - fontSize: 640.wmax * 15.sr, - fontWeight: FontWeight.w500, color: const Color(0xff303133), + fontWeight: FontWeight.w500, letterSpacing: 1.2, + fontSize: 15.fp, height: 1, ), ), ], ), ), - SizedBox(width: 640.wmax, height: 640.wmax * 18.sr), + SizedBox(width: 640.wmax, height: 18.vp), Container( - height: 640.wmax * 20.sr, + height: 20.vp, alignment: Alignment.centerLeft, child: Row( children: [ SizedBox( - width: 640.wmax * 80.sr, + width: 80.vp, child: Text( 'Type'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w500, color: const Color(0xffbdbdbd), + fontWeight: FontWeight.w500, + fontSize: 16.fp, height: 1, ), ), @@ -303,29 +292,29 @@ class PageCard extends GetView { Text( bankCard.value.cardType.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w500, color: const Color(0xff303133), + fontWeight: FontWeight.w500, + fontSize: 16.fp, height: 1, ), ), ], ), ), - SizedBox(width: 640.wmax, height: 640.wmax * 18.sr), + SizedBox(width: 640.wmax, height: 18.vp), Container( - height: 640.wmax * 20.sr, + height: 20.vp, alignment: Alignment.centerLeft, child: Row( children: [ SizedBox( - width: 640.wmax * 80.sr, + width: 80.vp, child: Text( 'Bank'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w500, color: const Color(0xffbdbdbd), + fontWeight: FontWeight.w500, + fontSize: 16.fp, height: 1, ), ), @@ -333,29 +322,29 @@ class PageCard extends GetView { Text( bankCard.value.bankName.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w500, color: const Color(0xff303133), + fontWeight: FontWeight.w500, + fontSize: 16.fp, height: 1, ), ), ], ), ), - SizedBox(width: 640.wmax, height: 640.wmax * 18.sr), + SizedBox(width: 640.wmax, height: 18.vp), Container( - height: 640.wmax * 20.sr, + height: 20.vp, alignment: Alignment.centerLeft, child: Row( children: [ SizedBox( - width: 640.wmax * 80.sr, + width: 80.vp, child: Text( 'Status'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w500, color: const Color(0xffbdbdbd), + fontWeight: FontWeight.w500, + fontSize: 16.fp, height: 1, ), ), @@ -365,29 +354,29 @@ class PageCard extends GetView { ? 'Available'.tr : 'Unavailable'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w500, color: const Color(0xff303133), + fontWeight: FontWeight.w500, + fontSize: 16.fp, height: 1, ), ), ], ), ), - SizedBox(width: 640.wmax, height: 640.wmax * 18.sr), + SizedBox(width: 640.wmax, height: 18.vp), Container( - height: 640.wmax * 20.sr, + height: 20.vp, alignment: Alignment.centerLeft, child: Row( children: [ SizedBox( - width: 640.wmax * 80.sr, + width: 80.vp, child: Text( 'Valid'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w500, color: const Color(0xffbdbdbd), + fontWeight: FontWeight.w500, + fontSize: 16.fp, height: 1, ), ), @@ -395,9 +384,9 @@ class PageCard extends GetView { Text( bankCard.value.expiryDate.yMMM(), style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w500, color: const Color(0xff303133), + fontWeight: FontWeight.w500, + fontSize: 16.fp, height: 1, ), ), @@ -417,7 +406,7 @@ class PageCard extends GetView { final isExpand = controller.isExpand; final isAnimating = controller.isAnimating; final mediaPadding = controller.mediaPadding.value; - final mediaBottom = max(mediaPadding.bottom, 640.wmax * 30.sr); + final mediaBottom = max(mediaPadding.bottom, 30.vp); Widget withInWell({required Widget child, dynamic onTap}) { return Material( @@ -426,7 +415,7 @@ class PageCard extends GetView { radius: 200.0, containedInkWell: true, highlightShape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(640.wmax * 30.0.sr)), + borderRadius: BorderRadius.all(Radius.circular(30.0.vp)), highlightColor: const Color(0xff45197d).withValues(alpha: 0.05), splashColor: const Color(0xff45197d).withValues(alpha: 0.05), focusColor: Colors.transparent, @@ -440,28 +429,21 @@ class PageCard extends GetView { return Container( color: Colors.white, alignment: Alignment.center, - padding: EdgeInsets.only( - left: 640.wmax * 32.sr, - right: 640.wmax * 32.sr, - bottom: mediaBottom, - ), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp, bottom: mediaBottom), child: IntrinsicWidth( child: withInWell( child: Container( color: Colors.transparent, alignment: Alignment.center, - constraints: BoxConstraints(minWidth: 640.wmax * 160.sr), - padding: EdgeInsets.symmetric( - vertical: 640.wmax * 15.sr, - horizontal: 640.wmax * 18.sr, - ), + constraints: BoxConstraints(minWidth: 160.vp), + padding: EdgeInsets.symmetric(vertical: 15.vp, horizontal: 18.vp), child: Text( isExpand.value ? 'Hide'.tr : 'Display'.tr, style: TextStyle( - fontSize: 640.wmax * 18.sr, - fontWeight: FontWeight.bold, color: const Color(0xff5b259f), + fontWeight: FontWeight.bold, letterSpacing: 1.2, + fontSize: 18.fp, height: 1.2, ), ), diff --git a/lib/pages/home/controller.dart b/lib/pages/home/controller.dart index 0e3f68d..72e5c60 100644 --- a/lib/pages/home/controller.dart +++ b/lib/pages/home/controller.dart @@ -34,8 +34,8 @@ class PageHomeController extends GetxController { scrollController.addListener(() { final scrollTop = scrollController.position.pixels; - final isShowShadow = scrollTop >= 640.wmax * 42.sr; - final isShowActions = scrollTop >= 640.wmax * 296.sr; + final isShowShadow = scrollTop >= 42.vp; + final isShowActions = scrollTop >= 296.vp; if (showActions.value != isShowActions) { isRunAnimating.value = showActions.value != isShowActions; diff --git a/lib/pages/home/index.dart b/lib/pages/home/index.dart index 8957137..b4d97e8 100644 --- a/lib/pages/home/index.dart +++ b/lib/pages/home/index.dart @@ -17,7 +17,7 @@ class PageHome extends GetView { return Scaffold( body: Obx(() { final mediaPadding = controller.mediaPadding.value; - final mediaBottom = max(mediaPadding.bottom, 640.wmax * 30.sr); + final mediaBottom = max(mediaPadding.bottom, 30.vp); return Align( alignment: Alignment.topCenter, @@ -32,7 +32,7 @@ class PageHome extends GetView { top: 0, left: 0, right: 0, - bottom: mediaBottom + 640.wmax * 92.sr, + bottom: mediaBottom + 92.vp, ), physics: const ClampingScrollPhysics(), controller: controller.scrollController, @@ -76,11 +76,11 @@ class PageHome extends GetView { left: 0, child: Container( width: 640.wmax, - height: max(640.wmax * 88.sr, mediaTop + 640.wmax * 56.sr), + height: max(88.vp, mediaTop + 56.vp), padding: EdgeInsets.only( - top: max(640.wmax * 32.sr, mediaTop), - left: 640.wmax * 32.sr, - right: 640.wmax * 32.sr, + top: max(32.vp, mediaTop), + left: 32.vp, + right: 32.vp, ), decoration: BoxDecoration(color: Colors.white, boxShadow: boxShadow), child: Stack( @@ -102,26 +102,19 @@ class PageHome extends GetView { return Container( width: 640.wmax, - padding: EdgeInsets.only(top: 640.wmax * 122.sr), + padding: EdgeInsets.only(top: 122.vp), child: Column( children: [ Container( - padding: EdgeInsets.only( - left: 640.wmax * 32.sr, - right: 640.wmax * 32.sr, - ), - margin: EdgeInsets.only(top: 640.wmax * 42.sr), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), + margin: EdgeInsets.only(top: 42.vp), child: GestureDetector( behavior: HitTestBehavior.opaque, onTap: () => GetNavigate.toNamed(GetRoutes.card), child: Container( - width: 640.wmax * 310.sr, - height: 640.wmax * 140.sr, - padding: EdgeInsets.only( - top: 640.wmax * 32.sr, - left: 640.wmax * 38.sr, - right: 640.wmax * 35.sr, - ), + width: 310.vp, + height: 140.vp, + padding: EdgeInsets.only(top: 32.vp, left: 38.vp, right: 35.vp), decoration: const BoxDecoration( image: DecorationImage( image: AssetImage('lib/assets/images/home/card.png'), @@ -135,30 +128,30 @@ class PageHome extends GetView { Text( 'Balance'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.bold, color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 16.fp, height: 1.2, ), ), Text( balance.value.USD, style: TextStyle( - fontSize: 640.wmax * 20.sr, - fontWeight: FontWeight.bold, color: const Color(0xffdfdfdf), + fontWeight: FontWeight.bold, + fontSize: 20.fp, height: 1.4, ), ), Container( - margin: EdgeInsets.only(top: 640.wmax * 10.sr), + margin: EdgeInsets.only(top: 10.vp), alignment: Alignment.centerRight, child: Text( 'Citibank', style: TextStyle( - fontSize: 640.wmax * 22.sr, - fontWeight: FontWeight.bold, color: const Color(0xfff0f0f0), + fontWeight: FontWeight.bold, + fontSize: 22.fp, height: 1.6, ), ), @@ -169,11 +162,8 @@ class PageHome extends GetView { ), ), Container( - padding: EdgeInsets.only( - left: 640.wmax * 52.sr, - right: 640.wmax * 52.sr, - ), - margin: EdgeInsets.only(top: 640.wmax * 36.sr), + padding: EdgeInsets.only(left: 52.vp, right: 52.vp), + margin: EdgeInsets.only(top: 36.vp), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, @@ -185,17 +175,15 @@ class PageHome extends GetView { arguments: 'Transfer', ), child: SizedBox( - width: 640.wmax * 80.sr, + width: 80.vp, child: Column( children: [ Container( - width: 640.wmax * 48.sr, - height: 640.wmax * 48.sr, + width: 48.vp, + height: 48.vp, alignment: Alignment.center, decoration: BoxDecoration( - borderRadius: BorderRadius.circular( - 640.wmax * 20.sr, - ), + borderRadius: BorderRadius.circular(20.vp), boxShadow: [ BoxShadow( color: const Color(0x26272246), @@ -208,18 +196,18 @@ class PageHome extends GetView { ), child: Image.asset( 'lib/assets/images/home/transfer.png', - width: 640.wmax * 28.sr, - height: 640.wmax * 28.sr, + width: 28.vp, + height: 28.vp, fit: BoxFit.fill, ), ), - SizedBox(height: 640.wmax * 16.sr), + SizedBox(height: 16.vp), Text( 'Transfer'.tr, style: TextStyle( - fontSize: 640.wmax * 13.sr, color: const Color(0xff8438FF), fontWeight: FontWeight.w500, + fontSize: 13.fp, height: 1.2, ), ), @@ -234,17 +222,15 @@ class PageHome extends GetView { arguments: 'Payment', ), child: SizedBox( - width: 640.wmax * 80.sr, + width: 80.vp, child: Column( children: [ Container( - width: 640.wmax * 48.sr, - height: 640.wmax * 48.sr, + width: 48.vp, + height: 48.vp, alignment: Alignment.center, decoration: BoxDecoration( - borderRadius: BorderRadius.circular( - 640.wmax * 20.sr, - ), + borderRadius: BorderRadius.circular(20.vp), boxShadow: [ BoxShadow( color: const Color(0x26272246), @@ -257,18 +243,18 @@ class PageHome extends GetView { ), child: Image.asset( 'lib/assets/images/home/payment.png', - width: 640.wmax * 28.sr, - height: 640.wmax * 28.sr, + width: 28.vp, + height: 28.vp, fit: BoxFit.fill, ), ), - SizedBox(height: 640.wmax * 16.sr), + SizedBox(height: 16.vp), Text( 'Payment'.tr, style: TextStyle( - fontSize: 640.wmax * 13.sr, color: const Color(0xff8438FF), fontWeight: FontWeight.w500, + fontSize: 13.fp, height: 1.2, ), ), @@ -283,17 +269,15 @@ class PageHome extends GetView { arguments: 'Top up', ), child: SizedBox( - width: 640.wmax * 80.sr, + width: 80.vp, child: Column( children: [ Container( - width: 640.wmax * 48.sr, - height: 640.wmax * 48.sr, + width: 48.vp, + height: 48.vp, alignment: Alignment.center, decoration: BoxDecoration( - borderRadius: BorderRadius.circular( - 640.wmax * 20.sr, - ), + borderRadius: BorderRadius.circular(20.vp), boxShadow: [ BoxShadow( color: const Color(0x26272246), @@ -306,18 +290,18 @@ class PageHome extends GetView { ), child: Image.asset( 'lib/assets/images/home/topup.png', - width: 640.wmax * 28.sr, - height: 640.wmax * 28.sr, + width: 28.vp, + height: 28.vp, fit: BoxFit.fill, ), ), - SizedBox(height: 640.wmax * 16.sr), + SizedBox(height: 16.vp), Text( 'Top up'.tr, style: TextStyle( - fontSize: 640.wmax * 13.sr, color: const Color(0xff8438FF), fontWeight: FontWeight.w500, + fontSize: 13.fp, height: 1.2, ), ), @@ -344,8 +328,8 @@ class PageHome extends GetView { return ClipOval( child: Image.memory( userAvatar, - width: 640.wmax * 39.sr, - height: 640.wmax * 39.sr, + width: 39.vp, + height: 39.vp, fit: BoxFit.fill, ), ); @@ -354,28 +338,24 @@ class PageHome extends GetView { return ClipOval( child: Image.asset( 'lib/assets/images/payer/$icon.png', - width: 640.wmax * 39.sr, - height: 640.wmax * 39.sr, + width: 39.vp, + height: 39.vp, fit: BoxFit.fill, ), ); } return Container( - padding: EdgeInsets.only(left: 640.wmax * 32.sr, right: 640.wmax * 32.sr), - margin: EdgeInsets.only(top: 640.wmax * 42.sr, bottom: 640.wmax * 15.sr), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), + margin: EdgeInsets.only(top: 42.vp, bottom: 15.vp), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( width: 640.wmax, - height: 640.wmax * 21.sr, - margin: EdgeInsets.only( - left: 640.wmax * 2.sr, - right: 640.wmax * 2.sr, - bottom: 640.wmax * 25.sr, - ), + height: 21.vp, + margin: EdgeInsets.only(left: 2.vp, right: 2.vp, bottom: 25.vp), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, @@ -383,19 +363,19 @@ class PageHome extends GetView { Text( 'Transactions'.tr, style: TextStyle( - fontSize: 640.wmax * 18.sr, - fontWeight: FontWeight.w600, color: const Color(0xff130138), + fontWeight: FontWeight.w600, letterSpacing: -0.35, + fontSize: 18.fp, height: 1, ), ), Text( 'Money'.tr, style: TextStyle( - fontSize: 640.wmax * 14.sr, - fontWeight: FontWeight.w600, color: const Color(0xff130138), + fontWeight: FontWeight.w600, + fontSize: 14.fp, height: 1, ), ), @@ -411,61 +391,61 @@ class PageHome extends GetView { final order = rawOrders[index]; return SizedBox( - height: 640.wmax * 39.sr, + height: 39.vp, child: Row( children: [ buildIconAvatar(order.icon), - SizedBox(width: 640.wmax * 15.sr), + SizedBox(width: 15.vp), Expanded( child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 640.wmax * 19.sr, + height: 19.vp, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( order.name.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: const Color(0xff000000), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), Text( order.money.usd, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: const Color(0xff363853), + fontWeight: FontWeight.w600, letterSpacing: -0.6, + fontSize: 16.fp, ), ), ], ), ), - SizedBox(height: 640.wmax * 2.sr), + SizedBox(height: 2.vp), SizedBox( - height: 640.wmax * 18.sr, + height: 18.vp, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( order.type.tr, style: TextStyle( - fontSize: 640.wmax * 14.sr, - fontWeight: FontWeight.w500, color: const Color(0xff909399), + fontWeight: FontWeight.w500, + fontSize: 14.fp, ), ), Text( order.date.yMMMd(), style: TextStyle( - fontSize: 640.wmax * 12.sr, - fontWeight: FontWeight.w500, color: const Color(0xffababab), + fontWeight: FontWeight.w500, + fontSize: 12.fp, ), ), ], @@ -479,7 +459,7 @@ class PageHome extends GetView { ); }, separatorBuilder: (BuildContext context, int index) { - return SizedBox(height: 640.wmax * 21.sr); + return SizedBox(height: 21.vp); }, ), ], @@ -500,7 +480,7 @@ class PageHome extends GetView { onEnd: () => isRunAnimating.value = false, child: SizedBox( width: 640.wmax * (1 - 64.sr), - height: 640.wmax * 56.sr, + height: 56.vp, child: Row( children: [ Expanded( @@ -512,19 +492,19 @@ class PageHome extends GetView { Text( 'Digital Wallet'.tr, style: TextStyle( - fontSize: 640.wmax * 24.sr, - fontWeight: FontWeight.bold, color: const Color(0xff130138), + fontWeight: FontWeight.bold, + fontSize: 24.fp, height: 1, ), ), - SizedBox(height: 640.wmax * 5.sr), + SizedBox(height: 5.vp), Text( 'available'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.normal, color: const Color(0xffbdbdbd), + fontWeight: FontWeight.normal, + fontSize: 16.fp, height: 1, ), ), @@ -552,8 +532,8 @@ class PageHome extends GetView { return ClipOval( child: Image.memory( loginUser.avatar.value!, - width: 640.wmax * 44.sr, - height: 640.wmax * 44.sr, + width: 44.vp, + height: 44.vp, fit: BoxFit.fill, ), ); @@ -562,8 +542,8 @@ class PageHome extends GetView { return ClipOval( child: Image.asset( 'lib/assets/images/home/avatar.png', - width: 640.wmax * 44.sr, - height: 640.wmax * 44.sr, + width: 44.vp, + height: 44.vp, fit: BoxFit.fill, ), ); @@ -582,11 +562,8 @@ class PageHome extends GetView { onEnd: () => isRunAnimating.value = false, child: Container( width: 640.wmax * (1 - 64.sr), - height: 640.wmax * 56.sr, - padding: EdgeInsets.only( - left: 640.wmax * 14.sr, - right: 640.wmax * 14.sr, - ), + height: 56.vp, + padding: EdgeInsets.only(left: 14.vp, right: 14.vp), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, @@ -600,23 +577,23 @@ class PageHome extends GetView { child: Column( children: [ Container( - width: 640.wmax * 80.sr, - height: 640.wmax * 28.sr, + width: 80.vp, + height: 28.vp, alignment: Alignment.topCenter, - padding: EdgeInsets.only(top: 640.wmax * 2.sr), + padding: EdgeInsets.only(top: 2.vp), child: Image.asset( 'lib/assets/images/home/transfer.png', - width: 640.wmax * 26.sr, - height: 640.wmax * 26.sr, + width: 26.vp, + height: 26.vp, fit: BoxFit.fill, ), ), Text( 'Transfer'.tr, style: TextStyle( - fontSize: 640.wmax * 13.sr, color: const Color(0xff2f1155), fontWeight: FontWeight.w600, + fontSize: 13.fp, height: 1.6, ), ), @@ -632,23 +609,23 @@ class PageHome extends GetView { child: Column( children: [ Container( - width: 640.wmax * 80.sr, - height: 640.wmax * 28.sr, + width: 80.vp, + height: 28.vp, alignment: Alignment.topCenter, - padding: EdgeInsets.only(top: 640.wmax * 2.sr), + padding: EdgeInsets.only(top: 2.vp), child: Image.asset( 'lib/assets/images/home/payment.png', - width: 640.wmax * 26.sr, - height: 640.wmax * 26.sr, + width: 26.vp, + height: 26.vp, fit: BoxFit.fill, ), ), Text( 'Payment'.tr, style: TextStyle( - fontSize: 640.wmax * 13.sr, color: const Color(0xff2f1155), fontWeight: FontWeight.w600, + fontSize: 13.fp, height: 1.6, ), ), @@ -663,23 +640,23 @@ class PageHome extends GetView { child: Column( children: [ Container( - width: 640.wmax * 80.sr, - height: 640.wmax * 28.sr, + width: 80.vp, + height: 28.vp, alignment: Alignment.topCenter, - padding: EdgeInsets.only(top: 640.wmax * 2.sr), + padding: EdgeInsets.only(top: 2.vp), child: Image.asset( 'lib/assets/images/home/topup.png', - width: 640.wmax * 26.sr, - height: 640.wmax * 26.sr, + width: 26.vp, + height: 26.vp, fit: BoxFit.fill, ), ), Text( 'Top up'.tr, style: TextStyle( - fontSize: 640.wmax * 13.sr, color: const Color(0xff2f1155), fontWeight: FontWeight.w600, + fontSize: 13.fp, height: 1.6, ), ), @@ -695,7 +672,7 @@ class PageHome extends GetView { Widget buildBottomTabbar(BuildContext context) { final mediaPadding = controller.mediaPadding.value; - final mediaBottom = max(mediaPadding.bottom, 640.wmax * 30.sr); + final mediaBottom = max(mediaPadding.bottom, 30.vp); return Positioned( left: 0, @@ -703,40 +680,40 @@ class PageHome extends GetView { child: Container( width: 640.wmax, color: Colors.white.withValues(alpha: 0.88), - height: mediaBottom + 640.wmax * 92.sr, + height: mediaBottom + 92.vp, alignment: Alignment.topCenter, padding: EdgeInsets.only( - top: 640.wmax * 10.sr, - left: 640.wmax * 24.sr, - right: 640.wmax * 24.sr, + top: 10.vp, + left: 24.vp, + right: 24.vp, bottom: mediaBottom, ), child: Stack( fit: StackFit.expand, children: [ Positioned( - top: 640.wmax * 32.sr, - left: 640.wmax * 24.sr, + top: 32.vp, + left: 24.vp, child: Image.asset( 'lib/assets/images/tabbar/bg.png', - width: 640.wmax * 280.sr, - height: 640.wmax * 52.sr, + width: 280.vp, + height: 52.vp, fit: BoxFit.fill, ), ), Align( alignment: Alignment.topLeft, child: Container( - height: 640.wmax * 78.sr, + height: 78.vp, padding: EdgeInsets.only( - top: 640.wmax * 25.sr, - left: 640.wmax * 40.sr, - right: 640.wmax * 40.sr, - bottom: 640.wmax * 25.sr, + top: 25.vp, + left: 40.vp, + right: 40.vp, + bottom: 25.vp, ), decoration: BoxDecoration( color: const Color(0xff2f1155), - borderRadius: BorderRadius.circular(640.wmax * 30.sr), + borderRadius: BorderRadius.circular(30.vp), boxShadow: [ BoxShadow( color: const Color(0x19272246), @@ -755,8 +732,8 @@ class PageHome extends GetView { onTap: () {}, child: Image.asset( 'lib/assets/images/tabbar/home_select.png', - width: 640.wmax * 28.sr, - height: 640.wmax * 28.sr, + width: 28.vp, + height: 28.vp, fit: BoxFit.fill, ), ), @@ -765,8 +742,8 @@ class PageHome extends GetView { onTap: () => GetNavigate.toNamed(GetRoutes.stats), child: Image.asset( 'lib/assets/images/tabbar/chart.png', - width: 640.wmax * 28.sr, - height: 640.wmax * 28.sr, + width: 28.vp, + height: 28.vp, fit: BoxFit.fill, ), ), @@ -775,8 +752,8 @@ class PageHome extends GetView { onTap: () => GetNavigate.toNamed(GetRoutes.notification), child: Image.asset( 'lib/assets/images/tabbar/notification.png', - width: 640.wmax * 28.sr, - height: 640.wmax * 28.sr, + width: 28.vp, + height: 28.vp, fit: BoxFit.fill, ), ), @@ -785,8 +762,8 @@ class PageHome extends GetView { onTap: () => GetNavigate.toNamed(GetRoutes.settings), child: Image.asset( 'lib/assets/images/tabbar/settings.png', - width: 640.wmax * 28.sr, - height: 640.wmax * 28.sr, + width: 28.vp, + height: 28.vp, fit: BoxFit.fill, ), ), diff --git a/lib/pages/langs/controller.dart b/lib/pages/langs/controller.dart index ab730d9..7ce23a3 100644 --- a/lib/pages/langs/controller.dart +++ b/lib/pages/langs/controller.dart @@ -26,8 +26,8 @@ class PageLangsController extends GetxController { super.onInit(); scrollController.addListener(() { - final expanded = 640.wmax * 152.sr; - final collapsed = max(640.wmax * 40.sr, mediaTopBar.value); + final expanded = 152.vp; + final collapsed = max(40.vp, mediaTopBar.value); isShadow.value = scrollController.position.pixels >= expanded - collapsed; }); } diff --git a/lib/pages/langs/index.dart b/lib/pages/langs/index.dart index f337c03..9eec9bc 100644 --- a/lib/pages/langs/index.dart +++ b/lib/pages/langs/index.dart @@ -19,7 +19,7 @@ class PageLangs extends GetView { final mediaTopBar = controller.mediaTopBar; final isShadow = controller.isShadow; - final top = max(mediaPadding.value.top, 640.wmax * 20.sr); + final top = max(mediaPadding.value.top, 20.vp); return Scaffold( body: Stack( @@ -39,8 +39,8 @@ class PageLangs extends GetView { elevation: 0.0, scrolledUnderElevation: 0.0, automaticallyImplyLeading: false, - collapsedHeight: max(640.wmax * 40.sr, mediaTopBar.value), - expandedHeight: 640.wmax * 152.sr, + collapsedHeight: max(40.vp, mediaTopBar.value), + expandedHeight: 152.vp, flexibleSpace: Obx(() { List? boxShadow; @@ -110,7 +110,7 @@ class PageLangs extends GetView { Widget buildBack(BuildContext context) { final mediaTopBar = controller.mediaTopBar.value; final mediaPadding = controller.mediaPadding.value; - final height = max(640.wmax * 40.sr, mediaTopBar); + final height = max(40.vp, mediaTopBar); return Positioned( top: 0, @@ -122,12 +122,12 @@ class PageLangs extends GetView { width: 680.wmax, height: height, margin: EdgeInsets.only( - top: max(mediaPadding.top, 640.wmax * 20.sr), - left: 640.wmax * 20.sr, + top: max(mediaPadding.top, 20.vp), + left: 20.vp, ), padding: EdgeInsets.only( - top: (height - 640.wmax * 36.sr) / 2, - bottom: (height - 640.wmax * 36.sr) / 2, + top: (height - 36.vp) / 2, + bottom: (height - 36.vp) / 2, ), child: Row( children: [ @@ -136,8 +136,8 @@ class PageLangs extends GetView { onTap: () => GetNavigate.back(), child: Image( image: const AssetImage('lib/assets/images/auth/back.png'), - width: 640.wmax * 36.sr, - height: 640.wmax * 36.sr, + width: 36.vp, + height: 36.vp, fit: BoxFit.fill, ), ), @@ -152,13 +152,13 @@ class PageLangs extends GetView { return Container( alignment: Alignment.center, constraints: const BoxConstraints.expand(), - padding: EdgeInsets.only(left: 640.wmax * 32.sr, right: 640.wmax * 32.sr), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), child: Text( 'Language'.tr, style: TextStyle( - fontSize: 640.wmax * 20.sr, - fontWeight: FontWeight.bold, color: const Color(0xff130138), + fontWeight: FontWeight.bold, + fontSize: 20.fp, letterSpacing: 3, height: 1, ), @@ -177,10 +177,10 @@ class PageLangs extends GetView { return Container( padding: EdgeInsets.only( - top: 640.wmax * 30.sr, - left: 640.wmax * 48.sr, - right: 640.wmax * 48.sr, - bottom: 640.wmax * 35.sr, + top: 30.vp, + left: 48.vp, + right: 48.vp, + bottom: 35.vp, ), child: Column( children: [ @@ -188,28 +188,25 @@ class PageLangs extends GetView { behavior: HitTestBehavior.opaque, child: Container( width: 640.wmax, - height: 640.wmax * 64.sr, + height: 64.vp, alignment: Alignment.center, decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), border: Border.all( color: isNull ? Color(0xff8438FF) : Colors.black26, - width: isNull ? 640.wmax * 1.4.sr : 640.wmax * 1.2.sr, + width: isNull ? 1.4.vp : 1.2.vp, ), ), - padding: EdgeInsets.symmetric( - horizontal: 640.wmax * 20.sr, - vertical: 640.wmax * 20.sr, - ), - margin: EdgeInsets.only(bottom: 640.wmax * 25.sr), + padding: EdgeInsets.symmetric(horizontal: 20.vp, vertical: 20.vp), + margin: EdgeInsets.only(bottom: 25.vp), child: Text( 'Follow System Language'.tr, textAlign: TextAlign.center, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: isNull ? FontWeight.w600 : FontWeight.w400, color: isNull ? Color(0xff8438FF) : Color(0xff808288), + fontWeight: isNull ? FontWeight.w600 : FontWeight.w400, + fontSize: 16.fp, height: 1.0, ), ), @@ -224,28 +221,25 @@ class PageLangs extends GetView { behavior: HitTestBehavior.opaque, child: Container( width: 640.wmax, - height: 640.wmax * 64.sr, + height: 64.vp, alignment: Alignment.center, decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), border: Border.all( color: isZhCn ? Color(0xff8438FF) : Colors.black26, - width: isZhCn ? 640.wmax * 1.4.sr : 640.wmax * 1.2.sr, + width: isZhCn ? 1.4.vp : 1.2.vp, ), ), - padding: EdgeInsets.symmetric( - horizontal: 640.wmax * 20.sr, - vertical: 640.wmax * 20.sr, - ), - margin: EdgeInsets.only(bottom: 640.wmax * 25.sr), + padding: EdgeInsets.symmetric(horizontal: 20.vp, vertical: 20.vp), + margin: EdgeInsets.only(bottom: 25.vp), child: Text( 'Chinese (zh-CN)'.tr, textAlign: TextAlign.center, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: isZhCn ? FontWeight.w600 : FontWeight.w400, color: isZhCn ? Color(0xff8438FF) : Color(0xff909399), + fontWeight: isZhCn ? FontWeight.w600 : FontWeight.w400, + fontSize: 16.fp, height: 1.0, ), ), @@ -260,28 +254,25 @@ class PageLangs extends GetView { behavior: HitTestBehavior.opaque, child: Container( width: 640.wmax, - height: 640.wmax * 64.sr, + height: 64.vp, alignment: Alignment.center, decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), border: Border.all( color: isEnUs ? Color(0xff8438FF) : Colors.black26, - width: isEnUs ? 640.wmax * 1.4.sr : 640.wmax * 1.2.sr, + width: isEnUs ? 1.4.vp : 1.2.vp, ), ), - padding: EdgeInsets.symmetric( - horizontal: 640.wmax * 20.sr, - vertical: 640.wmax * 20.sr, - ), - margin: EdgeInsets.only(bottom: 640.wmax * 25.sr), + padding: EdgeInsets.symmetric(horizontal: 20.vp, vertical: 20.vp), + margin: EdgeInsets.only(bottom: 25.vp), child: Text( 'English (en-US)'.tr, textAlign: TextAlign.center, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: isEnUs ? FontWeight.w600 : FontWeight.w400, color: isEnUs ? Color(0xff8438FF) : Color(0xff909399), + fontWeight: isEnUs ? FontWeight.w600 : FontWeight.w400, + fontSize: 16.fp, height: 1.0, ), ), @@ -301,9 +292,6 @@ class PageLangs extends GetView { final mediaPadding = controller.mediaPadding; final mediaBottom = mediaPadding.value.bottom; - return SizedBox( - width: 640.wmax, - height: max(mediaBottom, 640.wmax * 30.sr), - ); + return SizedBox(width: 640.wmax, height: max(mediaBottom, 30.vp)); } } diff --git a/lib/pages/logger/index.dart b/lib/pages/logger/index.dart index 19bb575..5b98748 100644 --- a/lib/pages/logger/index.dart +++ b/lib/pages/logger/index.dart @@ -18,8 +18,8 @@ class PageLogger extends GetView { final mediaTopBar = controller.mediaTopBar; final isShadow = controller.isShadow; - final height = max(640.wmax * 40.sr, mediaTopBar.value); - final offset = max(mediaPadding.value.top, 640.wmax * 20.sr); + final height = max(40.vp, mediaTopBar.value); + final offset = max(mediaPadding.value.top, 20.vp); return Scaffold( body: Stack( @@ -113,7 +113,7 @@ class PageLogger extends GetView { Widget buildBack(BuildContext context) { final mediaTopBar = controller.mediaTopBar.value; final mediaPadding = controller.mediaPadding.value; - final height = max(640.wmax * 40.sr, mediaTopBar); + final height = max(40.vp, mediaTopBar); return Positioned( top: 0, @@ -125,12 +125,12 @@ class PageLogger extends GetView { width: 680.wmax, height: height, margin: EdgeInsets.only( - top: max(mediaPadding.top, 640.wmax * 20.sr), - left: 640.wmax * 20.sr, + top: max(mediaPadding.top, 20.vp), + left: 20.vp, ), padding: EdgeInsets.only( - top: (height - 640.wmax * 36.sr) / 2, - bottom: (height - 640.wmax * 36.sr) / 2, + top: (height - 36.vp) / 2, + bottom: (height - 36.vp) / 2, ), child: Row( children: [ @@ -139,8 +139,8 @@ class PageLogger extends GetView { onTap: () => GetNavigate.back(), child: Image( image: const AssetImage('lib/assets/images/auth/back.png'), - width: 640.wmax * 36.sr, - height: 640.wmax * 36.sr, + width: 36.vp, + height: 36.vp, fit: BoxFit.fill, ), ), @@ -155,14 +155,14 @@ class PageLogger extends GetView { return Container( alignment: Alignment.center, constraints: const BoxConstraints.expand(), - padding: EdgeInsets.only(left: 640.wmax * 32.sr, right: 640.wmax * 32.sr), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), child: Text( 'Run Logger'.tr, style: TextStyle( - fontSize: 640.wmax * 20.sr, - fontWeight: FontWeight.bold, color: const Color(0xff130138), + fontWeight: FontWeight.bold, letterSpacing: 3, + fontSize: 20.fp, height: 1, ), ), @@ -175,8 +175,8 @@ class PageLogger extends GetView { final mediaTopBar = controller.mediaTopBar; final mediaTop = mediaPadding.value.top; - final header = max(640.wmax * 40.sr, mediaTopBar.value); - final offset = max(mediaTop, 640.wmax * 20.sr); + final header = max(40.vp, mediaTopBar.value); + final offset = max(mediaTop, 20.vp); final height = 100.vh - offset - header; return SizedBox( @@ -188,10 +188,10 @@ class PageLogger extends GetView { constrained: false, child: Container( padding: EdgeInsets.only( - top: 640.wmax * 5.sr, - left: 640.wmax * 5.sr, - right: 640.wmax * 5.sr, - bottom: 640.wmax * 20.sr, + top: 5.vp, + left: 5.vp, + right: 5.vp, + bottom: 20.vp, ), child: TextSelectionTheme( data: TextSelectionThemeData( @@ -201,9 +201,9 @@ class PageLogger extends GetView { child: SelectableText( controller.string.value, style: GoogleFonts.robotoMono( - fontWeight: FontWeight.w400, - fontSize: max(640.wmax * 11.sr, 11), color: Color(0xff303133), + fontWeight: FontWeight.w400, + fontSize: 11.fp, height: 1.4, ), ), @@ -237,10 +237,10 @@ class PageLogger extends GetView { child: Text( 'Loading logs, please wait...'.tr, style: TextStyle( - fontSize: 14, + color: Color(0xff707177), fontWeight: FontWeight.w600, letterSpacing: 1.5, - color: Color(0xff707177), + fontSize: 14.fp, ), ), ), diff --git a/lib/pages/login/index.dart b/lib/pages/login/index.dart index 5f1bcca..c0d8362 100644 --- a/lib/pages/login/index.dart +++ b/lib/pages/login/index.dart @@ -26,7 +26,7 @@ class PageLogin extends GetView { width: 640.wmax, height: 100.vh, child: ListView( - padding: EdgeInsets.only(bottom: 50.wdp), + padding: EdgeInsets.only(bottom: 50.vp), physics: const ClampingScrollPhysics(), children: [ buildMainTitle(context), @@ -70,11 +70,11 @@ class PageLogin extends GetView { padding: const EdgeInsets.fromLTRB(30, 20, 30, 80), child: Text( 'Requesting...'.tr, - style: const TextStyle( - fontSize: 16, + style: TextStyle( + color: Color(0xff707177), fontWeight: FontWeight.w600, letterSpacing: 1.5, - color: Color(0xff707177), + fontSize: 16.fp, ), ), ), @@ -92,10 +92,10 @@ class PageLogin extends GetView { return Container( alignment: Alignment.center, padding: EdgeInsets.only( - top: 640.wmax * 95.sr, - left: 640.wmax * 48.sr, - right: 640.wmax * 48.sr, - bottom: 640.wmax * 32.sr, + top: 95.vp, + left: 48.vp, + right: 48.vp, + bottom: 32.vp, ), child: Column( children: [ @@ -103,10 +103,10 @@ class PageLogin extends GetView { 'Welcome back'.tr, textAlign: TextAlign.center, style: TextStyle( - fontSize: 640.wmax * 24.sr, - fontFamily: 'PingFang', color: const Color(0xff2f1155), fontWeight: FontWeight.w700, + fontFamily: 'PingFang', + fontSize: 24.fp, height: 1.3, ), ), @@ -114,10 +114,10 @@ class PageLogin extends GetView { 'Digital Wallet'.tr, textAlign: TextAlign.center, style: TextStyle( - fontSize: 640.wmax * 24.sr, - fontFamily: 'PingFang', color: const Color(0xff2f1155), fontWeight: FontWeight.w700, + fontFamily: 'PingFang', + fontSize: 24.fp, height: 1.3, ), ), @@ -136,19 +136,19 @@ class PageLogin extends GetView { Container( alignment: Alignment.center, padding: EdgeInsets.only( - top: 640.wmax * 1.5.sr, - left: 640.wmax * 45.sr, - right: 640.wmax * 45.sr, - bottom: 640.wmax * 1.5.sr, + top: 1.5.vp, + left: 45.vp, + right: 45.vp, + bottom: 1.5.vp, ), child: Text( 'Sign in with'.tr, textAlign: TextAlign.center, style: TextStyle( - fontSize: 640.wmax * 14.sr, - fontFamily: 'PingFang', color: const Color(0xffbdbdbd), fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + fontSize: 14.fp, height: 1.2, ), ), @@ -156,26 +156,26 @@ class PageLogin extends GetView { Container( alignment: Alignment.center, padding: EdgeInsets.only( - top: 640.wmax * 22.sr, - left: 640.wmax * 28.sr, - right: 640.wmax * 28.sr, - bottom: 640.wmax * 38.sr, + top: 22.vp, + left: 28.vp, + right: 28.vp, + bottom: 38.vp, ), child: Wrap( - spacing: 640.wmax * 20.sr, - runSpacing: 640.wmax * 18.sr, + spacing: 20.vp, + runSpacing: 18.vp, children: [ GestureDetector( behavior: HitTestBehavior.opaque, child: IntrinsicWidth( child: Container( padding: EdgeInsets.symmetric( - vertical: 640.wmax * 18.sr, - horizontal: 640.wmax * 20.sr, + vertical: 18.vp, + horizontal: 20.vp, ), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), boxShadow: [ BoxShadow( color: Colors.black.withValues(alpha: 0.1), @@ -192,17 +192,17 @@ class PageLogin extends GetView { image: const AssetImage( 'lib/assets/images/auth/google.png', ), - width: 640.wmax * 24.sr, - height: 640.wmax * 24.sr, + width: 24.vp, + height: 24.vp, fit: BoxFit.fill, ), - SizedBox(width: 640.wmax * 7.sr), + SizedBox(width: 7.vp), Text( 'Google', style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w500, color: const Color(0xffbdbdbd), + fontWeight: FontWeight.w500, + fontSize: 16.fp, ), ), ], @@ -218,12 +218,12 @@ class PageLogin extends GetView { child: IntrinsicWidth( child: Container( padding: EdgeInsets.symmetric( - vertical: 640.wmax * 18.sr, - horizontal: 640.wmax * 20.sr, + vertical: 18.vp, + horizontal: 20.vp, ), decoration: BoxDecoration( color: const Color(0xff4368c7), - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), boxShadow: [ BoxShadow( color: Colors.black.withValues(alpha: 0.1), @@ -240,17 +240,17 @@ class PageLogin extends GetView { image: const AssetImage( 'lib/assets/images/auth/github.png', ), - width: 640.wmax * 24.sr, - height: 640.wmax * 24.sr, + width: 24.vp, + height: 24.vp, fit: BoxFit.fill, ), - SizedBox(width: 640.wmax * 9.sr), + SizedBox(width: 9.vp), Text( 'Github', style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w500, color: Colors.white, + fontWeight: FontWeight.w500, + fontSize: 16.fp, ), ), ], @@ -279,13 +279,13 @@ class PageLogin extends GetView { return Column( children: [ Container( - width: 640.wmax * 310.sr, - height: 640.wmax * 54.sr, + width: 310.vp, + height: 54.vp, alignment: Alignment.center, - margin: EdgeInsets.only(bottom: 640.wmax * 18.sr), + margin: EdgeInsets.only(bottom: 18.vp), decoration: BoxDecoration( color: const Color(0xfff2f2f2), - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), border: Border.all( width: 1, color: emailError.value @@ -296,20 +296,20 @@ class PageLogin extends GetView { child: TextField( focusNode: emailFocusNode, controller: emailController, - cursorWidth: 640.wmax * 1.8.sr, - cursorHeight: 640.wmax * 18.sr, + cursorWidth: 1.8.vp, + cursorHeight: 18.vp, keyboardType: TextInputType.text, textAlignVertical: TextAlignVertical.center, decoration: InputDecoration( filled: true, hintText: 'Email'.tr, prefixIcon: Container( - width: 640.wmax * 64.sr, + width: 64.vp, alignment: Alignment.center, child: Image( image: const AssetImage('lib/assets/images/auth/email.png'), - width: 640.wmax * 24.sr, - height: 640.wmax * 24.sr, + width: 24.vp, + height: 24.vp, fit: BoxFit.fill, ), ), @@ -318,19 +318,19 @@ class PageLogin extends GetView { enabledBorder: InputBorder.none, fillColor: Colors.transparent, hintStyle: TextStyle( - letterSpacing: 1.5, - fontSize: 640.wmax * 16.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w500, color: const Color(0xff909399), + fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + letterSpacing: 1.5, + fontSize: 16.fp, ), ), style: TextStyle( - letterSpacing: 1.5, - fontSize: 640.wmax * 16.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w500, color: const Color(0xff606266), + fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + letterSpacing: 1.5, + fontSize: 16.fp, ), onChanged: (v) { emailError.value = false; @@ -341,13 +341,13 @@ class PageLogin extends GetView { ), ), Container( - width: 640.wmax * 310.sr, - height: 640.wmax * 54.sr, + width: 310.vp, + height: 54.vp, alignment: Alignment.center, - margin: EdgeInsets.only(bottom: 640.wmax * 18.sr), + margin: EdgeInsets.only(bottom: 18.vp), decoration: BoxDecoration( color: const Color(0xfff2f2f2), - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), border: Border.all( width: 1, color: passwordError.value @@ -359,22 +359,22 @@ class PageLogin extends GetView { obscureText: true, focusNode: passwordFocusNode, controller: passwordController, - cursorWidth: 640.wmax * 1.8.sr, - cursorHeight: 640.wmax * 18.sr, + cursorWidth: 1.8.vp, + cursorHeight: 18.vp, keyboardType: TextInputType.text, textAlignVertical: TextAlignVertical.center, decoration: InputDecoration( filled: true, hintText: 'Password'.tr, prefixIcon: Container( - width: 640.wmax * 64.sr, + width: 64.vp, alignment: Alignment.center, child: Image( image: const AssetImage( 'lib/assets/images/auth/password.png', ), - width: 640.wmax * 24.sr, - height: 640.wmax * 24.sr, + width: 24.vp, + height: 24.vp, fit: BoxFit.fill, ), ), @@ -383,19 +383,19 @@ class PageLogin extends GetView { enabledBorder: InputBorder.none, fillColor: Colors.transparent, hintStyle: TextStyle( - letterSpacing: 1.5, - fontSize: 640.wmax * 16.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w500, color: const Color(0xff909399), + fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + letterSpacing: 1.5, + fontSize: 16.fp, ), ), style: TextStyle( - letterSpacing: 1.5, - fontSize: 640.wmax * 16.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w500, color: const Color(0xff606266), + fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + letterSpacing: 1.5, + fontSize: 16.fp, ), onChanged: (v) { passwordError.value = false; @@ -413,29 +413,29 @@ class PageLogin extends GetView { return Container( width: 100.vw, - height: 640.wmax * 100.sr, + height: 100.vp, alignment: Alignment.center, - margin: EdgeInsets.only(top: 640.wmax * 36.sr), + margin: EdgeInsets.only(top: 36.vp), child: Column( children: [ GestureDetector( behavior: HitTestBehavior.opaque, child: Container( - width: 640.wmax * 200.sr, - height: 640.wmax * 64.sr, + width: 200.vp, + height: 64.vp, alignment: Alignment.center, decoration: BoxDecoration( color: const Color(0xff5b259f), - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), ), child: Text( 'Login'.tr, style: TextStyle( - letterSpacing: 1.2, color: Colors.white, - fontSize: 640.wmax * 18.sr, fontWeight: FontWeight.bold, fontFamily: 'PingFang', + letterSpacing: 1.2, + fontSize: 18.fp, ), ), ), @@ -443,24 +443,24 @@ class PageLogin extends GetView { loginTimeout(signInWithAccount(), Duration(seconds: 5)); }, ), - SizedBox(height: 640.wmax * 12.sr), + SizedBox(height: 12.vp), RichText( text: TextSpan( children: [ TextSpan( text: "Don't have an account yet?".tr, style: TextStyle( - fontSize: 640.wmax * 14.sr, - fontWeight: FontWeight.w500, color: const Color(0xffbdbdbd), + fontWeight: FontWeight.w500, + fontSize: 14.fp, ), ), TextSpan( text: 'Register'.tr, style: TextStyle( - fontSize: 640.wmax * 14.sr, - fontWeight: FontWeight.w600, color: const Color(0xff81c2ff), + fontWeight: FontWeight.w600, + fontSize: 14.fp, ), recognizer: TapGestureRecognizer() ..onTap = () => GetNavigate.toNamed(GetRoutes.register), @@ -481,7 +481,7 @@ class PageLogin extends GetView { radius: 180.0, containedInkWell: true, highlightShape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(640.wmax * 30.0.sr)), + borderRadius: BorderRadius.all(Radius.circular(30.0.vp)), highlightColor: const Color(0xff5b259f).withValues(alpha: 0.08), splashColor: const Color(0xff5b259f).withValues(alpha: 0.08), focusColor: Colors.transparent, @@ -494,20 +494,20 @@ class PageLogin extends GetView { return Container( width: 100.vw, - height: 640.wmax * 40.sr + controller.mediaPadding.value.bottom, - margin: EdgeInsets.only(top: 640.wmax * 21.sr), + height: 40.vp + controller.mediaPadding.value.bottom, + margin: EdgeInsets.only(top: 21.vp), alignment: Alignment.center, child: withInWell( child: Container( - width: 640.wmax * 160.sr, - height: 640.wmax * 40.sr, + width: 160.vp, + height: 40.vp, alignment: Alignment.center, child: Text( 'Guest Mode'.tr, style: TextStyle( - fontSize: 640.wmax * 14.sr, - fontWeight: FontWeight.w500, color: const Color(0xff909399), + fontWeight: FontWeight.w500, + fontSize: 14.fp, ), ), ), diff --git a/lib/pages/notification/controller.dart b/lib/pages/notification/controller.dart index 920417b..5279905 100644 --- a/lib/pages/notification/controller.dart +++ b/lib/pages/notification/controller.dart @@ -30,8 +30,8 @@ class PageNotificationController extends GetxController with RxWatcher { rw.ever(refMessages.list, (_) => transformer()); scrollController.addListener(() { - final expanded = 640.wmax * 152.sr; - final collapsed = max(640.wmax * 40.sr, mediaTopBar.value); + final expanded = 152.vp; + final collapsed = max(40.vp, mediaTopBar.value); isShadow.value = scrollController.position.pixels >= expanded - collapsed; }); diff --git a/lib/pages/notification/index.dart b/lib/pages/notification/index.dart index ccfaabf..f640c70 100644 --- a/lib/pages/notification/index.dart +++ b/lib/pages/notification/index.dart @@ -21,7 +21,7 @@ class PageNotification extends GetView { final mediaTopBar = controller.mediaTopBar; final isShadow = controller.isShadow; - final top = max(mediaPadding.value.top, 640.wmax * 20.sr); + final top = max(mediaPadding.value.top, 20.vp); return Scaffold( body: Stack( @@ -41,8 +41,8 @@ class PageNotification extends GetView { elevation: 0.0, scrolledUnderElevation: 0.0, automaticallyImplyLeading: false, - collapsedHeight: max(640.wmax * 40.sr, mediaTopBar.value), - expandedHeight: 640.wmax * 152.sr, + collapsedHeight: max(40.vp, mediaTopBar.value), + expandedHeight: 152.vp, flexibleSpace: Obx(() { List? boxShadow; @@ -112,7 +112,7 @@ class PageNotification extends GetView { Widget buildBack(BuildContext context) { final mediaTopBar = controller.mediaTopBar.value; final mediaPadding = controller.mediaPadding.value; - final height = max(640.wmax * 40.sr, mediaTopBar); + final height = max(40.vp, mediaTopBar); return Positioned( top: 0, @@ -124,12 +124,12 @@ class PageNotification extends GetView { width: 680.wmax, height: height, margin: EdgeInsets.only( - top: max(mediaPadding.top, 640.wmax * 20.sr), - left: 640.wmax * 20.sr, + top: max(mediaPadding.top, 20.vp), + left: 20.vp, ), padding: EdgeInsets.only( - top: (height - 640.wmax * 36.sr) / 2, - bottom: (height - 640.wmax * 36.sr) / 2, + top: (height - 36.vp) / 2, + bottom: (height - 36.vp) / 2, ), child: Row( children: [ @@ -138,8 +138,8 @@ class PageNotification extends GetView { onTap: () => GetNavigate.back(), child: Image( image: const AssetImage('lib/assets/images/auth/back.png'), - width: 640.wmax * 36.sr, - height: 640.wmax * 36.sr, + width: 36.vp, + height: 36.vp, fit: BoxFit.fill, ), ), @@ -154,14 +154,14 @@ class PageNotification extends GetView { return Container( alignment: Alignment.center, constraints: const BoxConstraints.expand(), - padding: EdgeInsets.only(left: 640.wmax * 32.sr, right: 640.wmax * 32.sr), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), child: Text( 'Notification'.tr, style: TextStyle( - fontSize: 640.wmax * 20.sr, - fontWeight: FontWeight.bold, color: const Color(0xff130138), + fontWeight: FontWeight.bold, letterSpacing: 3, + fontSize: 20.fp, height: 1, ), ), @@ -176,28 +176,28 @@ class PageNotification extends GetView { return GestureDetector( behavior: HitTestBehavior.opaque, child: Container( - width: 640.wmax * 312.sr, - margin: EdgeInsets.only(bottom: 640.wmax * 10.sr), + width: 312.vp, + margin: EdgeInsets.only(bottom: 10.vp), child: Stack( fit: StackFit.loose, children: [ Padding( - padding: EdgeInsets.all(640.wmax * 1.sr), + padding: EdgeInsets.all(1.vp), child: Container( - width: 640.wmax * 310.sr, + width: 310.vp, padding: EdgeInsets.only( - top: 640.wmax * 10.sr, - left: 640.wmax * 28.sr, - right: 640.wmax * 20.sr, - bottom: 640.wmax * 10.sr, + top: 10.vp, + left: 28.vp, + right: 20.vp, + bottom: 10.vp, ), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(640.wmax * 17.sr), + borderRadius: BorderRadius.circular(17.vp), boxShadow: [ BoxShadow( color: const Color(0xff000000).withValues(alpha: .058), - offset: Offset(640.wmax * 3.sr, 640.wmax * 3.sr), + offset: Offset(3.vp, 3.vp), spreadRadius: 0, blurRadius: 20, ), @@ -209,20 +209,20 @@ class PageNotification extends GetView { crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( - width: 640.wmax * 220.sr, + width: 220.vp, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( alignment: Alignment.centerLeft, - height: 640.wmax * 21.sr, + height: 21.vp, child: Text( '${message.date.yMMMd()} ${message.date.jm()}', style: TextStyle( - fontSize: 640.wmax * 12.4.sr, - fontWeight: FontWeight.w500, color: const Color(0xffafafaf), + fontWeight: FontWeight.w500, + fontSize: 12.4.fp, ), ), ), @@ -231,9 +231,9 @@ class PageNotification extends GetView { child: Text( message.desc.tr, style: TextStyle( - fontSize: 640.wmax * 15.sr, - fontWeight: FontWeight.w600, color: const Color(0xff363853), + fontWeight: FontWeight.w600, + fontSize: 15.fp, height: 1.4, ), overflow: TextOverflow.ellipsis, @@ -242,13 +242,13 @@ class PageNotification extends GetView { ), Container( alignment: Alignment.centerLeft, - height: 640.wmax * 21.sr, + height: 21.vp, child: Text( message.money.usd, style: TextStyle( - fontSize: 640.wmax * 12.4.sr, - fontWeight: FontWeight.w600, color: const Color(0xff606266), + fontWeight: FontWeight.w600, + fontSize: 12.4.fp, ), ), ), @@ -259,8 +259,8 @@ class PageNotification extends GetView { message.money > 0.0 ? 'lib/assets/images/notification/income.png' : 'lib/assets/images/notification/expenditure.png', - height: 640.wmax * 20.sr, - width: 640.wmax * 20.sr, + height: 20.vp, + width: 20.vp, fit: BoxFit.fill, ), ], @@ -269,14 +269,14 @@ class PageNotification extends GetView { ), Positioned( top: 0, - right: 640.wmax * 9.sr, + right: 9.vp, child: Offstage( offstage: message.isRead != 'N', child: Container( - width: 640.wmax * 7.sr, - height: 640.wmax * 7.sr, + width: 7.vp, + height: 7.vp, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(640.wmax * 3.5.sr), + borderRadius: BorderRadius.circular(3.5.vp), color: const Color(0xffff3333), ), ), @@ -303,29 +303,29 @@ class PageNotification extends GetView { } return Container( - width: 640.wmax * 312.sr, - margin: EdgeInsets.only(bottom: 640.wmax * 20.sr), - padding: EdgeInsets.only(bottom: 640.wmax * 1.sr), + width: 312.vp, + margin: EdgeInsets.only(bottom: 20.vp), + padding: EdgeInsets.only(bottom: 1.vp), child: Column( children: [ Container( - width: 640.wmax * 312.sr, - height: 640.wmax * 20.sr, + width: 312.vp, + height: 20.vp, alignment: Alignment.center, child: Text( msgYear.tr, style: TextStyle( - fontSize: 640.wmax * 14.8.sr, - fontWeight: FontWeight.w600, color: const Color(0xff363853), letterSpacing: group.year == nowYear ? 3 : 1, + fontWeight: FontWeight.w600, + fontSize: 14.8.fp, height: 1, ), ), ), - SizedBox(width: 640.wmax * 312.sr, height: 640.wmax * 15.sr), + SizedBox(width: 312.vp, height: 15.vp), SizedBox( - width: 640.wmax * 312.sr, + width: 312.vp, child: Column( children: [ ...messages.map((msg) { @@ -342,7 +342,7 @@ class PageNotification extends GetView { return Container( color: Colors.white, alignment: Alignment.center, - padding: EdgeInsets.only(left: 640.wmax * 32.sr, right: 640.wmax * 32.sr), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), child: Column( children: [ ...msgGroups.value.map((group) { @@ -357,9 +357,6 @@ class PageNotification extends GetView { final mediaPadding = controller.mediaPadding; final mediaBottom = mediaPadding.value.bottom; - return SizedBox( - width: 640.wmax, - height: max(mediaBottom - 640.wmax * 20.sr, 640.wmax * 10.sr), - ); + return SizedBox(width: 640.wmax, height: max(mediaBottom - 20.vp, 10.vp)); } } diff --git a/lib/pages/operater/controller.dart b/lib/pages/operater/controller.dart index 8adadaf..8fa7c4f 100644 --- a/lib/pages/operater/controller.dart +++ b/lib/pages/operater/controller.dart @@ -1,6 +1,6 @@ import 'package:get/get.dart'; import 'package:intl/intl.dart'; -import 'package:flutter_ringtone_player/flutter_ringtone_player.dart'; +import 'package:audioplayers/audioplayers.dart'; import 'package:dompet/configure/fluttertoast.dart'; import 'package:dompet/routes/navigator.dart'; import 'package:dompet/extension/money.dart'; @@ -18,6 +18,7 @@ class PageOperaterController extends GetxController { late final mediaTopBar = mediaQueryController.topBar; late final loginUser = storeController.user; + late AudioPlayer audioPlayer = AudioPlayer(); late String type = Get.arguments ?? ''; late Rx> options; late Rx operate; @@ -27,6 +28,7 @@ class PageOperaterController extends GetxController { onInit() { init(0.0); super.onInit(); + audioPlayer.audioCache = AudioCache(prefix: 'lib/assets/'); } void init(double num) { @@ -173,7 +175,12 @@ class PageOperaterController extends GetxController { ), ]); - await FlutterRingtonePlayer().playNotification(); + try { + final source = AssetSource('medias/pay.wav'); + await audioPlayer.play(source, volume: 0.5); + } catch (e) { + /* e */ + } Future.delayed(Duration(seconds: 3), () => money.value = 0.0); @@ -205,7 +212,12 @@ class PageOperaterController extends GetxController { ), ]); - await FlutterRingtonePlayer().playNotification(); + try { + final source = AssetSource('medias/pay.wav'); + await audioPlayer.play(source, volume: 0.5); + } catch (e) { + /* e */ + } Future.delayed(Duration(seconds: 3), () => money.value = 0.0); @@ -237,7 +249,12 @@ class PageOperaterController extends GetxController { ), ]); - await FlutterRingtonePlayer().playNotification(); + try { + final source = AssetSource('medias/pay.wav'); + await audioPlayer.play(source, volume: 0.5); + } catch (e) { + /* e */ + } Future.delayed(Duration(seconds: 3), () => money.value = 0.0); @@ -271,7 +288,12 @@ class PageOperaterController extends GetxController { ), ]); - await FlutterRingtonePlayer().playNotification(); + try { + final source = AssetSource('medias/pay.wav'); + await audioPlayer.play(source, volume: 0.5); + } catch (e) { + /* e */ + } Future.delayed(Duration(seconds: 3), () => money.value = 0.0); diff --git a/lib/pages/operater/index.dart b/lib/pages/operater/index.dart index 2deb864..1f8e31e 100644 --- a/lib/pages/operater/index.dart +++ b/lib/pages/operater/index.dart @@ -48,7 +48,7 @@ class PageOperater extends GetView { Widget buildBack(BuildContext context) { final mediaTopBar = controller.mediaTopBar.value; final mediaPadding = controller.mediaPadding.value; - final height = max(640.wmax * 40.sr, mediaTopBar); + final height = max(40.vp, mediaTopBar); return Positioned( top: 0, @@ -60,12 +60,12 @@ class PageOperater extends GetView { width: 680.wmax, height: height, margin: EdgeInsets.only( - top: max(mediaPadding.top, 640.wmax * 20.sr), - left: 640.wmax * 20.sr, + top: max(mediaPadding.top, 20.vp), + left: 20.vp, ), padding: EdgeInsets.only( - top: (height - 640.wmax * 36.sr) / 2, - bottom: (height - 640.wmax * 36.sr) / 2, + top: (height - 36.vp) / 2, + bottom: (height - 36.vp) / 2, ), child: Row( children: [ @@ -74,8 +74,8 @@ class PageOperater extends GetView { onTap: () => GetNavigate.back(), child: Image( image: const AssetImage('lib/assets/images/auth/back.png'), - width: 640.wmax * 36.sr, - height: 640.wmax * 36.sr, + width: 36.vp, + height: 36.vp, fit: BoxFit.fill, ), ), @@ -91,20 +91,14 @@ class PageOperater extends GetView { () => Container( color: Colors.white, alignment: Alignment.center, - margin: EdgeInsets.only( - top: 640.wmax * 130.sr, - bottom: 640.wmax * 44.sr, - ), - padding: EdgeInsets.only( - left: 640.wmax * 32.sr, - right: 640.wmax * 32.sr, - ), + margin: EdgeInsets.only(top: 130.vp, bottom: 44.vp), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), child: Text( controller.money.value.USD, style: TextStyle( - fontSize: 640.wmax * 32.sr, - fontWeight: FontWeight.bold, color: const Color(0xff2f1155), + fontWeight: FontWeight.bold, + fontSize: 32.fp, height: 1, ), ), @@ -142,8 +136,8 @@ class PageOperater extends GetView { return ClipOval( child: Image.memory( loginUser.avatar.value!, - width: 640.wmax * 20.sr, - height: 640.wmax * 20.sr, + width: 20.vp, + height: 20.vp, fit: BoxFit.fill, ), ); @@ -157,8 +151,8 @@ class PageOperater extends GetView { return ClipOval( child: Image.asset( 'lib/assets/images/payer/$icon.png', - width: 640.wmax * 20.sr, - height: 640.wmax * 20.sr, + width: 20.vp, + height: 20.vp, fit: BoxFit.fill, ), ); @@ -170,26 +164,26 @@ class PageOperater extends GetView { value: opt.id, padding: EdgeInsets.zero, child: Container( - width: 640.wmax * 375.sr, - height: 640.wmax * 48.sr, + width: 375.vp, + height: 48.vp, padding: EdgeInsets.only( - top: 640.wmax * 12.sr, - left: 640.wmax * 30.sr, - right: 640.wmax * 24.sr, - bottom: 640.wmax * 12.sr, + top: 12.vp, + left: 30.vp, + right: 24.vp, + bottom: 12.vp, ), child: Row( children: [ Padding( - padding: EdgeInsets.only(right: 640.wmax * 4.sr), + padding: EdgeInsets.only(right: 4.vp), child: iconAvatar(isTopup ? opt.from : opt.to), ), Text( isTopup ? opt.from.tr : opt.to.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff363853), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), Offstage( @@ -198,27 +192,24 @@ class PageOperater extends GetView { mainAxisSize: MainAxisSize.min, children: [ Padding( - padding: EdgeInsets.only( - left: 640.wmax * 15.sr, - right: 640.wmax * 15.sr, - ), + padding: EdgeInsets.only(left: 15.vp, right: 15.vp), child: Image.asset( 'lib/assets/images/operater/left.png', - height: 640.wmax * 26.sr, - width: 640.wmax * 24.sr, + height: 26.vp, + width: 24.vp, fit: BoxFit.fill, ), ), Padding( - padding: EdgeInsets.only(right: 640.wmax * 4.sr), + padding: EdgeInsets.only(right: 4.vp), child: iconAvatar(opt.from.toLowerCase()), ), Text( opt.from.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff363853), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ], @@ -237,11 +228,8 @@ class PageOperater extends GetView { Container( color: Colors.white, alignment: Alignment.center, - padding: EdgeInsets.only( - left: 640.wmax * 32.sr, - right: 640.wmax * 32.sr, - ), - margin: EdgeInsets.only(bottom: 640.wmax * 42.sr), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), + margin: EdgeInsets.only(bottom: 42.vp), child: PopupMenuButton( elevation: 2.5, color: Colors.white, @@ -250,28 +238,25 @@ class PageOperater extends GetView { clipBehavior: Clip.antiAlias, position: PopupMenuPosition.under, shadowColor: Color(0x88000000), - constraints: BoxConstraints( - minWidth: 640.wmax * 311.sr, - maxWidth: 640.wmax * 311.sr, - ), + constraints: BoxConstraints(minWidth: 311.vp, maxWidth: 311.vp), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(640.wmax * 20.sr), + borderRadius: BorderRadius.circular(20.vp), ), - offset: Offset(0, 640.wmax * 3.sr), + offset: Offset(0, 3.vp), onSelected: (id) => controller.find(id), itemBuilder: (BuildContext context) => itemBuilder(), child: Container( - height: 640.wmax * 66.sr, + height: 66.vp, alignment: Alignment.center, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(640.wmax * 20.sr), + borderRadius: BorderRadius.circular(20.vp), color: Color(0xfff2f2f2), ), padding: EdgeInsets.only( - top: 640.wmax * 20.sr, - left: 640.wmax * 30.sr, - right: 640.wmax * 24.sr, - bottom: 640.wmax * 20.sr, + top: 20.vp, + left: 30.vp, + right: 24.vp, + bottom: 20.vp, ), child: Row( children: [ @@ -280,15 +265,15 @@ class PageOperater extends GetView { mainAxisSize: MainAxisSize.min, children: [ Padding( - padding: EdgeInsets.only(right: 640.wmax * 4.sr), + padding: EdgeInsets.only(right: 4.vp), child: iconAvatar(isTopup ? from : to), ), Text( isTopup ? from.tr : to.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff363853), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), Offstage( @@ -298,28 +283,26 @@ class PageOperater extends GetView { children: [ Padding( padding: EdgeInsets.only( - left: 640.wmax * 15.sr, - right: 640.wmax * 15.sr, + left: 15.vp, + right: 15.vp, ), child: Image.asset( 'lib/assets/images/operater/left.png', - height: 640.wmax * 26.sr, - width: 640.wmax * 24.sr, + height: 26.vp, + width: 24.vp, fit: BoxFit.fill, ), ), Padding( - padding: EdgeInsets.only( - right: 640.wmax * 4.sr, - ), + padding: EdgeInsets.only(right: 4.vp), child: iconAvatar(from.toLowerCase()), ), Text( from.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff363853), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ], @@ -329,14 +312,11 @@ class PageOperater extends GetView { ), ), Padding( - padding: EdgeInsets.only( - left: 640.wmax * 15.sr, - right: 640.wmax * 6.sr, - ), + padding: EdgeInsets.only(left: 15.vp, right: 6.vp), child: Image.asset( 'lib/assets/images/operater/down.png', - height: 640.wmax * 24.sr, - width: 640.wmax * 24.sr, + height: 24.vp, + width: 24.vp, ), ), ], @@ -360,9 +340,9 @@ class PageOperater extends GetView { child = Text( text, style: TextStyle( - fontSize: 640.wmax * 24.sr, - fontWeight: FontWeight.w500, color: Color(0xff363853), + fontWeight: FontWeight.w500, + fontSize: 24.fp, height: 1.0, ), ); @@ -371,8 +351,8 @@ class PageOperater extends GetView { if (text == 'Delete') { child = Image.asset( 'lib/assets/images/operater/delete.png', - height: 640.wmax * 27.sr, - width: 640.wmax * 25.sr, + height: 27.vp, + width: 25.vp, fit: BoxFit.fill, ); } @@ -380,8 +360,8 @@ class PageOperater extends GetView { if (text == 'Clear') { child = Image.asset( 'lib/assets/images/operater/clear.png', - height: 640.wmax * 24.sr, - width: 640.wmax * 24.sr, + height: 24.vp, + width: 24.vp, fit: BoxFit.fill, ); } @@ -392,14 +372,14 @@ class PageOperater extends GetView { radius: 100.0, containedInkWell: true, highlightShape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(640.wmax * 20.0.sr)), + borderRadius: BorderRadius.all(Radius.circular(20.0.vp)), highlightColor: const Color(0xfff0f0f0).withValues(alpha: 1), splashColor: const Color(0xfff0f0f0).withValues(alpha: 1), focusColor: Colors.transparent, hoverColor: Colors.transparent, child: Container( - width: 640.wmax * 60.sr, - height: 640.wmax * 60.sr, + width: 60.vp, + height: 60.vp, alignment: Alignment.center, child: child, ), @@ -423,15 +403,15 @@ class PageOperater extends GetView { return Container( color: Colors.white, alignment: Alignment.center, - padding: EdgeInsets.only(left: 640.wmax * 32.sr, right: 640.wmax * 32.sr), - margin: EdgeInsets.only(bottom: 640.wmax * 68.sr), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), + margin: EdgeInsets.only(bottom: 68.vp), child: SizedBox( - width: 640.wmax * 250.sr, + width: 250.vp, child: Column( children: [ Container( - width: 640.wmax * 250.sr, - margin: EdgeInsets.only(bottom: 640.wmax * 20.sr), + width: 250.vp, + margin: EdgeInsets.only(bottom: 20.vp), child: Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -439,8 +419,8 @@ class PageOperater extends GetView { ), ), Container( - width: 640.wmax * 250.sr, - margin: EdgeInsets.only(bottom: 640.wmax * 20.sr), + width: 250.vp, + margin: EdgeInsets.only(bottom: 20.vp), child: Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -448,8 +428,8 @@ class PageOperater extends GetView { ), ), Container( - width: 640.wmax * 250.sr, - margin: EdgeInsets.only(bottom: 640.wmax * 30.sr), + width: 250.vp, + margin: EdgeInsets.only(bottom: 30.vp), child: Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -457,7 +437,7 @@ class PageOperater extends GetView { ), ), Container( - width: 640.wmax * 250.sr, + width: 250.vp, margin: EdgeInsets.only(bottom: 0), child: Row( mainAxisSize: MainAxisSize.min, @@ -477,11 +457,11 @@ class PageOperater extends GetView { Widget buildConfirmBtn(BuildContext context) { final mediaPadding = controller.mediaPadding.value; - final mediaBottom = max(mediaPadding.bottom, 640.wmax * 30.sr); + final mediaBottom = max(mediaPadding.bottom, 30.vp); return Container( alignment: Alignment.center, - padding: EdgeInsets.only(left: 640.wmax * 32.sr, right: 640.wmax * 32.sr), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), margin: EdgeInsets.only(bottom: mediaBottom), child: Material( color: Colors.transparent, @@ -489,25 +469,25 @@ class PageOperater extends GetView { radius: 100.0, containedInkWell: true, highlightShape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(640.wmax * 20.0.sr)), + borderRadius: BorderRadius.all(Radius.circular(20.0.vp)), highlightColor: const Color(0xff5b259f).withValues(alpha: 1), splashColor: const Color(0xff5b259f).withValues(alpha: 1), focusColor: Colors.transparent, hoverColor: Colors.transparent, child: Container( - width: 640.wmax * 195.sr, - height: 640.wmax * 65.sr, + width: 195.vp, + height: 65.vp, alignment: Alignment.center, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), color: Color(0xff5b259f).withValues(alpha: 0.85), ), child: Text( controller.type.tr, style: TextStyle( - fontSize: 640.wmax * 20.sr, - fontWeight: FontWeight.w600, color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 20.fp, ), ), ), diff --git a/lib/pages/profile/index.dart b/lib/pages/profile/index.dart index 2c8473f..df3c189 100644 --- a/lib/pages/profile/index.dart +++ b/lib/pages/profile/index.dart @@ -47,7 +47,7 @@ class PageProfile extends GetView { Widget buildBack(BuildContext context) { final mediaTopBar = controller.mediaTopBar.value; final mediaPadding = controller.mediaPadding.value; - final height = max(640.wmax * 40.sr, mediaTopBar); + final height = max(40.vp, mediaTopBar); return Positioned( top: 0, @@ -59,12 +59,12 @@ class PageProfile extends GetView { width: 680.wmax, height: height, margin: EdgeInsets.only( - top: max(mediaPadding.top, 640.wmax * 20.sr), - left: 640.wmax * 20.sr, + top: max(mediaPadding.top, 20.vp), + left: 20.vp, ), padding: EdgeInsets.only( - top: (height - 640.wmax * 36.sr) / 2, - bottom: (height - 640.wmax * 36.sr) / 2, + top: (height - 36.vp) / 2, + bottom: (height - 36.vp) / 2, ), child: Row( children: [ @@ -73,8 +73,8 @@ class PageProfile extends GetView { onTap: () => GetNavigate.back(), child: Image( image: const AssetImage('lib/assets/images/auth/back.png'), - width: 640.wmax * 36.sr, - height: 640.wmax * 36.sr, + width: 36.vp, + height: 36.vp, fit: BoxFit.fill, ), ), @@ -92,8 +92,8 @@ class PageProfile extends GetView { if (controller.avatar.value.bv) { return Image.memory( controller.avatar.value!, - width: 640.wmax * 96.sr, - height: 640.wmax * 96.sr, + width: 96.vp, + height: 96.vp, fit: BoxFit.fill, ); } @@ -101,16 +101,16 @@ class PageProfile extends GetView { if (userAvatar.value.bv) { return Image.memory( userAvatar.value!, - width: 640.wmax * 96.sr, - height: 640.wmax * 96.sr, + width: 96.vp, + height: 96.vp, fit: BoxFit.fill, ); } return Image.asset( 'lib/assets/images/home/avatar.png', - width: 640.wmax * 96.sr, - height: 640.wmax * 96.sr, + width: 96.vp, + height: 96.vp, fit: BoxFit.fill, ); } @@ -124,23 +124,21 @@ class PageProfile extends GetView { return Container( color: Colors.white, alignment: Alignment.center, - padding: EdgeInsets.only(left: 640.wmax * 30.sr, right: 640.wmax * 30.sr), - margin: EdgeInsets.only(top: 640.wmax * 110.sr, bottom: 640.wmax * 18.sr), + padding: EdgeInsets.only(left: 30.vp, right: 30.vp), + margin: EdgeInsets.only(top: 110.vp, bottom: 18.vp), child: Column( children: [ Padding( - padding: EdgeInsets.only(bottom: 640.wmax * 10.sr), + padding: EdgeInsets.only(bottom: 10.vp), child: ClipOval( child: GestureDetector( behavior: HitTestBehavior.opaque, onTap: () => controller.pickAvatar(), child: Container( - width: 640.wmax * 96.sr, - height: 640.wmax * 96.sr, + width: 96.vp, + height: 96.vp, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(640.wmax * 48.sr), - ), + borderRadius: BorderRadius.all(Radius.circular(48.vp)), color: Color(0xffeae9e5).withValues(alpha: 0.85), ), child: Stack( @@ -151,18 +149,18 @@ class PageProfile extends GetView { left: 0, bottom: 0, child: Container( - width: 640.wmax * 96.sr, - height: 640.wmax * 24.sr, + width: 96.vp, + height: 24.vp, alignment: Alignment.center, - padding: EdgeInsets.only(bottom: 640.wmax * 3.sr), + padding: EdgeInsets.only(bottom: 3.vp), color: Color(0xff2f1155).withValues(alpha: 0.75), child: Text( 'change'.tr, style: TextStyle( - fontSize: 640.wmax * 12.sr, - fontWeight: FontWeight.w500, color: Colors.white, + fontWeight: FontWeight.w500, letterSpacing: 1.0, + fontSize: 12.fp, height: 1, ), ), @@ -176,14 +174,14 @@ class PageProfile extends GetView { ), Container( alignment: Alignment.center, - padding: EdgeInsets.only(bottom: 640.wmax * 30.sr), + padding: EdgeInsets.only(bottom: 30.vp), child: IntrinsicWidth( child: TextField( readOnly: readonly.value, focusNode: nameFocusNode, controller: nameController, - cursorWidth: 640.wmax * 1.8.sr, - cursorHeight: 640.wmax * 18.sr, + cursorWidth: 1.8.vp, + cursorHeight: 18.vp, keyboardType: TextInputType.text, textAlignVertical: TextAlignVertical.center, decoration: InputDecoration( @@ -196,61 +194,58 @@ class PageProfile extends GetView { behavior: HitTestBehavior.opaque, onTap: () => controller.changeName(), child: Container( - width: 640.wmax * 42.sr, - height: 640.wmax * 42.sr, + width: 42.vp, + height: 42.vp, alignment: Alignment.center, child: Image.asset( 'lib/assets/images/profile/edit.png'.tr, - height: 640.wmax * 22.sr, - width: 640.wmax * 22.sr, + height: 22.vp, + width: 22.vp, fit: BoxFit.fill, ), ), ), hintStyle: TextStyle( - fontSize: 640.wmax * 20.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w400, color: const Color(0xff9f9f9f), + fontWeight: FontWeight.w400, + fontFamily: 'PingFang', + fontSize: 20.fp, ), hintText: nameController.text.isEmpty ? 'please enter your name...'.tr : null, ), style: TextStyle( - fontSize: 640.wmax * 22.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w600, color: const Color(0xff130138), + fontWeight: FontWeight.w600, + fontFamily: 'PingFang', + fontSize: 22.fp, ), ), ), ), IntrinsicWidth( child: Container( - constraints: BoxConstraints( - minWidth: 640.wmax * 240.sr, - minHeight: 640.wmax * 44.sr, - ), + constraints: BoxConstraints(minWidth: 240.vp, minHeight: 44.vp), child: Column( children: [ Container( alignment: Alignment.centerLeft, - margin: EdgeInsets.only(bottom: 640.wmax * 10.sr), - constraints: BoxConstraints(minHeight: 640.wmax * 30.sr), + margin: EdgeInsets.only(bottom: 10.vp), + constraints: BoxConstraints(minHeight: 30.vp), child: Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - width: 640.wmax * 56.sr, + width: 56.vp, child: Text( 'Email:'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff130138), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ), @@ -258,9 +253,9 @@ class PageProfile extends GetView { child: Text( loginUser.email.value, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff303133), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ), @@ -269,21 +264,21 @@ class PageProfile extends GetView { ), Container( alignment: Alignment.centerLeft, - margin: EdgeInsets.only(bottom: 640.wmax * 10.sr), - constraints: BoxConstraints(minHeight: 640.wmax * 30.sr), + margin: EdgeInsets.only(bottom: 10.vp), + constraints: BoxConstraints(minHeight: 30.vp), child: Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - width: 640.wmax * 56.sr, + width: 56.vp, child: Text( 'Date:'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff130138), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ), @@ -291,9 +286,9 @@ class PageProfile extends GetView { child: Text( loginUser.createDate.value.yMMMd(), style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff303133), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ), @@ -302,21 +297,21 @@ class PageProfile extends GetView { ), Container( alignment: Alignment.centerLeft, - margin: EdgeInsets.only(bottom: 640.wmax * 10.sr), - constraints: BoxConstraints(minHeight: 640.wmax * 30.sr), + margin: EdgeInsets.only(bottom: 10.vp), + constraints: BoxConstraints(minHeight: 30.vp), child: Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - width: 640.wmax * 56.sr, + width: 56.vp, child: Text( 'State:'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff130138), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ), @@ -326,9 +321,9 @@ class PageProfile extends GetView { ? 'unavailable'.tr : 'available'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff303133), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ), @@ -347,7 +342,7 @@ class PageProfile extends GetView { Widget buildUpdateBtn(BuildContext context) { final updateUser = controller.updateUser; final mediaPadding = controller.mediaPadding.value; - final mediaBottom = max(mediaPadding.bottom, 640.wmax * 30.sr); + final mediaBottom = max(mediaPadding.bottom, 30.vp); Widget withInWell({required Widget child, dynamic onTap}) { return Material( @@ -356,7 +351,7 @@ class PageProfile extends GetView { radius: 200.0, containedInkWell: true, highlightShape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(640.wmax * 30.0.sr)), + borderRadius: BorderRadius.all(Radius.circular(30.0.vp)), highlightColor: const Color(0xff45197d).withValues(alpha: 0.05), splashColor: const Color(0xff45197d).withValues(alpha: 0.05), focusColor: Colors.transparent, @@ -370,30 +365,23 @@ class PageProfile extends GetView { return Container( color: Colors.white, alignment: Alignment.center, - padding: EdgeInsets.only( - left: 640.wmax * 32.sr, - right: 640.wmax * 32.sr, - bottom: mediaBottom, - ), - margin: EdgeInsets.only(top: 640.wmax * 42.sr), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp, bottom: mediaBottom), + margin: EdgeInsets.only(top: 42.vp), child: IntrinsicWidth( child: withInWell( onTap: () => updateUser(), child: Container( color: Colors.transparent, alignment: Alignment.center, - constraints: BoxConstraints(minWidth: 640.wmax * 160.sr), - padding: EdgeInsets.symmetric( - vertical: 640.wmax * 15.sr, - horizontal: 640.wmax * 18.sr, - ), + constraints: BoxConstraints(minWidth: 160.vp), + padding: EdgeInsets.symmetric(vertical: 15.vp, horizontal: 18.vp), child: Text( 'Update'.tr, style: TextStyle( - fontSize: 640.wmax * 18.sr, - fontWeight: FontWeight.bold, color: const Color(0xff5b259f), + fontWeight: FontWeight.bold, letterSpacing: 1.2, + fontSize: 18.fp, height: 1.2, ), ), diff --git a/lib/pages/register/index.dart b/lib/pages/register/index.dart index 5dff248..ab7e0bd 100644 --- a/lib/pages/register/index.dart +++ b/lib/pages/register/index.dart @@ -28,7 +28,7 @@ class PageRegister extends GetView { height: 100.vh, child: ListView( shrinkWrap: false, - padding: EdgeInsets.only(bottom: 50.wdp), + padding: EdgeInsets.only(bottom: 50.vp), physics: const ClampingScrollPhysics(), children: [ buildMainTitle(context), @@ -62,11 +62,8 @@ class PageRegister extends GetView { alignment: Alignment.topCenter, child: Container( width: 680.wmax, - height: 640.wmax * 36.sr, - margin: EdgeInsets.only( - top: max(top, 640.wmax * 20.sr), - left: 640.wmax * 20.sr, - ), + height: 36.vp, + margin: EdgeInsets.only(top: max(top, 20.vp), left: 20.vp), child: Row( children: [ GestureDetector( @@ -74,8 +71,8 @@ class PageRegister extends GetView { onTap: () => GetNavigate.back(), child: Image( image: const AssetImage('lib/assets/images/auth/back.png'), - width: 640.wmax * 36.sr, - height: 640.wmax * 36.sr, + width: 36.vp, + height: 36.vp, fit: BoxFit.fill, ), ), @@ -108,11 +105,11 @@ class PageRegister extends GetView { padding: const EdgeInsets.fromLTRB(30, 20, 30, 80), child: Text( 'Requesting...'.tr, - style: const TextStyle( - fontSize: 16, + style: TextStyle( + color: Color(0xff707177), fontWeight: FontWeight.w600, letterSpacing: 1.5, - color: Color(0xff707177), + fontSize: 16.fp, ), ), ), @@ -133,21 +130,19 @@ class PageRegister extends GetView { return Container( alignment: Alignment.center, padding: EdgeInsets.only( - bottom: 640.wmax * 32.sr, - right: 640.wmax * 48.sr, - left: 640.wmax * 48.sr, - top: orientation.value == Orientation.portrait - ? 640.wmax * 95.sr - : 640.wmax * 60.sr, + bottom: 32.vp, + right: 48.vp, + left: 48.vp, + top: orientation.value == Orientation.portrait ? 95.vp : 60.vp, ), child: Text( 'Experience the convenience of handed trading'.tr, textAlign: TextAlign.center, style: TextStyle( - fontSize: 640.wmax * 24.sr, - fontFamily: 'PingFang', color: const Color(0xff2f1155), fontWeight: FontWeight.w700, + fontFamily: 'PingFang', + fontSize: 24.fp, height: 1.2, ), ), @@ -164,19 +159,19 @@ class PageRegister extends GetView { Container( alignment: Alignment.center, padding: EdgeInsets.only( - top: 640.wmax * 1.5.sr, - left: 640.wmax * 45.sr, - right: 640.wmax * 45.sr, - bottom: 640.wmax * 1.5.sr, + top: 1.5.vp, + left: 45.vp, + right: 45.vp, + bottom: 1.5.vp, ), child: Text( 'Sign up with'.tr, textAlign: TextAlign.center, style: TextStyle( - fontSize: 640.wmax * 13.sr, - fontFamily: 'PingFang', color: const Color(0xffbdbdbd), fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + fontSize: 13.fp, height: 1.2, ), ), @@ -184,26 +179,26 @@ class PageRegister extends GetView { Container( alignment: Alignment.center, padding: EdgeInsets.only( - top: 640.wmax * 22.sr, - left: 640.wmax * 28.sr, - right: 640.wmax * 28.sr, - bottom: 640.wmax * 38.sr, + top: 22.vp, + left: 28.vp, + right: 28.vp, + bottom: 38.vp, ), child: Wrap( - spacing: 640.wmax * 20.sr, - runSpacing: 640.wmax * 15.sr, + spacing: 20.vp, + runSpacing: 15.vp, children: [ GestureDetector( behavior: HitTestBehavior.opaque, child: IntrinsicWidth( child: Container( padding: EdgeInsets.symmetric( - vertical: 640.wmax * 18.sr, - horizontal: 640.wmax * 20.sr, + vertical: 18.vp, + horizontal: 20.vp, ), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), boxShadow: [ BoxShadow( color: Colors.black.withValues(alpha: 0.1), @@ -220,17 +215,17 @@ class PageRegister extends GetView { image: const AssetImage( 'lib/assets/images/auth/google.png', ), - width: 640.wmax * 24.sr, - height: 640.wmax * 24.sr, + width: 24.vp, + height: 24.vp, fit: BoxFit.fill, ), - SizedBox(width: 640.wmax * 6.sr), + SizedBox(width: 6.vp), Text( 'Google', style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w500, color: const Color(0xffbdbdbd), + fontWeight: FontWeight.w500, + fontSize: 16.fp, ), ), ], @@ -246,12 +241,12 @@ class PageRegister extends GetView { child: IntrinsicWidth( child: Container( padding: EdgeInsets.symmetric( - vertical: 640.wmax * 18.sr, - horizontal: 640.wmax * 20.sr, + vertical: 18.vp, + horizontal: 20.vp, ), decoration: BoxDecoration( color: const Color(0xff4368c7), - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), boxShadow: [ BoxShadow( color: Colors.black.withValues(alpha: 0.1), @@ -268,17 +263,17 @@ class PageRegister extends GetView { image: const AssetImage( 'lib/assets/images/auth/github.png', ), - width: 640.wmax * 24.sr, - height: 640.wmax * 24.sr, + width: 24.vp, + height: 24.vp, fit: BoxFit.fill, ), - SizedBox(width: 640.wmax * 6.sr), + SizedBox(width: 6.vp), Text( 'Github', style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w500, color: Colors.white, + fontWeight: FontWeight.w500, + fontSize: 16.fp, ), ), ], @@ -313,13 +308,13 @@ class PageRegister extends GetView { return Column( children: [ Container( - width: 640.wmax * 310.sr, - height: 640.wmax * 54.sr, + width: 310.vp, + height: 54.vp, alignment: Alignment.center, - margin: EdgeInsets.only(bottom: 640.wmax * 18.sr), + margin: EdgeInsets.only(bottom: 18.vp), decoration: BoxDecoration( color: const Color(0xfff2f2f2), - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), border: Border.all( width: 1, color: emailError.value @@ -330,20 +325,20 @@ class PageRegister extends GetView { child: TextField( focusNode: emailFocusNode, controller: emailController, - cursorWidth: 640.wmax * 1.8.sr, - cursorHeight: 640.wmax * 18.sr, + cursorWidth: 1.8.vp, + cursorHeight: 18.vp, keyboardType: TextInputType.text, textAlignVertical: TextAlignVertical.center, decoration: InputDecoration( filled: true, hintText: 'Email'.tr, prefixIcon: Container( - width: 640.wmax * 64.sr, + width: 64.vp, alignment: Alignment.center, child: Image( image: const AssetImage('lib/assets/images/auth/email.png'), - width: 640.wmax * 24.sr, - height: 640.wmax * 24.sr, + width: 24.vp, + height: 24.vp, fit: BoxFit.fill, ), ), @@ -353,18 +348,18 @@ class PageRegister extends GetView { fillColor: Colors.transparent, hintStyle: TextStyle( letterSpacing: 1.5, - fontSize: 640.wmax * 16.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w500, color: const Color(0xff909399), + fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + fontSize: 16.fp, ), ), style: TextStyle( - letterSpacing: 1.5, - fontSize: 640.wmax * 16.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w500, color: const Color(0xff606266), + fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + letterSpacing: 1.5, + fontSize: 16.fp, ), onChanged: (v) { emailError.value = false; @@ -375,13 +370,13 @@ class PageRegister extends GetView { ), ), Container( - width: 640.wmax * 310.sr, - height: 640.wmax * 54.sr, + width: 310.vp, + height: 54.vp, alignment: Alignment.center, - margin: EdgeInsets.only(bottom: 640.wmax * 18.sr), + margin: EdgeInsets.only(bottom: 18.vp), decoration: BoxDecoration( color: const Color(0xfff2f2f2), - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), border: Border.all( width: 1, color: nameError.value @@ -392,20 +387,20 @@ class PageRegister extends GetView { child: TextField( focusNode: nameFocusNode, controller: nameController, - cursorWidth: 640.wmax * 1.8.sr, - cursorHeight: 640.wmax * 18.sr, + cursorWidth: 1.8.vp, + cursorHeight: 18.vp, keyboardType: TextInputType.text, textAlignVertical: TextAlignVertical.center, decoration: InputDecoration( filled: true, hintText: 'Username'.tr, prefixIcon: Container( - width: 640.wmax * 64.sr, + width: 64.vp, alignment: Alignment.center, child: Image( image: const AssetImage('lib/assets/images/auth/profile.png'), - width: 640.wmax * 24.sr, - height: 640.wmax * 24.sr, + width: 24.vp, + height: 24.vp, fit: BoxFit.fill, ), ), @@ -414,19 +409,19 @@ class PageRegister extends GetView { enabledBorder: InputBorder.none, fillColor: Colors.transparent, hintStyle: TextStyle( - letterSpacing: 1.5, - fontSize: 640.wmax * 16.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w500, color: const Color(0xff909399), + fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + letterSpacing: 1.5, + fontSize: 16.fp, ), ), style: TextStyle( - letterSpacing: 1.5, - fontSize: 640.wmax * 16.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w500, color: const Color(0xff606266), + fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + letterSpacing: 1.5, + fontSize: 16.fp, ), onChanged: (v) { nameError.value = false; @@ -438,13 +433,13 @@ class PageRegister extends GetView { ), ), Container( - width: 640.wmax * 310.sr, - height: 640.wmax * 54.sr, + width: 310.vp, + height: 54.vp, alignment: Alignment.center, - margin: EdgeInsets.only(bottom: 640.wmax * 18.sr), + margin: EdgeInsets.only(bottom: 18.vp), decoration: BoxDecoration( color: const Color(0xfff2f2f2), - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), border: Border.all( width: 1, color: passwordError1.value @@ -456,22 +451,22 @@ class PageRegister extends GetView { obscureText: true, focusNode: passwordFocusNode1, controller: passwordController1, - cursorWidth: 640.wmax * 1.8.sr, - cursorHeight: 640.wmax * 18.sr, + cursorWidth: 1.8.vp, + cursorHeight: 18.vp, keyboardType: TextInputType.text, textAlignVertical: TextAlignVertical.center, decoration: InputDecoration( filled: true, hintText: 'Password'.tr, prefixIcon: Container( - width: 640.wmax * 64.sr, + width: 64.vp, alignment: Alignment.center, child: Image( image: const AssetImage( 'lib/assets/images/auth/password.png', ), - width: 640.wmax * 24.sr, - height: 640.wmax * 24.sr, + width: 24.vp, + height: 24.vp, fit: BoxFit.fill, ), ), @@ -480,19 +475,19 @@ class PageRegister extends GetView { enabledBorder: InputBorder.none, fillColor: Colors.transparent, hintStyle: TextStyle( - letterSpacing: 1.5, - fontSize: 640.wmax * 16.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w500, color: const Color(0xff909399), + fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + letterSpacing: 1.5, + fontSize: 16.fp, ), ), style: TextStyle( - letterSpacing: 1.5, - fontSize: 640.wmax * 16.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w500, color: const Color(0xff606266), + fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + letterSpacing: 1.5, + fontSize: 16.fp, ), onChanged: (v) { passwordError1.value = false; @@ -505,13 +500,13 @@ class PageRegister extends GetView { ), ), Container( - width: 640.wmax * 310.sr, - height: 640.wmax * 54.sr, + width: 310.vp, + height: 54.vp, alignment: Alignment.center, - margin: EdgeInsets.only(bottom: 640.wmax * 18.sr), + margin: EdgeInsets.only(bottom: 18.vp), decoration: BoxDecoration( color: const Color(0xfff2f2f2), - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), border: Border.all( width: 1, color: passwordError2.value @@ -523,22 +518,22 @@ class PageRegister extends GetView { obscureText: true, focusNode: passwordFocusNode2, controller: passwordController2, - cursorWidth: 640.wmax * 1.8.sr, - cursorHeight: 640.wmax * 18.sr, + cursorWidth: 1.8.vp, + cursorHeight: 18.vp, keyboardType: TextInputType.text, textAlignVertical: TextAlignVertical.center, decoration: InputDecoration( filled: true, hintText: 'Confirm Password'.tr, prefixIcon: Container( - width: 640.wmax * 64.sr, + width: 64.vp, alignment: Alignment.center, child: Image( image: const AssetImage( 'lib/assets/images/auth/password.png', ), - width: 640.wmax * 24.sr, - height: 640.wmax * 24.sr, + width: 24.vp, + height: 24.vp, fit: BoxFit.fill, ), ), @@ -547,19 +542,19 @@ class PageRegister extends GetView { enabledBorder: InputBorder.none, fillColor: Colors.transparent, hintStyle: TextStyle( - letterSpacing: 1.5, - fontSize: 640.wmax * 16.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w500, color: const Color(0xff909399), + fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + letterSpacing: 1.5, + fontSize: 16.fp, ), ), style: TextStyle( - letterSpacing: 1.5, - fontSize: 640.wmax * 16.sr, - fontFamily: 'PingFang', - fontWeight: FontWeight.w500, color: const Color(0xff606266), + fontWeight: FontWeight.w500, + fontFamily: 'PingFang', + letterSpacing: 1.5, + fontSize: 16.fp, ), onChanged: (v) { passwordError2.value = false; @@ -580,29 +575,29 @@ class PageRegister extends GetView { return Container( width: 100.vw, - height: 640.wmax * 100.sr + mediaPadding.value.bottom, - margin: EdgeInsets.only(top: 640.wmax * 36.sr), + height: 100.vp + mediaPadding.value.bottom, + margin: EdgeInsets.only(top: 36.vp), alignment: Alignment.center, child: Column( children: [ GestureDetector( behavior: HitTestBehavior.opaque, child: Container( - width: 640.wmax * 200.sr, - height: 640.wmax * 64.sr, + width: 200.vp, + height: 64.vp, alignment: Alignment.center, decoration: BoxDecoration( color: const Color(0xff5b259f), - borderRadius: BorderRadius.circular(640.wmax * 15.sr), + borderRadius: BorderRadius.circular(15.vp), ), child: Text( 'Register'.tr, style: TextStyle( - letterSpacing: 1.2, color: Colors.white, - fontSize: 640.wmax * 18.sr, fontWeight: FontWeight.bold, fontFamily: 'PingFang', + letterSpacing: 1.2, + fontSize: 18.fp, ), ), ), @@ -610,24 +605,24 @@ class PageRegister extends GetView { loginTimeout(signUpWithAccount(), Duration(seconds: 5)); }, ), - SizedBox(height: 640.wmax * 12.sr), + SizedBox(height: 12.vp), RichText( text: TextSpan( children: [ TextSpan( text: 'You have account?'.tr, style: TextStyle( - fontSize: 640.wmax * 14.sr, - fontWeight: FontWeight.w500, color: const Color(0xffbdbdbd), + fontWeight: FontWeight.w500, + fontSize: 14.fp, ), ), TextSpan( text: 'Login'.tr, style: TextStyle( - fontSize: 640.wmax * 14.sr, - fontWeight: FontWeight.w600, color: const Color(0xff81c2ff), + fontWeight: FontWeight.w600, + fontSize: 14.fp, ), recognizer: TapGestureRecognizer() ..onTap = () => GetNavigate.back(), diff --git a/lib/pages/scanner/controller.dart b/lib/pages/scanner/controller.dart index 03189f3..5f39c44 100644 --- a/lib/pages/scanner/controller.dart +++ b/lib/pages/scanner/controller.dart @@ -77,40 +77,37 @@ class PageScannerController extends GetxController with TickerProvider { context: Get.context!, barrierColor: Color(0xff000000).withValues(alpha: 0.55), builder: (context) => Padding( - padding: EdgeInsets.only( - bottom: 640.wmax * 100.sr, - top: 640.wmax * 20.sr, - ), + padding: EdgeInsets.only(bottom: 100.vp, top: 20.vp), child: AlertDialog( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(25.0), ), iconPadding: EdgeInsets.all(0), buttonPadding: EdgeInsets.only( - top: 640.wmax * 10.sr, - left: 640.wmax * 5.sr, - right: 640.wmax * 5.sr, - bottom: 640.wmax * 10.sr, + top: 10.vp, + left: 5.vp, + right: 5.vp, + bottom: 10.vp, ), contentPadding: EdgeInsets.only( - top: 640.wmax * 30.sr, - left: 640.wmax * 30.sr, - right: 640.wmax * 30.sr, + top: 30.vp, + left: 30.vp, + right: 30.vp, ), actionsPadding: EdgeInsets.only( - top: 640.wmax * 14.sr, - left: 640.wmax * 20.sr, - right: 640.wmax * 20.sr, - bottom: 640.wmax * 8.sr, + top: 14.vp, + left: 20.vp, + right: 20.vp, + bottom: 8.vp, ), backgroundColor: Colors.white, content: Text( message, style: TextStyle( - fontSize: 640.wmax * 17.6.sr, - fontWeight: FontWeight.w600, color: Color(0xff303133), + fontWeight: FontWeight.w600, letterSpacing: 1.2, + fontSize: 17.6.fp, ), ), actions: [ @@ -123,10 +120,10 @@ class PageScannerController extends GetxController with TickerProvider { child: Text( 'System_Cancel'.tr, style: TextStyle( - fontSize: 640.wmax * 15.sr, - fontWeight: FontWeight.w500, color: Color(0xff606266), + fontWeight: FontWeight.w500, letterSpacing: 1.2, + fontSize: 15.fp, ), ), onPressed: () { @@ -146,10 +143,10 @@ class PageScannerController extends GetxController with TickerProvider { child: Text( 'Scanner_Go_to_settings'.tr, style: TextStyle( - fontSize: 640.wmax * 15.sr, - fontWeight: FontWeight.w500, color: Color(0xff303133), + fontWeight: FontWeight.w500, letterSpacing: 1.2, + fontSize: 15.fp, ), ), onPressed: () { diff --git a/lib/pages/scanner/index.dart b/lib/pages/scanner/index.dart index 87f1b1b..33cfe64 100644 --- a/lib/pages/scanner/index.dart +++ b/lib/pages/scanner/index.dart @@ -27,8 +27,8 @@ class PageScanner extends GetView { final scanArea = Rect.fromCenter( center: MediaQuery.sizeOf(context).center(Offset.zero), - height: 640.wmax * 248.sr, - width: 640.wmax * 248.sr, + height: 248.vp, + width: 248.vp, ); return Scaffold( @@ -93,11 +93,11 @@ class PageScanner extends GetView { }, ), Positioned( - top: max(mediaPadding.top, 640.wmax * 20.sr), - left: 640.wmax * 20.sr, + top: max(mediaPadding.top, 20.vp), + left: 20.vp, child: Container( alignment: Alignment.centerLeft, - height: max(640.wmax * 40.sr, mediaTopBar), + height: max(40.vp, mediaTopBar), child: Row( children: [ GestureDetector( @@ -106,8 +106,8 @@ class PageScanner extends GetView { image: const AssetImage( 'lib/assets/images/scanner/back.png', ), - height: 640.wmax * 36.sr, - width: 640.wmax * 36.sr, + height: 36.vp, + width: 36.vp, fit: BoxFit.fill, ), onTap: () { @@ -123,16 +123,16 @@ class PageScanner extends GetView { ), ), Positioned( - top: max(mediaPadding.top, 640.wmax * 20.sr), - right: max(mediaPadding.right, 640.wmax * 20.sr), + top: max(mediaPadding.top, 20.vp), + right: max(mediaPadding.right, 20.vp), child: Container( alignment: Alignment.centerRight, - height: max(640.wmax * 40.sr, mediaTopBar), + height: max(40.vp, mediaTopBar), child: buildAlbum(context), ), ), Positioned( - bottom: max(mediaPadding.bottom, 640.wmax * 90.sr), + bottom: max(mediaPadding.bottom, 90.vp), child: Container( alignment: Alignment.centerRight, child: buildTorch(context), @@ -153,11 +153,11 @@ class PageScanner extends GetView { return GestureDetector( behavior: HitTestBehavior.opaque, child: Container( - padding: EdgeInsets.all(640.wmax * 10.sr), + padding: EdgeInsets.all(10.vp), child: Image( image: AssetImage('lib/assets/images/scanner/photo.png'), - height: 640.wmax * 30.sr, - width: 640.wmax * 36.sr, + height: 30.vp, + width: 36.vp, ), ), onTap: () async { @@ -223,8 +223,8 @@ class PageScanner extends GetView { 'lib/assets/images/scanner/${torchOpened.value ? 'torch_open' : 'torch_close'}.png', ), fit: BoxFit.fill, - height: 640.wmax * 48.sr, - width: 640.wmax * 36.sr, + height: 48.vp, + width: 36.vp, ), ), onTap: () { diff --git a/lib/pages/settings/controller.dart b/lib/pages/settings/controller.dart index 2143d96..30b9e0d 100644 --- a/lib/pages/settings/controller.dart +++ b/lib/pages/settings/controller.dart @@ -19,8 +19,8 @@ class PageSettingsController extends GetxController { super.onInit(); scrollController.addListener(() { - final expanded = 640.wmax * 152.sr; - final collapsed = max(640.wmax * 40.sr, mediaTopBar.value); + final expanded = 152.vp; + final collapsed = max(40.vp, mediaTopBar.value); isShadow.value = scrollController.position.pixels >= expanded - collapsed; }); } diff --git a/lib/pages/settings/index.dart b/lib/pages/settings/index.dart index fbe97fe..4a8932f 100644 --- a/lib/pages/settings/index.dart +++ b/lib/pages/settings/index.dart @@ -18,7 +18,7 @@ class PageSettings extends GetView { final mediaTopBar = controller.mediaTopBar; final isShadow = controller.isShadow; - final top = max(mediaPadding.value.top, 640.wmax * 20.sr); + final top = max(mediaPadding.value.top, 20.vp); return Scaffold( body: Stack( @@ -38,8 +38,8 @@ class PageSettings extends GetView { elevation: 0.0, scrolledUnderElevation: 0.0, automaticallyImplyLeading: false, - collapsedHeight: max(640.wmax * 40.sr, mediaTopBar.value), - expandedHeight: 640.wmax * 138.sr, + collapsedHeight: max(40.vp, mediaTopBar.value), + expandedHeight: 138.vp, flexibleSpace: Obx(() { List? boxShadow; @@ -110,7 +110,7 @@ class PageSettings extends GetView { Widget buildBack(BuildContext context) { final mediaTopBar = controller.mediaTopBar.value; final mediaPadding = controller.mediaPadding.value; - final height = max(640.wmax * 40.sr, mediaTopBar); + final height = max(40.vp, mediaTopBar); return Positioned( top: 0, @@ -122,12 +122,12 @@ class PageSettings extends GetView { width: 680.wmax, height: height, margin: EdgeInsets.only( - top: max(mediaPadding.top, 640.wmax * 20.sr), - left: 640.wmax * 20.sr, + top: max(mediaPadding.top, 20.vp), + left: 20.vp, ), padding: EdgeInsets.only( - top: (height - 640.wmax * 36.sr) / 2, - bottom: (height - 640.wmax * 36.sr) / 2, + top: (height - 36.vp) / 2, + bottom: (height - 36.vp) / 2, ), child: Row( children: [ @@ -136,8 +136,8 @@ class PageSettings extends GetView { onTap: () => GetNavigate.back(), child: Image( image: const AssetImage('lib/assets/images/auth/back.png'), - width: 640.wmax * 36.sr, - height: 640.wmax * 36.sr, + width: 36.vp, + height: 36.vp, fit: BoxFit.fill, ), ), @@ -152,14 +152,14 @@ class PageSettings extends GetView { return Container( alignment: Alignment.center, constraints: const BoxConstraints.expand(), - padding: EdgeInsets.only(left: 640.wmax * 32.sr, right: 640.wmax * 32.sr), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), child: Text( 'Settings'.tr, style: TextStyle( - fontSize: 640.wmax * 20.sr, - fontWeight: FontWeight.bold, color: const Color(0xff130138), - letterSpacing: 3, + fontWeight: FontWeight.bold, + letterSpacing: 3.0, + fontSize: 20.fp, height: 1, ), ), @@ -169,32 +169,32 @@ class PageSettings extends GetView { Widget buildItems(BuildContext context) { return Container( padding: EdgeInsets.only( - top: 640.wmax * 12.sr, - left: 640.wmax * 32.sr, - right: 640.wmax * 32.sr, - bottom: 640.wmax * 32.sr, + top: 12.vp, + left: 32.vp, + right: 32.vp, + bottom: 32.vp, ), child: Column( children: [ GestureDetector( behavior: HitTestBehavior.opaque, child: Container( - height: 640.wmax * 44.sr, - margin: EdgeInsets.only(bottom: 640.wmax * 30.sr), + height: 44.vp, + margin: EdgeInsets.only(bottom: 30.vp), child: Row( children: [ Container( - width: 640.wmax * 44.sr, - height: 640.wmax * 44.sr, - margin: EdgeInsets.only(right: 640.wmax * 26.sr), + width: 44.vp, + height: 44.vp, + margin: EdgeInsets.only(right: 26.vp), alignment: Alignment.center, decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(640.wmax * 22.sr), + borderRadius: BorderRadius.circular(22.vp), boxShadow: [ BoxShadow( color: const Color(0xff272246).withValues(alpha: .08), - offset: Offset(0, 640.wmax * 4.sr), + offset: Offset(0, 4.vp), spreadRadius: 0, blurRadius: 12, ), @@ -202,8 +202,8 @@ class PageSettings extends GetView { ), child: Image.asset( 'lib/assets/images/settings/profile.png', - height: 640.wmax * 24.sr, - width: 640.wmax * 24.sr, + height: 24.vp, + width: 24.vp, fit: BoxFit.fill, ), ), @@ -211,16 +211,16 @@ class PageSettings extends GetView { child: Text( 'Person Profile'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff130138), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ), Image.asset( 'lib/assets/images/settings/right.png', - height: 640.wmax * 28.sr, - width: 640.wmax * 28.sr, + height: 28.vp, + width: 28.vp, fit: BoxFit.fill, ), ], @@ -235,22 +235,22 @@ class PageSettings extends GetView { GestureDetector( behavior: HitTestBehavior.opaque, child: Container( - height: 640.wmax * 44.sr, - margin: EdgeInsets.only(bottom: 640.wmax * 30.sr), + height: 44.vp, + margin: EdgeInsets.only(bottom: 30.vp), child: Row( children: [ Container( - width: 640.wmax * 44.sr, - height: 640.wmax * 44.sr, - margin: EdgeInsets.only(right: 640.wmax * 26.sr), + width: 44.vp, + height: 44.vp, + margin: EdgeInsets.only(right: 26.vp), alignment: Alignment.center, decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(640.wmax * 22.sr), + borderRadius: BorderRadius.circular(22.vp), boxShadow: [ BoxShadow( color: const Color(0xff272246).withValues(alpha: .08), - offset: Offset(0, 640.wmax * 4.sr), + offset: Offset(0, 4.vp), spreadRadius: 0, blurRadius: 12, ), @@ -258,8 +258,8 @@ class PageSettings extends GetView { ), child: Image.asset( 'lib/assets/images/settings/notification.png', - height: 640.wmax * 24.sr, - width: 640.wmax * 24.sr, + height: 24.vp, + width: 24.vp, fit: BoxFit.fill, ), ), @@ -267,16 +267,16 @@ class PageSettings extends GetView { child: Text( 'Message Notification'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff130138), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ), Image.asset( 'lib/assets/images/settings/right.png', - height: 640.wmax * 28.sr, - width: 640.wmax * 28.sr, + height: 28.vp, + width: 28.vp, fit: BoxFit.fill, ), ], @@ -289,22 +289,22 @@ class PageSettings extends GetView { GestureDetector( behavior: HitTestBehavior.opaque, child: Container( - height: 640.wmax * 44.sr, - margin: EdgeInsets.only(bottom: 640.wmax * 30.sr), + height: 44.vp, + margin: EdgeInsets.only(bottom: 30.vp), child: Row( children: [ Container( - width: 640.wmax * 44.sr, - height: 640.wmax * 44.sr, - margin: EdgeInsets.only(right: 640.wmax * 26.sr), + width: 44.vp, + height: 44.vp, + margin: EdgeInsets.only(right: 26.vp), alignment: Alignment.center, decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(640.wmax * 22.sr), + borderRadius: BorderRadius.circular(22.vp), boxShadow: [ BoxShadow( color: const Color(0xff272246).withValues(alpha: .08), - offset: Offset(0, 640.wmax * 4.sr), + offset: Offset(0, 4.vp), spreadRadius: 0, blurRadius: 12, ), @@ -312,8 +312,8 @@ class PageSettings extends GetView { ), child: Image.asset( 'lib/assets/images/settings/card.png', - height: 640.wmax * 24.sr, - width: 640.wmax * 24.sr, + height: 24.vp, + width: 24.vp, fit: BoxFit.fill, ), ), @@ -321,16 +321,16 @@ class PageSettings extends GetView { child: Text( 'My Bank Card'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff130138), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ), Image.asset( 'lib/assets/images/settings/right.png', - height: 640.wmax * 28.sr, - width: 640.wmax * 28.sr, + height: 28.vp, + width: 28.vp, fit: BoxFit.fill, ), ], @@ -343,22 +343,22 @@ class PageSettings extends GetView { GestureDetector( behavior: HitTestBehavior.opaque, child: Container( - height: 640.wmax * 44.sr, - margin: EdgeInsets.only(bottom: 640.wmax * 30.sr), + height: 44.vp, + margin: EdgeInsets.only(bottom: 30.vp), child: Row( children: [ Container( - width: 640.wmax * 44.sr, - height: 640.wmax * 44.sr, - margin: EdgeInsets.only(right: 640.wmax * 26.sr), + width: 44.vp, + height: 44.vp, + margin: EdgeInsets.only(right: 26.vp), alignment: Alignment.center, decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(640.wmax * 22.sr), + borderRadius: BorderRadius.circular(22.vp), boxShadow: [ BoxShadow( color: const Color(0xff272246).withValues(alpha: .08), - offset: Offset(0, 640.wmax * 4.sr), + offset: Offset(0, 4.vp), spreadRadius: 0, blurRadius: 12, ), @@ -366,8 +366,8 @@ class PageSettings extends GetView { ), child: Image.asset( 'lib/assets/images/settings/langs.png', - height: 640.wmax * 24.sr, - width: 640.wmax * 24.sr, + height: 24.vp, + width: 24.vp, fit: BoxFit.fill, ), ), @@ -375,16 +375,16 @@ class PageSettings extends GetView { child: Text( 'Switch Language'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff130138), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ), Image.asset( 'lib/assets/images/settings/right.png', - height: 640.wmax * 28.sr, - width: 640.wmax * 28.sr, + height: 28.vp, + width: 28.vp, fit: BoxFit.fill, ), ], @@ -399,22 +399,22 @@ class PageSettings extends GetView { GestureDetector( behavior: HitTestBehavior.opaque, child: Container( - height: 640.wmax * 44.sr, - margin: EdgeInsets.only(bottom: 640.wmax * 30.sr), + height: 44.vp, + margin: EdgeInsets.only(bottom: 30.vp), child: Row( children: [ Container( - width: 640.wmax * 44.sr, - height: 640.wmax * 44.sr, - margin: EdgeInsets.only(right: 640.wmax * 26.sr), + width: 44.vp, + height: 44.vp, + margin: EdgeInsets.only(right: 26.vp), alignment: Alignment.center, decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(640.wmax * 22.sr), + borderRadius: BorderRadius.circular(22.vp), boxShadow: [ BoxShadow( color: const Color(0xff272246).withValues(alpha: .08), - offset: Offset(0, 640.wmax * 4.sr), + offset: Offset(0, 4.vp), spreadRadius: 0, blurRadius: 12, ), @@ -422,8 +422,8 @@ class PageSettings extends GetView { ), child: Image.asset( 'lib/assets/images/settings/logger.png', - height: 640.wmax * 24.sr, - width: 640.wmax * 24.sr, + height: 24.vp, + width: 24.vp, fit: BoxFit.fill, ), ), @@ -431,16 +431,16 @@ class PageSettings extends GetView { child: Text( 'Run Logger'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff130138), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ), Image.asset( 'lib/assets/images/settings/right.png', - height: 640.wmax * 28.sr, - width: 640.wmax * 28.sr, + height: 28.vp, + width: 28.vp, fit: BoxFit.fill, ), ], @@ -455,22 +455,22 @@ class PageSettings extends GetView { GestureDetector( behavior: HitTestBehavior.opaque, child: Container( - height: 640.wmax * 44.sr, - margin: EdgeInsets.only(bottom: 640.wmax * 30.sr), + height: 44.vp, + margin: EdgeInsets.only(bottom: 30.vp), child: Row( children: [ Container( - width: 640.wmax * 44.sr, - height: 640.wmax * 44.sr, - margin: EdgeInsets.only(right: 640.wmax * 26.sr), + width: 44.vp, + height: 44.vp, + margin: EdgeInsets.only(right: 26.vp), alignment: Alignment.center, decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(640.wmax * 22.sr), + borderRadius: BorderRadius.circular(22.vp), boxShadow: [ BoxShadow( color: const Color(0xff272246).withValues(alpha: .08), - offset: Offset(0, 640.wmax * 4.sr), + offset: Offset(0, 4.vp), spreadRadius: 0, blurRadius: 12, ), @@ -478,8 +478,8 @@ class PageSettings extends GetView { ), child: Image.asset( 'lib/assets/images/settings/github.png', - height: 640.wmax * 24.sr, - width: 640.wmax * 24.sr, + height: 24.vp, + width: 24.vp, fit: BoxFit.fill, ), ), @@ -487,23 +487,23 @@ class PageSettings extends GetView { child: Text( 'About App'.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: Color(0xff130138), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), ), Padding( padding: EdgeInsets.only( - top: 640.wmax * 5.sr, - left: 640.wmax * 5.sr, - right: 640.wmax * 7.sr, - bottom: 640.wmax * 5.sr, + top: 5.vp, + left: 5.vp, + right: 7.vp, + bottom: 5.vp, ), child: Image.asset( 'lib/assets/images/settings/link.png', - height: 640.wmax * 18.sr, - width: 640.wmax * 18.sr, + height: 18.vp, + width: 18.vp, fit: BoxFit.fill, ), ), @@ -528,7 +528,7 @@ class PageSettings extends GetView { Widget buildLogout(BuildContext context) { return Container( alignment: Alignment.center, - padding: EdgeInsets.only(left: 640.wmax * 32.sr, right: 640.wmax * 32.sr), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), child: Column( children: [ Material( @@ -539,23 +539,23 @@ class PageSettings extends GetView { hoverColor: Colors.transparent, focusColor: Colors.transparent, highlightShape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(640.wmax * 32.sr)), + borderRadius: BorderRadius.all(Radius.circular(32.vp)), highlightColor: const Color(0xff5b259f).withValues(alpha: 0.0), splashColor: const Color(0xff5b259f).withValues(alpha: 0.0), onTap: () => showAlertDialog(context), child: Container( - width: 640.wmax * 64.sr, - height: 640.wmax * 64.sr, + width: 64.vp, + height: 64.vp, alignment: Alignment.center, - padding: EdgeInsets.only(right: 640.wmax * 3.sr), + padding: EdgeInsets.only(right: 3.vp), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(640.wmax * 32.sr), + borderRadius: BorderRadius.circular(32.vp), border: Border.all(color: Color(0xffe0e0e0), width: .8), ), child: Image.asset( 'lib/assets/images/settings/logout.png', - height: 640.wmax * 36.sr, - width: 640.wmax * 36.sr, + height: 36.vp, + width: 36.vp, fit: BoxFit.fill, ), ), @@ -565,14 +565,14 @@ class PageSettings extends GetView { behavior: HitTestBehavior.translucent, onTap: () => showAlertDialog(context), child: Padding( - padding: EdgeInsets.only(top: 640.wmax * 12.sr), + padding: EdgeInsets.only(top: 12.vp), child: Text( 'Logout'.tr, style: TextStyle( - fontSize: 640.wmax * 18.sr, - fontWeight: FontWeight.w600, color: Color(0xff5b259f), + fontWeight: FontWeight.w600, letterSpacing: 3, + fontSize: 18.fp, ), ), ), @@ -586,10 +586,7 @@ class PageSettings extends GetView { final mediaPadding = controller.mediaPadding; final mediaBottom = mediaPadding.value.bottom; - return SizedBox( - width: 640.wmax, - height: max(mediaBottom - 640.wmax * 20.sr, 640.wmax * 10.sr), - ); + return SizedBox(width: 640.wmax, height: max(mediaBottom - 20.vp, 10.vp)); } void showAlertDialog(BuildContext context) { @@ -597,40 +594,37 @@ class PageSettings extends GetView { context: context, barrierColor: Color(0xff000000).withValues(alpha: 0.65), builder: (context) => Padding( - padding: EdgeInsets.only( - top: 640.wmax * 20.sr, - bottom: 640.wmax * 100.sr, - ), + padding: EdgeInsets.only(top: 20.vp, bottom: 100.vp), child: AlertDialog( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(25.0), ), iconPadding: EdgeInsets.all(0), contentPadding: EdgeInsets.only( - top: 640.wmax * 30.sr, - left: 640.wmax * 30.sr, - right: 640.wmax * 30.sr, + top: 30.vp, + left: 30.vp, + right: 30.vp, ), actionsPadding: EdgeInsets.only( - top: 640.wmax * 14.sr, - left: 640.wmax * 20.sr, - right: 640.wmax * 20.sr, - bottom: 640.wmax * 8.sr, + top: 14.vp, + left: 20.vp, + right: 20.vp, + bottom: 8.vp, ), buttonPadding: EdgeInsets.only( - top: 640.wmax * 10.sr, - left: 640.wmax * 5.sr, - right: 640.wmax * 5.sr, - bottom: 640.wmax * 10.sr, + top: 10.vp, + left: 5.vp, + right: 5.vp, + bottom: 10.vp, ), backgroundColor: Colors.white, content: Text( 'Do you want to logout?'.tr, style: TextStyle( - fontSize: 640.wmax * 17.6.sr, - fontWeight: FontWeight.w600, color: Color(0xfff34d4d), + fontWeight: FontWeight.w600, letterSpacing: 1.2, + fontSize: 17.6.fp, ), ), actions: [ @@ -644,10 +638,10 @@ class PageSettings extends GetView { child: Text( 'System_Cancel'.tr, style: TextStyle( - fontSize: 640.wmax * 15.sr, - fontWeight: FontWeight.w500, color: Color(0xff9f9f9f), + fontWeight: FontWeight.w500, letterSpacing: 1.2, + fontSize: 15.fp, ), ), ), @@ -661,10 +655,10 @@ class PageSettings extends GetView { child: Text( 'Logout'.tr, style: TextStyle( - fontSize: 640.wmax * 15.sr, - fontWeight: FontWeight.w500, color: Color(0xff606266), + fontWeight: FontWeight.w500, letterSpacing: 1.2, + fontSize: 15.fp, ), ), ), diff --git a/lib/pages/stats/controller.dart b/lib/pages/stats/controller.dart index 2fb4af7..c8778be 100644 --- a/lib/pages/stats/controller.dart +++ b/lib/pages/stats/controller.dart @@ -39,7 +39,7 @@ class PageStatsController extends GetxController with RxWatcher { } final pixels = scrollController.position.pixels; - final isMaxRange = pixels >= (640.wmax * 298.sr); + final isMaxRange = pixels >= (298.vp); isShowTopBar.value = isPortrait.value && isMaxRange; }); diff --git a/lib/pages/stats/index.dart b/lib/pages/stats/index.dart index a486da5..882540e 100644 --- a/lib/pages/stats/index.dart +++ b/lib/pages/stats/index.dart @@ -19,9 +19,9 @@ class PageStats extends GetView { body: Obx(() { final isPortrait = controller.isPortrait; final mediaPadding = controller.mediaPadding.value; - final mediaBottom = max(mediaPadding.bottom, 640.wmax * 30.sr); + final mediaBottom = max(mediaPadding.bottom, 30.vp); - final bottom = isPortrait.value ? mediaBottom + 640.wmax * 92.sr : 0.0; + final bottom = isPortrait.value ? mediaBottom + 92.vp : 0.0; final width = isPortrait.value ? 640.wmax : 100.vw; return Align( @@ -79,12 +79,12 @@ class PageStats extends GetView { opacity: isShowTopBar.value ? 1.0 : 0.0, child: Container( width: 640.wmax, - height: max(640.wmax * 88.sr, mediaTop + 640.wmax * 56.sr), + height: max(88.vp, mediaTop + 56.vp), alignment: Alignment.center, padding: EdgeInsets.only( - top: max(640.wmax * 32.sr, mediaTop), - left: 640.wmax * 32.sr, - right: 640.wmax * 32.sr, + top: max(32.vp, mediaTop), + left: 32.vp, + right: 32.vp, ), decoration: BoxDecoration( color: Colors.white, @@ -98,20 +98,20 @@ class PageStats extends GetView { ], ), child: SizedBox( - height: 640.wmax * 56.sr, + height: 56.vp, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Padding( - padding: EdgeInsets.only(right: 640.wmax * 10.sr), + padding: EdgeInsets.only(right: 10.vp), child: Text( 'Balance'.tr, style: TextStyle( - fontSize: 640.wmax * 20.sr, - fontWeight: FontWeight.w600, color: const Color(0xff130138), + fontWeight: FontWeight.w600, letterSpacing: 1.2, + fontSize: 20.fp, height: 1, ), ), @@ -120,14 +120,14 @@ class PageStats extends GetView { child: AutoSizeText( balance.usd2, style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 640.wmax * 25.sr, color: Color(0xff9038ff), + fontWeight: FontWeight.bold, + fontSize: 25.fp, ), textAlign: TextAlign.right, - minFontSize: (640.wmax * 15.sr).floor() * 1.0, - maxFontSize: (640.wmax * 26.sr).floor() * 1.0, - stepGranularity: max((640.wmax * 1.sr).floor() * 1.0, 1), + minFontSize: (15.vp).floor() * 1.0, + maxFontSize: (26.vp).floor() * 1.0, + stepGranularity: max((1.vp).floor() * 1.0, 1), overflow: TextOverflow.ellipsis, maxLines: 1, ), @@ -159,8 +159,8 @@ class PageStats extends GetView { return ClipOval( child: Image.memory( userAvatar, - width: 640.wmax * 39.sr, - height: 640.wmax * 39.sr, + width: 39.vp, + height: 39.vp, fit: BoxFit.fill, ), ); @@ -169,59 +169,55 @@ class PageStats extends GetView { return ClipOval( child: Image.asset( 'lib/assets/images/payer/$icon.png', - width: 640.wmax * 39.sr, - height: 640.wmax * 39.sr, + width: 39.vp, + height: 39.vp, fit: BoxFit.fill, ), ); } return Container( - padding: EdgeInsets.only(left: 640.wmax * 32.sr, right: 640.wmax * 32.sr), - margin: EdgeInsets.only(top: 640.wmax * 50.sr, bottom: 640.wmax * 15.sr), + padding: EdgeInsets.only(left: 32.vp, right: 32.vp), + margin: EdgeInsets.only(top: 50.vp, bottom: 15.vp), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - height: 640.wmax * 20.sr, + height: 20.vp, alignment: Alignment.center, - margin: EdgeInsets.only(bottom: 640.wmax * 16.sr), + margin: EdgeInsets.only(bottom: 16.vp), child: Text( 'Balance'.tr, style: TextStyle( - fontWeight: FontWeight.w500, - fontSize: 640.wmax * 16.sr, color: Color(0xff8b98b1), + fontWeight: FontWeight.w500, + fontSize: 16.fp, ), ), ), Container( - height: 640.wmax * 44.sr, + height: 44.vp, alignment: Alignment.center, - margin: EdgeInsets.only(bottom: 640.wmax * 42.sr), + margin: EdgeInsets.only(bottom: 42.vp), child: AutoSizeText( balance.USD, style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 640.wmax * 36.sr, color: Color(0xff9038ff), + fontWeight: FontWeight.bold, + fontSize: 36.fp, ), - minFontSize: (640.wmax * 24.sr).floor() * 1.0, - maxFontSize: (640.wmax * 36.sr).floor() * 1.0, - stepGranularity: max((640.wmax * 1.sr).floor() * 1.0, 1), + minFontSize: (24.vp).floor() * 1.0, + maxFontSize: (36.vp).floor() * 1.0, + stepGranularity: max((1.vp).floor() * 1.0, 1), overflow: TextOverflow.ellipsis, maxLines: 1, ), ), Container( width: 640.wmax, - height: 640.wmax * 21.sr, - margin: EdgeInsets.only( - left: 640.wmax * 2.sr, - right: 640.wmax * 2.sr, - bottom: 640.wmax * 25.sr, - ), + height: 21.vp, + margin: EdgeInsets.only(left: 2.vp, right: 2.vp, bottom: 25.vp), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, @@ -229,19 +225,19 @@ class PageStats extends GetView { Text( 'Transactions'.tr, style: TextStyle( - fontSize: 640.wmax * 18.sr, - fontWeight: FontWeight.w600, color: const Color(0xff130138), + fontWeight: FontWeight.w600, letterSpacing: -0.35, + fontSize: 18.fp, height: 1, ), ), Text( 'Money'.tr, style: TextStyle( - fontSize: 640.wmax * 14.sr, - fontWeight: FontWeight.w600, color: const Color(0xff130138), + fontWeight: FontWeight.w600, + fontSize: 14.fp, height: 1, ), ), @@ -257,61 +253,61 @@ class PageStats extends GetView { final order = rawOrders[index]; return SizedBox( - height: 640.wmax * 39.sr, + height: 39.vp, child: Row( children: [ buildIconAvatar(order.icon), - SizedBox(width: 640.wmax * 15.sr), + SizedBox(width: 15.vp), Expanded( child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 640.wmax * 19.sr, + height: 19.vp, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( order.name.tr, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: const Color(0xff000000), + fontWeight: FontWeight.w600, + fontSize: 16.fp, ), ), Text( order.money.usd, style: TextStyle( - fontSize: 640.wmax * 16.sr, - fontWeight: FontWeight.w600, color: const Color(0xff363853), + fontWeight: FontWeight.w600, letterSpacing: -0.6, + fontSize: 16.fp, ), ), ], ), ), - SizedBox(height: 640.wmax * 2.sr), + SizedBox(height: 2.vp), SizedBox( - height: 640.wmax * 18.sr, + height: 18.vp, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( order.type.tr, style: TextStyle( - fontSize: 640.wmax * 14.sr, - fontWeight: FontWeight.w500, color: const Color(0xff909399), + fontWeight: FontWeight.w500, + fontSize: 14.fp, ), ), Text( order.date.yMMMd(), style: TextStyle( - fontSize: 640.wmax * 12.sr, - fontWeight: FontWeight.w500, color: const Color(0xffababab), + fontWeight: FontWeight.w500, + fontSize: 12.fp, ), ), ], @@ -325,7 +321,7 @@ class PageStats extends GetView { ); }, separatorBuilder: (BuildContext context, int index) { - return SizedBox(height: 640.wmax * 21.sr); + return SizedBox(height: 21.vp); }, ), ], @@ -336,7 +332,7 @@ class PageStats extends GetView { Widget buildBottomTabbar(BuildContext context) { final isPortrait = controller.isPortrait; final mediaPadding = controller.mediaPadding.value; - final mediaBottom = max(mediaPadding.bottom, 640.wmax * 30.sr); + final mediaBottom = max(mediaPadding.bottom, 30.vp); if (!isPortrait.value) { return const SizedBox.shrink(); @@ -348,40 +344,40 @@ class PageStats extends GetView { child: Container( width: 640.wmax, color: Colors.white.withValues(alpha: 0.88), - height: mediaBottom + 640.wmax * 92.sr, + height: mediaBottom + 92.vp, alignment: Alignment.topCenter, padding: EdgeInsets.only( - top: 640.wmax * 10.sr, - left: 640.wmax * 24.sr, - right: 640.wmax * 24.sr, + top: 10.vp, + left: 24.vp, + right: 24.vp, bottom: mediaBottom, ), child: Stack( fit: StackFit.expand, children: [ Positioned( - top: 640.wmax * 32.sr, - left: 640.wmax * 24.sr, + top: 32.vp, + left: 24.vp, child: Image.asset( 'lib/assets/images/tabbar/bg.png', - width: 640.wmax * 280.sr, - height: 640.wmax * 52.sr, + width: 280.vp, + height: 52.vp, fit: BoxFit.fill, ), ), Align( alignment: Alignment.topLeft, child: Container( - height: 640.wmax * 78.sr, + height: 78.vp, padding: EdgeInsets.only( - top: 640.wmax * 25.sr, - left: 640.wmax * 40.sr, - right: 640.wmax * 40.sr, - bottom: 640.wmax * 25.sr, + top: 25.vp, + left: 40.vp, + right: 40.vp, + bottom: 25.vp, ), decoration: BoxDecoration( color: const Color(0xff2f1155), - borderRadius: BorderRadius.circular(640.wmax * 30.sr), + borderRadius: BorderRadius.circular(30.vp), boxShadow: [ BoxShadow( color: const Color(0xff272246).withValues(alpha: 0.1), @@ -400,8 +396,8 @@ class PageStats extends GetView { onTap: () => GetNavigate.offNamedUntil(GetRoutes.home), child: Image.asset( 'lib/assets/images/tabbar/home.png', - width: 640.wmax * 28.sr, - height: 640.wmax * 28.sr, + width: 28.vp, + height: 28.vp, fit: BoxFit.fill, ), ), @@ -410,8 +406,8 @@ class PageStats extends GetView { onTap: () => {}, child: Image.asset( 'lib/assets/images/tabbar/chart_select.png', - width: 640.wmax * 28.sr, - height: 640.wmax * 28.sr, + width: 28.vp, + height: 28.vp, fit: BoxFit.fill, ), ), @@ -420,8 +416,8 @@ class PageStats extends GetView { onTap: () => GetNavigate.toNamed(GetRoutes.notification), child: Image.asset( 'lib/assets/images/tabbar/notification.png', - width: 640.wmax * 28.sr, - height: 640.wmax * 28.sr, + width: 28.vp, + height: 28.vp, fit: BoxFit.fill, ), ), @@ -430,8 +426,8 @@ class PageStats extends GetView { onTap: () => GetNavigate.toNamed(GetRoutes.settings), child: Image.asset( 'lib/assets/images/tabbar/settings.png', - width: 640.wmax * 28.sr, - height: 640.wmax * 28.sr, + width: 28.vp, + height: 28.vp, fit: BoxFit.fill, ), ), @@ -457,20 +453,20 @@ class PageStats extends GetView { final mediaPadding = controller.mediaPadding; if (!isPortrait.value) { - top = 640.wmax * 10.sr; - left = max(640.wmax * 15.sr, mediaPadding.value.left); - right = max(640.wmax * 15.sr, mediaPadding.value.top); + top = 10.vp; + left = max(15.vp, mediaPadding.value.left); + right = max(15.vp, mediaPadding.value.top); width = 100.vw; height = 100.vh; - bottom = 640.wmax * 20.sr; + bottom = 20.vp; } if (isPortrait.value) { - top = max(30.wdp, mediaPadding.value.top + 10.wdp); - left = 25.wdp; - right = 25.wdp; + top = max(30.vp, mediaPadding.value.top + 10.vp); + left = 25.vp; + right = 25.vp; width = 100.vw; - height = 165.wdp + top; + height = 165.vp + top; bottom = 0.0; } @@ -487,17 +483,17 @@ class PageStats extends GetView { fit: StackFit.expand, children: [ Positioned( - top: 640.wmax * 10.sr, - left: 640.wmax * 3.sr, + top: 10.vp, + left: 3.vp, child: Container( - height: 640.wmax * 22.sr, + height: 22.vp, alignment: Alignment.centerLeft, child: Text( 'Balance'.tr, style: TextStyle( - fontSize: 640.wmax * 18.sr, - fontWeight: FontWeight.w600, color: Color(0xff130138), + fontWeight: FontWeight.w600, + fontSize: 18.fp, ), ), ), @@ -536,7 +532,7 @@ class PageStats extends GetView { isCurved: true, isStrokeCapRound: true, color: Color(0xff8438ff), - barWidth: 640.wmax * 2.0.sr, + barWidth: 2.0.vp, showingIndicators: showings.value, dotData: const FlDotData(show: false), belowBarData: BarAreaData( @@ -580,26 +576,26 @@ class PageStats extends GetView { sideTitles: SideTitles( interval: 1, showTitles: true, - reservedSize: 640.wmax * 20.sr, + reservedSize: 20.vp, getTitlesWidget: (value, meta) { var index = value.toInt(); var year = years.value[index]; var padding = EdgeInsets.zero; if (value < (maxX - minX) / 2) { - padding = EdgeInsets.only(left: 12.wdp); + padding = EdgeInsets.only(left: 12.vp); } if (value > (maxX - minX) / 2) { - padding = EdgeInsets.only(right: 12.wdp); + padding = EdgeInsets.only(right: 12.vp); } if (value == minX) { - padding = EdgeInsets.only(left: 30.wdp); + padding = EdgeInsets.only(left: 30.vp); } if (value == maxX) { - padding = EdgeInsets.only(right: 30.wdp); + padding = EdgeInsets.only(right: 30.vp); } return SideTitleWidget( @@ -611,9 +607,9 @@ class PageStats extends GetView { child: Text( '$year', style: TextStyle( - fontWeight: FontWeight.w500, - fontSize: 640.wmax * 12.sr, color: Color(0xff8b98b1), + fontWeight: FontWeight.w500, + fontSize: 12.fp, ), ), ), @@ -626,7 +622,7 @@ class PageStats extends GetView { lineTouchData: LineTouchData( enabled: true, handleBuiltInTouches: false, - touchSpotThreshold: 640.wmax * 20.sr, + touchSpotThreshold: 20.vp, getTouchedSpotIndicator: (barData, spotIndexes) { final indicators = spotIndexes.map( (index) => TouchedSpotIndicatorData( @@ -635,10 +631,10 @@ class PageStats extends GetView { show: true, getDotPainter: (spot, percent, barData, index) { return FlDotCirclePainter( - radius: 640.wmax * 6.sr, + radius: 6.vp, color: Color(0xff8438ff), strokeColor: Colors.white, - strokeWidth: 640.wmax * 1.5.sr, + strokeWidth: 1.5.vp, ); }, ), @@ -649,10 +645,10 @@ class PageStats extends GetView { touchTooltipData: LineTouchTooltipData( fitInsideVertically: true, fitInsideHorizontally: true, - tooltipBorderRadius: BorderRadius.circular(640.wmax * 8.sr), + tooltipBorderRadius: BorderRadius.circular(8.vp), tooltipPadding: EdgeInsets.symmetric( - horizontal: 640.wmax * 7.sr, - vertical: 640.wmax * 4.sr, + horizontal: 7.vp, + vertical: 4.vp, ), getTooltipItems: (List lineBarsSpot) { return lineBarsSpot.map((lineBarSpot) { @@ -660,8 +656,8 @@ class PageStats extends GetView { lineBarSpot.y.usd, TextStyle( color: Colors.white, - fontSize: 640.wmax * 13.6.sr, fontWeight: FontWeight.w500, + fontSize: 13.6.fp, ), ); }).toList(); diff --git a/lib/pages/webview/_popup.dart b/lib/pages/webview/_popup.dart index f876a9a..2c426cf 100644 --- a/lib/pages/webview/_popup.dart +++ b/lib/pages/webview/_popup.dart @@ -85,7 +85,7 @@ class PageWebviewPopupState extends State with SingleTicker { right: 0, bottom: 0, child: Obx(() { - if (mediaHeight.value <= 350.wdp) { + if (mediaHeight.value <= 350.vp) { return const SizedBox.shrink(); } @@ -129,11 +129,11 @@ class PageWebviewPopupState extends State with SingleTicker { bottom: (animation.value - 1) * 420, child: Container( decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(640.wmax * 15.sr)), + borderRadius: BorderRadius.all(Radius.circular(15.vp)), color: const Color(0xffebebeb), ), child: Padding( - padding: EdgeInsets.all(640.wmax * 15.sr), + padding: EdgeInsets.all(15.vp), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -143,18 +143,15 @@ class PageWebviewPopupState extends State with SingleTicker { crossAxisAlignment: CrossAxisAlignment.center, children: [ Padding( - padding: EdgeInsets.only( - left: 640.wmax * 8.sr, - right: 640.wmax * 8.sr, - ), + padding: EdgeInsets.only(left: 8.vp, right: 8.vp), child: Text( 'Webview_Settings'.tr, style: TextStyle( color: const Color(0xff303133), - letterSpacing: max(640.wmax * 1.2.sr, 1.2), + letterSpacing: max(1.2.vp, 1.2), decoration: TextDecoration.none, fontWeight: FontWeight.bold, - fontSize: 640.wmax * 16.sr, + fontSize: 16.fp, ), ), ), @@ -162,22 +159,20 @@ class PageWebviewPopupState extends State with SingleTicker { ), Container( height: .5, - margin: EdgeInsets.symmetric(vertical: 640.wmax * 15.sr), + margin: EdgeInsets.symmetric(vertical: 15.vp), color: const Color(0xffcfcfcf), ), Container( - constraints: BoxConstraints( - minHeight: min(640.wmax * 150.sr, 30.vh), - ), + constraints: BoxConstraints(minHeight: min(150.vp, 30.vh)), child: GridView.builder( shrinkWrap: true, itemCount: panelList.length, - padding: EdgeInsets.all(640.wmax * 3.sr), + padding: EdgeInsets.all(3.vp), physics: const NeverScrollableScrollPhysics(), gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent( - maxCrossAxisExtent: 640.wmax * 66.sr, - crossAxisSpacing: 640.wmax * 15.sr, - mainAxisSpacing: 640.wmax * 15.sr, + maxCrossAxisExtent: 66.vp, + crossAxisSpacing: 15.vp, + mainAxisSpacing: 15.vp, childAspectRatio: 0.60, ), itemBuilder: (context, index) { @@ -187,7 +182,7 @@ class PageWebviewPopupState extends State with SingleTicker { ), Container( height: .5, - margin: EdgeInsets.symmetric(vertical: 640.wmax * 15.sr), + margin: EdgeInsets.symmetric(vertical: 15.vp), color: const Color(0xffcfcfcf), ), GestureDetector( @@ -204,10 +199,10 @@ class PageWebviewPopupState extends State with SingleTicker { 'System_Cancel'.tr, style: TextStyle( color: const Color(0xff646e93), - letterSpacing: max(640.wmax * 1.2.sr, 1.2), + letterSpacing: max(1.2.vp, 1.2), decoration: TextDecoration.none, fontWeight: FontWeight.bold, - fontSize: 640.wmax * 16.sr, + fontSize: 16.fp, ), ), ), @@ -265,41 +260,39 @@ class PageWebviewPopupState extends State with SingleTicker { return GestureDetector( child: SizedBox( - width: 640.wmax * 60.sr, + width: 60.vp, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 640.wmax * 56.sr, - height: 640.wmax * 56.sr, + width: 56.vp, + height: 56.vp, alignment: Alignment.center, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(640.wmax * 15.sr), - ), + borderRadius: BorderRadius.all(Radius.circular(15.vp)), color: const Color(0xffffffff), ), child: Image( - width: 640.wmax * 30.sr, - height: 640.wmax * 30.sr, + width: 30.vp, + height: 30.vp, image: AssetImage(image), fit: BoxFit.fill, ), ), Container( - width: 640.wmax * 56.sr, + width: 56.vp, alignment: Alignment.center, - padding: EdgeInsets.only(top: 640.wmax * 9.sr), + padding: EdgeInsets.only(top: 9.vp), child: Text( title, style: TextStyle( - height: 1.1, - fontSize: 640.wmax * 10.sr, - fontWeight: FontWeight.w600, + color: const Color(0xff606266), overflow: TextOverflow.ellipsis, decoration: TextDecoration.none, - color: const Color(0xff606266), + fontWeight: FontWeight.w600, + fontSize: 10.fp, + height: 1.1, ), textAlign: TextAlign.center, maxLines: 2, diff --git a/lib/pages/webview/_scaffold.dart b/lib/pages/webview/_scaffold.dart index 47dbdfa..90a9217 100644 --- a/lib/pages/webview/_scaffold.dart +++ b/lib/pages/webview/_scaffold.dart @@ -4,6 +4,7 @@ import 'package:url_launcher/url_launcher.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:dompet/pages/webview/controller.dart'; import 'package:dompet/extension/bool.dart'; +import 'package:dompet/extension/size.dart'; import 'package:dompet/utils/empty.dart'; class PageWebviewScaffold extends StatefulWidget { @@ -200,10 +201,10 @@ class PageWebviewScaffoldState extends State { child: Text( 'Webview_Loading'.tr, style: TextStyle( - fontSize: 14, + color: Color(0xff707177), fontWeight: FontWeight.w600, letterSpacing: 1.5, - color: Color(0xff707177), + fontSize: 14.fp, ), ), ), diff --git a/lib/theme/light.dart b/lib/theme/light.dart index d031193..70b03b8 100644 --- a/lib/theme/light.dart +++ b/lib/theme/light.dart @@ -1,11 +1,12 @@ import 'package:flutter/material.dart'; +import 'package:dompet/extension/size.dart'; final ThemeData lightTheme = ThemeData( - appBarTheme: const AppBarTheme( + appBarTheme: AppBarTheme( titleTextStyle: TextStyle( color: Color(0xff000000), fontWeight: FontWeight.bold, - fontSize: 18.0, + fontSize: 18.fp, ), scrolledUnderElevation: 0.0, backgroundColor: Colors.white, diff --git a/pubspec.lock b/pubspec.lock index bd4b023..af2fa48 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "23d16f00a2da8ffa997c782453c73867b0609bd90435195671a54de38a3566df" + sha256: "8a1f5f3020ef2a74fb93f7ab3ef127a8feea33a7a2276279113660784ee7516a" url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.62" + version: "1.3.64" app_links: dependency: "direct main" description: @@ -213,18 +213,18 @@ packages: dependency: transitive description: name: cross_file - sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + sha256: "942a4791cd385a68ccb3b32c71c427aba508a1bb949b86dff2adbe4049f16239" url: "https://pub.flutter-io.cn" source: hosted - version: "0.3.4+2" + version: "0.3.5" crypto: dependency: "direct main" description: name: crypto - sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.6" + version: "3.0.7" cupertino_icons: dependency: "direct main" description: @@ -309,18 +309,18 @@ packages: dependency: transitive description: name: file_selector_macos - sha256: "19124ff4a3d8864fdc62072b6a2ef6c222d55a3404fe14893a3c02744907b60c" + sha256: "88707a3bec4b988aaed3b4df5d7441ee4e987f20b286cddca5d6a8270cab23f2" url: "https://pub.flutter-io.cn" source: hosted - version: "0.9.4+4" + version: "0.9.4+5" file_selector_platform_interface: dependency: transitive description: name: file_selector_platform_interface - sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b + sha256: "35e0bd61ebcdb91a3505813b055b09b79dfdc7d0aee9c09a7ba59ae4bb13dc85" url: "https://pub.flutter-io.cn" source: hosted - version: "2.6.2" + version: "2.7.0" file_selector_windows: dependency: transitive description: @@ -333,50 +333,50 @@ packages: dependency: "direct main" description: name: firebase_auth - sha256: "735f857c9363376eeb585e7ba57e67e5f495202cd3f609902b8769795fd823bc" + sha256: e54fb3ba57de041d832574126a37726eedf0f57400869f1942b0ca8ce4a6e209 url: "https://pub.flutter-io.cn" source: hosted - version: "6.1.0" + version: "6.1.2" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface - sha256: "5badda0ea5048ffbb1726169cf5530539490de8055c3bd43f4f9cd5fcef8e556" + sha256: "421f95dc553cb283ed9d4d140e719800c0331d49ed37b962e513c9d1d61b090b" url: "https://pub.flutter-io.cn" source: hosted - version: "8.1.2" + version: "8.1.4" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - sha256: "07c889d2c56e648ed30225e819801d7e45542747a658d9c385520de35d312dec" + sha256: a064ffee202f7d42d62e2c01775899d4ffcb83c602af07632f206acd46a0964e url: "https://pub.flutter-io.cn" source: hosted - version: "6.0.3" + version: "6.1.0" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: "4dd96f05015c0dcceaa47711394c32971aee70169625d5e2477e7676c01ce0ee" + sha256: "1f2dfd9f535d81f8b06d7a50ecda6eac1e6922191ed42e09ca2c84bd2288927c" url: "https://pub.flutter-io.cn" source: hosted - version: "4.1.1" + version: "4.2.1" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - sha256: "5873a370f0d232918e23a5a6137dbe4c2c47cf017301f4ea02d9d636e52f60f0" + sha256: cccb4f572325dc14904c02fcc7db6323ad62ba02536833dddb5c02cac7341c64 url: "https://pub.flutter-io.cn" source: hosted - version: "6.0.1" + version: "6.0.2" firebase_core_web: dependency: transitive description: name: firebase_core_web - sha256: "61a51037312dac781f713308903bb7a1762a7f92f7bc286a3a0947fb2a713b82" + sha256: ff18fabb0ad0ed3595d2f2c85007ecc794aadecdff5b3bb1460b7ee47cded398 url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.1" + version: "3.3.0" fixnum: dependency: transitive description: @@ -487,18 +487,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: b0694b7fb1689b0e6cc193b3f1fcac6423c4f93c74fb20b806c6b6f196db0c31 - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.30" - flutter_ringtone_player: - dependency: "direct main" - description: - name: flutter_ringtone_player - sha256: f2bf99cf984d754a56bc8ac365eeef8c609450ff4f7cfdfa7bd21b0416717840 + sha256: "306f0596590e077338312f38837f595c04f28d6cdeeac392d3d74df2f0003687" url: "https://pub.flutter-io.cn" source: hosted - version: "5.0.0-dev.1" + version: "2.0.32" flutter_test: dependency: "direct dev" description: flutter @@ -561,18 +553,18 @@ packages: dependency: transitive description: name: google_sign_in_android - sha256: "7abdfa0088dc8f7d08eb3dbb1665a72bcb5b37afa256c9ec5d21e1e2d7503e5c" + sha256: "80edba834ae30b058eaeef086e1dc68189b6e49db20ae85b309adfa2fa6d9b02" url: "https://pub.flutter-io.cn" source: hosted - version: "7.2.0" + version: "7.2.4" google_sign_in_ios: dependency: transitive description: name: google_sign_in_ios - sha256: d9d80f953a244a099a40df1ff6aadc10ee375e6a098bbd5d55be332ce26db18c + sha256: "0ba0b276c91e80edbe28570ee8c54237c095dd7b909db46011154a49f3af68a7" url: "https://pub.flutter-io.cn" source: hosted - version: "6.2.1" + version: "6.2.3" google_sign_in_platform_interface: dependency: transitive description: @@ -601,10 +593,10 @@ packages: dependency: "direct main" description: name: http - sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007 + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" url: "https://pub.flutter-io.cn" source: hosted - version: "1.5.0" + version: "1.6.0" http_parser: dependency: transitive description: @@ -625,18 +617,18 @@ packages: dependency: "direct main" description: name: image_picker - sha256: "736eb56a911cf24d1859315ad09ddec0b66104bc41a7f8c5b96b4e2620cf5041" + sha256: "784210112be18ea55f69d7076e2c656a4e24949fa9e76429fe53af0c0f4fa320" url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "1.2.1" image_picker_android: dependency: transitive description: name: image_picker_android - sha256: "8dfe08ea7fcf7467dbaf6889e72eebd5e0d6711caae201fdac780eb45232cd02" + sha256: ca2a3b04d34e76157e9ae680ef16014fb4c2d20484e78417eaed6139330056f6 url: "https://pub.flutter-io.cn" source: hosted - version: "0.8.13+3" + version: "0.8.13+7" image_picker_for_web: dependency: transitive description: @@ -649,10 +641,10 @@ packages: dependency: transitive description: name: image_picker_ios - sha256: eb06fe30bab4c4497bad449b66448f50edcc695f1c59408e78aa3a8059eb8f0e + sha256: e675c22790bcc24e9abd455deead2b7a88de4b79f7327a281812f14de1a56f58 url: "https://pub.flutter-io.cn" source: hosted - version: "0.8.13" + version: "0.8.13+1" image_picker_linux: dependency: transitive description: @@ -665,18 +657,18 @@ packages: dependency: transitive description: name: image_picker_macos - sha256: d58cd9d67793d52beefd6585b12050af0a7663c0c2a6ece0fb110a35d6955e04 + sha256: "86f0f15a309de7e1a552c12df9ce5b59fe927e71385329355aec4776c6a8ec91" url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.2" + version: "0.2.2+1" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - sha256: "9f143b0dba3e459553209e20cc425c9801af48e6dfa4f01a0fcf927be3f41665" + sha256: "567e056716333a1647c64bb6bd873cff7622233a5c3f694be28a583d4715690c" url: "https://pub.flutter-io.cn" source: hosted - version: "2.11.0" + version: "2.11.1" image_picker_windows: dependency: transitive description: @@ -689,10 +681,10 @@ packages: dependency: "direct main" description: name: internet_connection_checker_plus - sha256: c05c34d3b9fac404c56139864545b11a643cfc16c88874878392a699cbbdb5c5 + sha256: "66dc124f9b58a630844f61c1ae6f01f100f5fe63d9410506218d81d93d86ead3" url: "https://pub.flutter-io.cn" source: hosted - version: "2.9.0" + version: "2.9.1" intl: dependency: "direct main" description: @@ -753,10 +745,10 @@ packages: dependency: "direct main" description: name: logger - sha256: "55d6c23a6c15db14920e037fe7e0dc32e7cdaf3b64b4b25df2d541b5b6b81c0c" + sha256: a7967e31b703831a893bbc3c3dd11db08126fe5f369b5c648a36f821979f5be3 url: "https://pub.flutter-io.cn" source: hosted - version: "2.6.1" + version: "2.6.2" matcher: dependency: transitive description: @@ -777,10 +769,10 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.flutter-io.cn" source: hosted - version: "1.16.0" + version: "1.17.0" mime: dependency: transitive description: @@ -793,10 +785,10 @@ packages: dependency: "direct main" description: name: mobile_scanner - sha256: "5e7e09d904dc01de071b79b3f3789b302b0ed3c9c963109cd3f83ad90de62ecf" + sha256: "023a71afb4d7cfb5529d0f2636aa8b43db66257905b9486d702085989769c5f2" url: "https://pub.flutter-io.cn" source: hosted - version: "7.1.2" + version: "7.1.3" nm: dependency: transitive description: @@ -825,18 +817,18 @@ packages: dependency: transitive description: name: path_provider_android - sha256: "993381400e94d18469750e5b9dcb8206f15bc09f9da86b9e44a9b0092a0066db" + sha256: e122c5ea805bb6773bb12ce667611265980940145be920cd09a4b0ec0285cb16 url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.18" + version: "2.2.20" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "16eef174aacb07e09c351502740fa6254c165757638eba1e9116b0a781201bbd" + sha256: efaec349ddfc181528345c56f8eda9d6cccd71c177511b132c6a0ddaefaa2738 url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.2" + version: "2.4.3" path_provider_linux: dependency: transitive description: @@ -949,6 +941,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "6.0.3" + preact_signals: + dependency: transitive + description: + name: preact_signals + sha256: "8bf3cec7fe784d224f1a1132ae7b2f9f3852609046ccb71c4f450a13dd811abf" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.9.3" responsive_framework: dependency: "direct main" description: @@ -961,10 +961,10 @@ packages: dependency: "direct main" description: name: share_plus - sha256: "3424e9d5c22fd7f7590254ba09465febd6f8827c8b19a44350de4ac31d92d3a6" + sha256: "14c8860d4de93d3a7e53af51bff479598c4e999605290756bbbe45cf65b37840" url: "https://pub.flutter-io.cn" source: hosted - version: "12.0.0" + version: "12.0.1" share_plus_platform_interface: dependency: transitive description: @@ -973,6 +973,30 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "6.1.0" + signals: + dependency: "direct main" + description: + name: signals + sha256: a7f5fea3f27708b2705cff501aa0eb32f893552943a7fa8b2851401164459d13 + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.2.0" + signals_core: + dependency: transitive + description: + name: signals_core + sha256: "10e527cda3c400703e4156da16aeaea274644ecb7db11abeec7dc7cc9bec9abd" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.2.0" + signals_flutter: + dependency: transitive + description: + name: signals_flutter + sha256: d04c973e3feeaddd7d8428f3a8af911297febb3c083091217e1a1fc0c4d6504f + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.2.0" sky_engine: dependency: transitive description: flutter @@ -986,14 +1010,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.10.1" - sprintf: - dependency: transitive - description: - name: sprintf - sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" - url: "https://pub.flutter-io.cn" - source: hosted - version: "7.0.0" sqflite: dependency: "direct main" description: @@ -1078,10 +1094,10 @@ packages: dependency: transitive description: name: test_api - sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.flutter-io.cn" source: hosted - version: "0.7.6" + version: "0.7.7" typed_data: dependency: transitive description: @@ -1102,18 +1118,18 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: "199bc33e746088546a39cc5f36bac5a278c5e53b40cb3196f99e7345fdcfae6b" + sha256: "5c8b6c2d89a78f5a1cca70a73d9d5f86c701b36b42f9c9dac7bad592113c28e9" url: "https://pub.flutter-io.cn" source: hosted - version: "6.3.22" + version: "6.3.24" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: d80b3f567a617cb923546034cc94bfe44eb15f989fe670b37f26abdb9d939cb7 + sha256: "6b63f1441e4f653ae799166a72b50b1767321ecc263a57aadf825a7a2a5477d9" url: "https://pub.flutter-io.cn" source: hosted - version: "6.3.4" + version: "6.3.5" url_launcher_linux: dependency: transitive description: @@ -1126,10 +1142,10 @@ packages: dependency: transitive description: name: url_launcher_macos - sha256: c043a77d6600ac9c38300567f33ef12b0ef4f4783a2c1f00231d2b1941fea13f + sha256: "8262208506252a3ed4ff5c0dc1e973d2c0e0ef337d0a074d35634da5d44397c9" url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.3" + version: "3.2.4" url_launcher_platform_interface: dependency: transitive description: @@ -1158,10 +1174,10 @@ packages: dependency: transitive description: name: uuid - sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8 url: "https://pub.flutter-io.cn" source: hosted - version: "4.5.1" + version: "4.5.2" vector_math: dependency: transitive description: @@ -1206,10 +1222,10 @@ packages: dependency: transitive description: name: win32 - sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03" + sha256: d7cb55e04cd34096cd3a79b3330245f54cb96a370a1c27adb3c84b917de8b08e url: "https://pub.flutter-io.cn" source: hosted - version: "5.14.0" + version: "5.15.0" xdg_directories: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 8b1a5f9..bc60473 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,37 +18,37 @@ dependencies: get: ^5.0.0-release-candidate-9.3.2 flutter_inappwebview: ^6.2.0-beta.2 - internet_connection_checker_plus: ^2.9.0 - flutter_ringtone_player: ^5.0.0-dev.1 + internet_connection_checker_plus: ^2.9.1 flutter_launcher_icons: ^0.14.4 responsive_framework: ^1.5.1 permission_handler: ^12.0.1 web_socket_channel: ^3.0.3 connectivity_plus: ^7.0.0 cupertino_icons: ^1.0.8 - mobile_scanner: ^7.1.2 + mobile_scanner: ^7.1.3 auto_size_text: ^3.0.0 google_sign_in: ^7.2.0 - firebase_core: ^4.1.1 - firebase_auth: ^6.1.0 + firebase_core: ^4.2.1 + firebase_auth: ^6.1.2 path_provider: ^2.1.5 synchronized: ^3.4.0 fluttertoast: ^9.0.0 google_fonts: ^6.3.2 url_launcher: ^6.3.2 - image_picker: ^1.2.0 + image_picker: ^1.2.1 audioplayers: ^6.5.1 get_storage: ^2.1.1 - share_plus: ^12.0.0 + share_plus: ^12.0.1 app_links: ^6.4.1 fl_chart: ^1.1.1 + signals: ^6.2.0 sqflite: ^2.4.2 convert: ^3.1.2 encrypt: ^5.0.3 - crypto: ^3.0.6 - logger: ^2.6.1 + crypto: ^3.0.7 + logger: ^2.6.2 intl: ^0.20.2 - http: ^1.5.0 + http: ^1.6.0 path: ^1.9.1 dio: ^5.9.0