mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 17:26:35 +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:auto_route/auto_route.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -12,7 +14,24 @@ class AboutApplicationPage extends StatelessWidget {
|
||||||
const AboutApplicationPage({super.key});
|
const AboutApplicationPage({super.key});
|
||||||
|
|
||||||
@override
|
@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,
|
hasBackButton: true,
|
||||||
hasFlashButton: false,
|
hasFlashButton: false,
|
||||||
heroTitle: 'about_application_page.title'.tr(),
|
heroTitle: 'about_application_page.title'.tr(),
|
||||||
|
@ -36,8 +55,8 @@ class AboutApplicationPage extends StatelessWidget {
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
snapshot.data.toString(),
|
snapshot.data.toString(),
|
||||||
),
|
),
|
||||||
leading: const Icon(
|
leading: Icon(
|
||||||
Icons.phone_android_outlined,
|
deviceIcon,
|
||||||
),
|
),
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
PlatformAdapter.setClipboard(
|
PlatformAdapter.setClipboard(
|
||||||
|
@ -218,7 +237,7 @@ class AboutApplicationPage extends StatelessWidget {
|
||||||
getIt<NavigationService>().showSnackBar(
|
getIt<NavigationService>().showSnackBar(
|
||||||
'basis.copied_to_clipboard'.tr(),
|
'basis.copied_to_clipboard'.tr(),
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
// Telegram
|
// Telegram
|
||||||
ListTile(
|
ListTile(
|
||||||
|
@ -335,8 +354,7 @@ class AboutApplicationPage extends StatelessWidget {
|
||||||
),
|
),
|
||||||
// telegram
|
// telegram
|
||||||
ListTile(
|
ListTile(
|
||||||
title:
|
title: Text('about_application_page.telegram_contributors_chat'.tr()),
|
||||||
Text('about_application_page.telegram_contributors_chat'.tr()),
|
|
||||||
subtitle: const Text('@selfprivacy_dev'),
|
subtitle: const Text('@selfprivacy_dev'),
|
||||||
onTap: () => launchUrl(
|
onTap: () => launchUrl(
|
||||||
Uri.parse('https://t.me/selfprivacy_dev'),
|
Uri.parse('https://t.me/selfprivacy_dev'),
|
||||||
|
@ -356,6 +374,7 @@ class AboutApplicationPage extends StatelessWidget {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Future<String> _packageVersion() async {
|
Future<String> _packageVersion() async {
|
||||||
String packageVersion = 'unknown';
|
String packageVersion = 'unknown';
|
||||||
|
|
Loading…
Reference in a new issue