From 3672cc54e7f2341343751834db88674a5021a5bb Mon Sep 17 00:00:00 2001 From: dwindown Date: Thu, 2 Apr 2026 06:13:53 +0700 Subject: [PATCH] fix(admin): make action surfaces tappable and simplify version display --- lib/features/admin/admin_screen.dart | 179 +++++++++++++++------------ pubspec.yaml | 2 +- 2 files changed, 104 insertions(+), 77 deletions(-) diff --git a/lib/features/admin/admin_screen.dart b/lib/features/admin/admin_screen.dart index 2ab3952..dc4ae5c 100644 --- a/lib/features/admin/admin_screen.dart +++ b/lib/features/admin/admin_screen.dart @@ -2357,33 +2357,41 @@ class _AdminScreenState extends ConsumerState { scale: isFocused ? 1.01 : 1.0, duration: const Duration(milliseconds: 140), curve: Curves.easeOutCubic, - child: AnimatedContainer( - duration: const Duration(milliseconds: 140), - curve: Curves.easeOutCubic, - padding: EdgeInsets.all(isFocused ? 5 * s : 0), - decoration: BoxDecoration( - color: isFocused - ? SacredColors.surfaceContainerLow.withValues(alpha: 0.96) - : Colors.transparent, + child: Material( + color: Colors.transparent, + borderRadius: BorderRadius.circular(SacredRadii.lg), + child: InkWell( + onTap: onActivate, borderRadius: BorderRadius.circular(SacredRadii.lg), - border: Border.all( - color: isFocused - ? SacredColors.primary.withValues(alpha: 0.95) - : Colors.transparent, - width: isFocused ? 3 : 0, + child: AnimatedContainer( + duration: const Duration(milliseconds: 140), + curve: Curves.easeOutCubic, + padding: EdgeInsets.all(isFocused ? 5 * s : 0), + decoration: BoxDecoration( + color: isFocused + ? SacredColors.surfaceContainerLow.withValues(alpha: 0.96) + : Colors.transparent, + borderRadius: BorderRadius.circular(SacredRadii.lg), + border: Border.all( + color: isFocused + ? SacredColors.primary.withValues(alpha: 0.95) + : Colors.transparent, + width: isFocused ? 3 : 0, + ), + boxShadow: isFocused + ? [ + BoxShadow( + color: SacredColors.primary.withValues(alpha: 0.28), + blurRadius: 24 * s, + spreadRadius: 2 * s, + ), + ] + : null, + ), + child: ExcludeFocus( + child: builder?.call(isFocused) ?? child!, + ), ), - boxShadow: isFocused - ? [ - BoxShadow( - color: SacredColors.primary.withValues(alpha: 0.28), - blurRadius: 24 * s, - spreadRadius: 2 * s, - ), - ] - : null, - ), - child: ExcludeFocus( - child: builder?.call(isFocused) ?? child!, ), ), ); @@ -2420,32 +2428,40 @@ class _AdminScreenState extends ConsumerState { scale: isFocused ? 1.01 : 1.0, duration: const Duration(milliseconds: 140), curve: Curves.easeOutCubic, - child: AnimatedContainer( - duration: const Duration(milliseconds: 140), - curve: Curves.easeOutCubic, - padding: EdgeInsets.all(isFocused ? 5 * s : 0), - decoration: BoxDecoration( - color: isFocused - ? SacredColors.surfaceContainerLow.withValues(alpha: 0.96) - : Colors.transparent, + child: Material( + color: Colors.transparent, + borderRadius: BorderRadius.circular(SacredRadii.lg), + child: InkWell( + onTap: onActivate, borderRadius: BorderRadius.circular(SacredRadii.lg), - border: Border.all( - color: isFocused - ? SacredColors.primary.withValues(alpha: 0.95) - : Colors.transparent, - width: isFocused ? 3 : 0, + child: AnimatedContainer( + duration: const Duration(milliseconds: 140), + curve: Curves.easeOutCubic, + padding: EdgeInsets.all(isFocused ? 5 * s : 0), + decoration: BoxDecoration( + color: isFocused + ? SacredColors.surfaceContainerLow.withValues(alpha: 0.96) + : Colors.transparent, + borderRadius: BorderRadius.circular(SacredRadii.lg), + border: Border.all( + color: isFocused + ? SacredColors.primary.withValues(alpha: 0.95) + : Colors.transparent, + width: isFocused ? 3 : 0, + ), + boxShadow: isFocused + ? [ + BoxShadow( + color: SacredColors.primary.withValues(alpha: 0.28), + blurRadius: 24 * s, + spreadRadius: 2 * s, + ), + ] + : null, + ), + child: builder != null ? builder(isFocused) : child!, ), - boxShadow: isFocused - ? [ - BoxShadow( - color: SacredColors.primary.withValues(alpha: 0.28), - blurRadius: 24 * s, - spreadRadius: 2 * s, - ), - ] - : null, ), - child: builder != null ? builder(isFocused) : child!, ), ); }, @@ -2481,33 +2497,41 @@ class _AdminScreenState extends ConsumerState { scale: isFocused ? 1.01 : 1.0, duration: const Duration(milliseconds: 140), curve: Curves.easeOutCubic, - child: AnimatedContainer( - duration: const Duration(milliseconds: 140), - curve: Curves.easeOutCubic, - padding: EdgeInsets.all(isFocused ? 5 * s : 0), - decoration: BoxDecoration( - color: isFocused - ? SacredColors.surfaceContainerLow.withValues(alpha: 0.96) - : Colors.transparent, + child: Material( + color: Colors.transparent, + borderRadius: BorderRadius.circular(SacredRadii.lg), + child: InkWell( + onTap: onActivate, borderRadius: BorderRadius.circular(SacredRadii.lg), - border: Border.all( - color: isFocused - ? SacredColors.primary.withValues(alpha: 0.95) - : Colors.transparent, - width: isFocused ? 3 : 0, + child: AnimatedContainer( + duration: const Duration(milliseconds: 140), + curve: Curves.easeOutCubic, + padding: EdgeInsets.all(isFocused ? 5 * s : 0), + decoration: BoxDecoration( + color: isFocused + ? SacredColors.surfaceContainerLow.withValues(alpha: 0.96) + : Colors.transparent, + borderRadius: BorderRadius.circular(SacredRadii.lg), + border: Border.all( + color: isFocused + ? SacredColors.primary.withValues(alpha: 0.95) + : Colors.transparent, + width: isFocused ? 3 : 0, + ), + boxShadow: isFocused + ? [ + BoxShadow( + color: SacredColors.primary.withValues(alpha: 0.28), + blurRadius: 24 * s, + spreadRadius: 2 * s, + ), + ] + : null, + ), + child: ExcludeFocus( + child: builder?.call(isFocused) ?? child!, + ), ), - boxShadow: isFocused - ? [ - BoxShadow( - color: SacredColors.primary.withValues(alpha: 0.28), - blurRadius: 24 * s, - spreadRadius: 2 * s, - ), - ] - : null, - ), - child: ExcludeFocus( - child: builder?.call(isFocused) ?? child!, ), ), ); @@ -3822,7 +3846,7 @@ class _AdminScreenState extends ConsumerState { SizedBox(height: 20 * s), _buildStatusRow( 'Versi Saat Ini', - currentVersion?.displayLabel ?? 'Memuat versi...', + currentVersion?.versionName ?? 'Memuat versi...', HugeIcons.strokeRoundedPackage, s, ), @@ -3850,7 +3874,7 @@ class _AdminScreenState extends ConsumerState { SizedBox(height: 20 * s), _buildStatusRow( 'Versi Remote', - '${remote.latestVersion}+${remote.versionCode}', + remote.latestVersion, HugeIcons.strokeRoundedPackage, s, ), @@ -3985,7 +4009,10 @@ class _AdminScreenState extends ConsumerState { if (result.updateAvailable) { final remote = result.remote; if (remote == null) return 'Update tersedia'; - return 'Update tersedia ke ${remote.latestVersion}+${remote.versionCode}'; + if (remote.latestVersion == result.current.versionName) { + return 'Update build tersedia untuk versi ${remote.latestVersion}'; + } + return 'Update tersedia ke ${remote.latestVersion}'; } return 'Versi ini sudah terbaru'; } diff --git a/pubspec.yaml b/pubspec.yaml index 708cec6..9de9a4f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: jamshalat_masjid_screen description: Smart Digital Prayer Clock for Android TV Box publish_to: 'none' -version: 1.0.1+2 +version: 1.0.2+3 environment: sdk: '>=3.0.0 <4.0.0'