mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 09:16:54 +00:00
feat(ui): Select device icon depending on the platform we are runnning on
This commit is contained in:
parent
9532ddc8af
commit
b4f700d56a
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -12,7 +14,24 @@ class AboutApplicationPage extends StatelessWidget {
|
|||
const AboutApplicationPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(final BuildContext context) => BrandHeroScreen(
|
||||
Widget build(final BuildContext context) {
|
||||
IconData getPlatformIcon() {
|
||||
if (Platform.isAndroid) {
|
||||
return Icons.phone_android_outlined;
|
||||
} else if (Platform.isIOS) {
|
||||
return Icons.phone_iphone_outlined;
|
||||
} else if (Platform.isWindows || Platform.isLinux) {
|
||||
return Icons.desktop_windows_outlined;
|
||||
} else if (Platform.isMacOS) {
|
||||
return Icons.desktop_mac_outlined;
|
||||
} else {
|
||||
return Icons.devices_other_outlined;
|
||||
}
|
||||
}
|
||||
|
||||
final deviceIcon = getPlatformIcon();
|
||||
|
||||
return BrandHeroScreen(
|
||||
hasBackButton: true,
|
||||
hasFlashButton: false,
|
||||
heroTitle: 'about_application_page.title'.tr(),
|
||||
|
@ -36,8 +55,8 @@ class AboutApplicationPage extends StatelessWidget {
|
|||
subtitle: Text(
|
||||
snapshot.data.toString(),
|
||||
),
|
||||
leading: const Icon(
|
||||
Icons.phone_android_outlined,
|
||||
leading: Icon(
|
||||
deviceIcon,
|
||||
),
|
||||
onLongPress: () {
|
||||
PlatformAdapter.setClipboard(
|
||||
|
@ -218,7 +237,7 @@ class AboutApplicationPage extends StatelessWidget {
|
|||
getIt<NavigationService>().showSnackBar(
|
||||
'basis.copied_to_clipboard'.tr(),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
// Telegram
|
||||
ListTile(
|
||||
|
@ -335,8 +354,7 @@ class AboutApplicationPage extends StatelessWidget {
|
|||
),
|
||||
// telegram
|
||||
ListTile(
|
||||
title:
|
||||
Text('about_application_page.telegram_contributors_chat'.tr()),
|
||||
title: Text('about_application_page.telegram_contributors_chat'.tr()),
|
||||
subtitle: const Text('@selfprivacy_dev'),
|
||||
onTap: () => launchUrl(
|
||||
Uri.parse('https://t.me/selfprivacy_dev'),
|
||||
|
@ -356,6 +374,7 @@ class AboutApplicationPage extends StatelessWidget {
|
|||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Future<String> _packageVersion() async {
|
||||
String packageVersion = 'unknown';
|
||||
|
|
Loading…
Reference in a new issue