mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
feature: Added update notification and download links per platform (#362)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
5ef7936c33
commit
2c71dde228
16 changed files with 712 additions and 8 deletions
|
|
@ -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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue