From e42982f63b6f8179de151df7c12defce9d3ec9b6 Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Mon, 23 Jan 2023 13:28:36 +0300 Subject: [PATCH] added source code list tile --- lib/l10n/intl_en.arb | 1 + .../widget_list_tile_source_code.dart | 18 ++++++++++++++++++ lib/screens/settings/screen_settings.dart | 2 ++ pubspec.yaml | 1 + 4 files changed, 22 insertions(+) create mode 100644 lib/screens/settings/components/source_code/widget_list_tile_source_code.dart diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index b8dcb5d..9dd7fea 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -24,6 +24,7 @@ "themeLight": "Light", "themeDark": "Dark", "themeSystemDefault": "System default", + "sourceCode": "Source code", "version": "Version: {version} ({buildNumber})", "@version": { "placeholders": { diff --git a/lib/screens/settings/components/source_code/widget_list_tile_source_code.dart b/lib/screens/settings/components/source_code/widget_list_tile_source_code.dart new file mode 100644 index 0000000..75c59dc --- /dev/null +++ b/lib/screens/settings/components/source_code/widget_list_tile_source_code.dart @@ -0,0 +1,18 @@ +import 'package:flutter/material.dart'; +import 'package:lightmeter/generated/l10n.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class SourceCodeListTile extends StatelessWidget { + const SourceCodeListTile({super.key}); + + @override + Widget build(BuildContext context) { + return ListTile( + leading: const Icon(Icons.code), + title: Text(S.of(context).sourceCode), + onTap: () { + launchUrl(Uri.parse("https://github.com/vodemn/m3_lightmeter")); + }, + ); + } +} diff --git a/lib/screens/settings/screen_settings.dart b/lib/screens/settings/screen_settings.dart index 6406f94..7c29bfd 100644 --- a/lib/screens/settings/screen_settings.dart +++ b/lib/screens/settings/screen_settings.dart @@ -3,6 +3,7 @@ import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/res/dimens.dart'; import 'components/haptics/provider_list_tile_haptics.dart'; +import 'components/source_code/widget_list_tile_source_code.dart'; import 'components/widget_list_tile_fractional_stops.dart'; import 'components/theme/widget_settings_theme.dart'; import 'components/widget_label_version.dart'; @@ -42,6 +43,7 @@ class SettingsScreen extends StatelessWidget { const StopTypeListTile(), const HapticsListTileProvider(), const ThemeSettings(), + const SourceCodeListTile(), ], ), ), diff --git a/pubspec.yaml b/pubspec.yaml index 1396264..d9aeff7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -22,6 +22,7 @@ dependencies: permission_handler: 10.2.0 provider: 6.0.4 shared_preferences: 2.0.15 + url_launcher: 6.1.8 vibration: 1.7.6 dev_dependencies: