feature: Added update notification and download links per platform (#362)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2025-06-01 21:36:50 +02:00 committed by GitHub
parent 5ef7936c33
commit 2c71dde228
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 712 additions and 8 deletions

View file

@ -2,20 +2,25 @@ import 'package:flutter/material.dart';
import 'package:auto_route/auto_route.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:iconsax_plus/iconsax_plus.dart';
import 'package:fladder/providers/update_provider.dart';
import 'package:fladder/providers/user_provider.dart';
import 'package:fladder/routes/auto_router.gr.dart';
import 'package:fladder/screens/shared/flat_button.dart';
import 'package:fladder/screens/shared/user_icon.dart';
import 'package:fladder/util/adaptive_layout/adaptive_layout.dart';
import 'package:fladder/util/localization_helper.dart';
import 'package:fladder/util/theme_extensions.dart';
class SettingsUserIcon extends ConsumerWidget {
const SettingsUserIcon({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final size = 24.0;
final user = ref.watch(userProvider);
final hasNewUpdate = ref.watch(hasNewUpdateProvider);
return Tooltip(
message: context.localized.settings,
waitDuration: const Duration(seconds: 1),
@ -28,9 +33,35 @@ class SettingsUserIcon extends ConsumerWidget {
context.router.push(const ClientSettingsRoute());
}
},
child: UserIcon(
user: user,
cornerRadius: 200,
child: Stack(
alignment: Alignment.bottomRight,
children: [
UserIcon(
user: user,
cornerRadius: 200,
),
if (hasNewUpdate)
Transform.translate(
offset: Offset(size / 4, size / 4),
child: Container(
width: size,
height: size,
decoration: BoxDecoration(
color: context.colors.surface,
shape: BoxShape.circle,
),
child: Padding(
padding: const EdgeInsets.all(2),
child: FittedBox(
child: Icon(
IconsaxPlusBold.information,
color: context.colors.primary,
),
),
),
),
)
],
),
),
);

View file

@ -221,7 +221,7 @@ class _SideNavigationBarState extends ConsumerState<SideNavigationBar> {
selectedIcon: const Icon(IconsaxPlusBold.setting_3),
horizontal: true,
expanded: shouldExpand,
icon: const SizedBox(height: 32, child: SettingsUserIcon()),
icon: const SettingsUserIcon(),
onPressed: () {
if (AdaptiveLayout.layoutModeOf(context) == LayoutMode.single) {
context.router.push(const SettingsRoute());