fix(about): show update action only when update is available
This commit is contained in:
@@ -408,6 +408,11 @@ class _AdminScreenState extends ConsumerState<AdminScreen> {
|
||||
_currentVersion = result.current;
|
||||
_updateCheckResult = result;
|
||||
});
|
||||
if (!result.updateAvailable &&
|
||||
_selectedTab == 5 &&
|
||||
_tentangFocusNodes[1].hasFocus) {
|
||||
_focusTentangRow(0);
|
||||
}
|
||||
_showStatusBadge(
|
||||
result.hasError
|
||||
? result.errorMessage!
|
||||
@@ -1141,7 +1146,7 @@ class _AdminScreenState extends ConsumerState<AdminScreen> {
|
||||
|
||||
void _focusTentangRow(int index) {
|
||||
if (_selectedTab != 5) return;
|
||||
if (index < 0 || index >= _tentangFocusNodes.length) return;
|
||||
if (index < 0 || index >= _tentangRowCount()) return;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) {
|
||||
_tentangFocusNodes[index].requestFocus();
|
||||
@@ -1149,6 +1154,10 @@ class _AdminScreenState extends ConsumerState<AdminScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
int _tentangRowCount() {
|
||||
return (_updateCheckResult?.updateAvailable ?? false) ? 2 : 1;
|
||||
}
|
||||
|
||||
void _focusJadwalRow(int index) {
|
||||
if (_selectedTab != 1) return;
|
||||
if (index < 0 || index >= _jadwalFocusNodes.length) return;
|
||||
@@ -3960,6 +3969,7 @@ class _AdminScreenState extends ConsumerState<AdminScreen> {
|
||||
: 'CEK UPDATE',
|
||||
),
|
||||
),
|
||||
if (updateResult?.updateAvailable ?? false) ...[
|
||||
SizedBox(height: 16 * s),
|
||||
_buildTentangActionButton(
|
||||
rowIndex: 1,
|
||||
@@ -3987,12 +3997,11 @@ class _AdminScreenState extends ConsumerState<AdminScreen> {
|
||||
),
|
||||
label: _isInstallingUpdate
|
||||
? 'MENGUNDUH UPDATE ${(100 * _updateDownloadProgress).toStringAsFixed(0)}%'
|
||||
: (updateResult?.updateAvailable ?? false)
|
||||
? 'UPDATE SEKARANG'
|
||||
: 'BELUM ADA UPDATE',
|
||||
: 'UPDATE SEKARANG',
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: jamshalat_masjid_screen
|
||||
description: Smart Digital Prayer Clock for Android TV Box
|
||||
publish_to: 'none'
|
||||
version: 1.0.3+4
|
||||
version: 1.0.4+5
|
||||
|
||||
environment:
|
||||
sdk: '>=3.0.0 <4.0.0'
|
||||
|
||||
Reference in New Issue
Block a user