Skip to content

An open-source cross-platform alternative to AirDrop

feat: add link to github tag

Tien Do Nam2cf6b4868078
diff --git a/app/lib/pages/about/about_page.dart b/app/lib/pages/about/about_page.dart
index b7946699..8d3a9383 100644
--- a/app/lib/pages/about/about_page.dart
+++ b/app/lib/pages/about/about_page.dart
@@ -1,3 +1,5 @@
+import 'package:collection/collection.dart';
+import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:localsend_app/gen/strings.g.dart';
import 'package:localsend_app/pages/debug/debug_page.dart';
@@ -10,11 +12,14 @@ part 'contributors.dart';
part 'translators.dart';
+final _translatorWithGithubRegex = RegExp(r'(.+) \(@([\w\-_]+)\)');
+
class AboutPage extends StatelessWidget {
const AboutPage();
@override
Widget build(BuildContext context) {
+ final primaryColor = Theme.of(context).colorScheme.primary;
return Scaffold(
appBar: AppBar(
title: Text(t.aboutPage.title),
@@ -37,13 +42,22 @@ class AboutPage extends StatelessWidget {
child: const Text('localsend.org'),
),
),
+ const SizedBox(height: 10),
Text(t.aboutPage.description.join('\n\n')),
const SizedBox(height: 20),
Text(t.aboutPage.author, style: const TextStyle(fontWeight: FontWeight.bold)),
- const Text('Tien Do Nam (@Tienisto)'),
+ Text.rich(_buildContributor(
+ label: 'Tien Do Nam (@Tienisto)',
+ primaryColor: primaryColor,
+ )),
const SizedBox(height: 20),
Text(t.aboutPage.contributors, style: const TextStyle(fontWeight: FontWeight.bold)),
- ..._contributors.map((e) => Text(e)),
+ ..._contributors.map((contributor) {
+ return Text.rich(_buildContributor(
+ label: contributor,
+ primaryColor: primaryColor,
+ ));
+ }),
const SizedBox(height: 20),
Text(t.aboutPage.translators, style: const TextStyle(fontWeight: FontWeight.bold)),
Table(
@@ -59,13 +73,25 @@ class AboutPage extends StatelessWidget {
padding: const EdgeInsets.only(right: 10),
child: Text(e.key.translations.locale),
),
- Text(e.value.join('\n')),
+ Text.rich(
+ TextSpan(
+ children: e.value.mapIndexed(
+ (index, translator) {
+ return _buildContributor(
+ label: translator,
+ primaryColor: primaryColor,
+ newLine: index != 0,
+ );
+ },
+ ).toList(),
+ ),
+ ),
],
),
),
],
),
- const SizedBox(height: 10),
+ const SizedBox(height: 20),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -107,3 +133,44 @@ class AboutPage extends StatelessWidget {
);
}
}
+
+/// Displays the contributor name and links to their github profile.
+InlineSpan _buildContributor({required String label, required Color primaryColor, bool newLine = false}) {
+ final newLineStr = newLine ? '\n' : '';
+
+ if (label.startsWith('@')) {
+ // Only github name
+ return TextSpan(
+ text: '$newLineStr$label',
+ style: TextStyle(color: primaryColor),
+ recognizer: TapGestureRecognizer()
+ ..onTap = () async {
+ await launchUrl(Uri.parse('https://github.com/${label.substring(1)}'), mode: LaunchMode.externalApplication);
+ },
+ );
+ }
+
+ final match = _translatorWithGithubRegex.firstMatch(label);
+ if (match != null) {
+ // Full name and github name
+ final fullName = match.group(1)!;
+ final githubName = match.group(2)!;
+ return TextSpan(
+ children: [
+ TextSpan(text: '$newLineStr$fullName'),
+ const TextSpan(text: ' '),
+ TextSpan(
+ text: '@$githubName',
+ style: TextStyle(color: primaryColor),
+ recognizer: TapGestureRecognizer()
+ ..onTap = () async {
+ await launchUrl(Uri.parse('https://github.com/$githubName'), mode: LaunchMode.externalApplication);
+ },
+ ),
+ ],
+ );
+ }
+
+ // Only full name
+ return TextSpan(text: '$newLineStr$label');
+}
diff --git a/app/lib/pages/about/contributors.dart b/app/lib/pages/about/contributors.dart
index d0395157..2e302744 100644
--- a/app/lib/pages/about/contributors.dart
+++ b/app/lib/pages/about/contributors.dart
@@ -1,7 +1,19 @@
part of 'about_page.dart';
-/// Contributors who made several contributions to the project.
+/// Contributors who made several contributions to the project or
+/// who is maintainer of one of the distribution channels.
/// Translators should not be listed here.
-const _contributors = [
- 'Gabriel Lima (@TheGB0077)'
+const _contributors = <String>[
+ 'Gabriel Lima (@TheGB0077)',
+ '@gitstart',
+ ..._packageMaintainers,
+];
+
+/// Maintainers of one of the distribution channels.
+const _packageMaintainers = <String>[
+ '@brogers5',
+ '@Nixuge',
+ '@proletarius101',
+ '@sikmir',
+ '@sitiom',
];