mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat: improved update messaging on app bar server info (#22938)
* feat: improved update messaging on app bar server info * chore: message improvements * chore: failed to fetch version error message * feat: open latest release when tapping "Update" on server out of date message * fix: text alignment states * chore: code review updates * Apply suggestion from @alextran1502 Co-authored-by: Alex <alex.tran1502@gmail.com> * Apply suggestion from @alextran1502 Co-authored-by: Alex <alex.tran1502@gmail.com> * chore: lots of rework of the version checking code to be cleaner Added a semver utility class to simplify comparisons, broke the update notification logic into own widget, reworked view construction and colors. * fix: show warnign without having to tap on app bar icon * chore: colors --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
6f31f27218
commit
23a34bee6f
11 changed files with 226 additions and 128 deletions
|
|
@ -118,8 +118,10 @@ class _ProfileIndicator extends ConsumerWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final ServerInfo serverInfoState = ref.watch(serverInfoProvider);
|
||||
final user = ref.watch(currentUserProvider);
|
||||
final bool versionWarningPresent = ref.watch(versionWarningPresentProvider(user));
|
||||
final serverInfoState = ref.watch(serverInfoProvider);
|
||||
|
||||
const widgetSize = 30.0;
|
||||
|
||||
void toggleReadonlyMode() {
|
||||
|
|
@ -143,13 +145,21 @@ class _ProfileIndicator extends ConsumerWidget {
|
|||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
child: Badge(
|
||||
label: Container(
|
||||
decoration: BoxDecoration(color: Colors.black, borderRadius: BorderRadius.circular(widgetSize / 2)),
|
||||
child: const Icon(Icons.info, color: Color.fromARGB(255, 243, 188, 106), size: widgetSize / 2),
|
||||
decoration: BoxDecoration(
|
||||
color: context.isDarkTheme ? Colors.black : Colors.white,
|
||||
borderRadius: BorderRadius.circular(widgetSize / 2),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.info,
|
||||
color: serverInfoState.versionStatus == VersionStatus.error
|
||||
? context.colorScheme.error
|
||||
: context.primaryColor,
|
||||
size: widgetSize / 2,
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
alignment: Alignment.bottomRight,
|
||||
isLabelVisible:
|
||||
serverInfoState.isVersionMismatch || ((user?.isAdmin ?? false) && serverInfoState.isNewReleaseAvailable),
|
||||
isLabelVisible: versionWarningPresent,
|
||||
offset: const Offset(-2, -12),
|
||||
child: user == null
|
||||
? const Icon(Icons.face_outlined, size: widgetSize)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue