An open-source cross-platform alternative to AirDrop
feat: add about and changelog page
Tien Do Namca927d5cdf8f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 53fa514c..e085e308 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,3 +1,3 @@-## 1.0.0+## 1.0.0 (2022)- Initial Releasediff --git a/assets/i18n/strings.i18n.json b/assets/i18n/strings.i18n.jsonindex f46d89e6..91610ba2 100644--- a/assets/i18n/strings.i18n.json+++ b/assets/i18n/strings.i18n.json@@ -96,6 +96,12 @@"speed": "Speed: {speed}/s"}},+ "aboutPage": {+ "title": "About LocalSend"+ },+ "changelogPage": {+ "title": "Changelog"+ },"dialogs": {"cancelSession": {"title": "Cancel file transfer",diff --git a/assets/i18n/strings_de.i18n.json b/assets/i18n/strings_de.i18n.jsonindex a9bbaddd..03f44f3e 100644--- a/assets/i18n/strings_de.i18n.json+++ b/assets/i18n/strings_de.i18n.json@@ -96,6 +96,12 @@"speed": "Geschwindigkeit: {speed}/s"}},+ "aboutPage": {+ "title": "Über LocalSend"+ },+ "changelogPage": {+ "title": "Changelog"+ },"dialogs": {"cancelSession": {"title": "Dateiübertragung abbrechen",diff --git a/lib/pages/about_page.dart b/lib/pages/about_page.dartnew file mode 100644index 00000000..0d09edd8--- /dev/null+++ b/lib/pages/about_page.dart@@ -0,0 +1,66 @@+import 'package:flutter/material.dart';+import 'package:localsend_app/gen/strings.g.dart';+import 'package:localsend_app/widget/local_send_logo.dart';+import 'package:routerino/routerino.dart';+import 'package:url_launcher/url_launcher.dart';++final _body = '''+ LocalSend is an open source app to share files and messages between nearby devices using the local wifi network.+ There is no external server needed as the device itself is the server (peer-to-peer).++ Currently, this app is available on Android and iOS. More platforms will follow soon.+ '''.splitMapJoin(+ RegExp(r'^', multiLine: true),+ onMatch: (_) => '\n',+ onNonMatch: (n) => n.trim(),+);++class AboutPage extends StatelessWidget {+ const AboutPage();++ @override+ Widget build(BuildContext context) {+ return Scaffold(+ appBar: AppBar(+ title: Text(t.aboutPage.title),+ ),+ body: ListView(+ padding: const EdgeInsets.symmetric(horizontal: 15),+ children: [+ const SizedBox(height: 20),+ const LocalSendLogo(),+ const SizedBox(height: 5),+ Text(+ '© ${DateTime.now().year} Tien Do Nam',+ textAlign: TextAlign.center,+ ),+ const SizedBox(height: 10),+ Text(_body),+ Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ TextButton(+ onPressed: () {+ launchUrl(Uri.parse('https://opensource.org/licenses/MIT'));+ },+ child: const Text('MIT License'),+ ),+ TextButton(+ onPressed: () {+ launchUrl(Uri.parse('https://github.com/localsend/localsend'), mode: LaunchMode.externalApplication);+ },+ child: const Text('Source Code (Github)'),+ ),+ TextButton(+ onPressed: () {+ context.push(() => const LicensePage());+ },+ child: const Text('License Notices'),+ ),+ ],+ ),+ ],+ ),+ );+ }+}diff --git a/lib/pages/changelog_page.dart b/lib/pages/changelog_page.dartnew file mode 100644index 00000000..7b299dc5--- /dev/null+++ b/lib/pages/changelog_page.dart@@ -0,0 +1,28 @@+import 'package:flutter/material.dart';+import 'package:flutter/services.dart' show rootBundle;+import 'package:flutter_markdown/flutter_markdown.dart';+import 'package:localsend_app/gen/strings.g.dart';++class ChangelogPage extends StatelessWidget {+ const ChangelogPage();++ @override+ Widget build(BuildContext context) {+ return Scaffold(+ appBar: AppBar(+ title: Text(t.changelogPage.title),+ ),+ body: FutureBuilder(+ future: rootBundle.loadString('CHANGELOG.md'),+ builder: (context, data) {+ if (!data.hasData) {+ return Container();+ }+ return Markdown(+ data: data.data!,+ );+ }+ ),+ );+ }+}diff --git a/lib/pages/tabs/settings_tab.dart b/lib/pages/tabs/settings_tab.dartindex 83daa877..2f10df75 100644--- a/lib/pages/tabs/settings_tab.dart+++ b/lib/pages/tabs/settings_tab.dart@@ -1,13 +1,16 @@import 'package:flutter/material.dart';import 'package:flutter_riverpod/flutter_riverpod.dart';-import 'package:localsend_app/gen/assets.gen.dart';import 'package:localsend_app/gen/strings.g.dart';+import 'package:localsend_app/pages/about_page.dart';+import 'package:localsend_app/pages/changelog_page.dart';import 'package:localsend_app/provider/network/server_provider.dart';import 'package:localsend_app/provider/settings_provider.dart';import 'package:localsend_app/provider/version_provider.dart';import 'package:localsend_app/theme.dart';import 'package:localsend_app/util/sleep.dart';import 'package:localsend_app/widget/custom_dropdown_button.dart';+import 'package:localsend_app/widget/local_send_logo.dart';+import 'package:routerino/routerino.dart';class SettingsTab extends ConsumerStatefulWidget {const SettingsTab({Key? key}) : super(key: key);@@ -135,9 +138,9 @@ class _SettingsTabState extends ConsumerState<SettingsTab> {IconButton(onPressed: () async {final newServerState = await ref.read(serverProvider.notifier).restartServer(- alias: settings.alias,- port: settings.port,- );+ alias: settings.alias,+ port: settings.port,+ );if (newServerState != null) {// the new state is always valid, so we can "repair" user's setting@@ -188,29 +191,47 @@ class _SettingsTabState extends ConsumerState<SettingsTab> {),],),- const SizedBox(height: 20),- Assets.img.logo512.image(- width: 200,- height: 200,+ Align(+ alignment: Alignment.centerLeft,+ child: TextButton.icon(+ style: TextButton.styleFrom(+ foregroundColor: Theme.of(context).colorScheme.onSurface,+ ),+ onPressed: () {+ context.push(() => const AboutPage());+ },+ icon: const Icon(Icons.info),+ label: Text(t.aboutPage.title),+ ),),- const Text(- 'LocalSend',- style: TextStyle(fontSize: 36, fontWeight: FontWeight.bold),- textAlign: TextAlign.center,+ Align(+ alignment: Alignment.centerLeft,+ child: TextButton.icon(+ style: TextButton.styleFrom(+ foregroundColor: Theme.of(context).colorScheme.onSurface,+ ),+ onPressed: () {+ context.push(() => const ChangelogPage());+ },+ icon: const Icon(Icons.history),+ label: Text(t.changelogPage.title),+ ),),+ const SizedBox(height: 40),+ const LocalSendLogo(),const SizedBox(height: 5),ref.watch(versionProvider).maybeWhen(- data: (version) => Text(- 'Version: $version',- textAlign: TextAlign.center,- ),- orElse: () => Container(),- ),+ data: (version) => Text(+ 'Version: $version',+ textAlign: TextAlign.center,+ ),+ orElse: () => Container(),+ ),Text('© ${DateTime.now().year} Tien Do Nam',textAlign: TextAlign.center,),- const SizedBox(height: 50),+ const SizedBox(height: 80),],);}@@ -229,7 +250,7 @@ class _SettingsEntry extends StatelessWidget {child: Row(children: [Expanded(- child: Text(label, style: const TextStyle(fontSize: 16)),+ child: Text(label),),SizedBox(width: 150,@@ -256,7 +277,7 @@ class _SettingsSection extends StatelessWidget {padding: const EdgeInsets.only(bottom: 15),child: Card(child: Padding(- padding: const EdgeInsets.only(left: 15, right: 15, top: 10),+ padding: const EdgeInsets.only(left: 15, right: 15, top: 15),child: Column(crossAxisAlignment: CrossAxisAlignment.start,children: [diff --git a/lib/widget/local_send_logo.dart b/lib/widget/local_send_logo.dartnew file mode 100644index 00000000..23016269--- /dev/null+++ b/lib/widget/local_send_logo.dart@@ -0,0 +1,23 @@+import 'package:flutter/material.dart';+import 'package:localsend_app/gen/assets.gen.dart';++class LocalSendLogo extends StatelessWidget {+ const LocalSendLogo({Key? key}) : super(key: key);++ @override+ Widget build(BuildContext context) {+ return Column(+ children: [+ Assets.img.logo512.image(+ width: 200,+ height: 200,+ ),+ const Text(+ 'LocalSend',+ style: TextStyle(fontSize: 36, fontWeight: FontWeight.bold),+ textAlign: TextAlign.center,+ ),+ ],+ );+ }+}diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.ccindex b7a6d08b..0cacc750 100644--- a/linux/flutter/generated_plugin_registrant.cc+++ b/linux/flutter/generated_plugin_registrant.cc@@ -7,12 +7,16 @@#include "generated_plugin_registrant.h"#include <screen_retriever/screen_retriever_plugin.h>+#include <url_launcher_linux/url_launcher_plugin.h>#include <window_manager/window_manager_plugin.h>void fl_register_plugins(FlPluginRegistry* registry) {g_autoptr(FlPluginRegistrar) screen_retriever_registrar =fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");screen_retriever_plugin_register_with_registrar(screen_retriever_registrar);+ g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =+ fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");+ url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);g_autoptr(FlPluginRegistrar) window_manager_registrar =fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin");window_manager_plugin_register_with_registrar(window_manager_registrar);diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmakeindex 913ac71c..62f151fd 100644--- a/linux/flutter/generated_plugins.cmake+++ b/linux/flutter/generated_plugins.cmake@@ -4,6 +4,7 @@list(APPEND FLUTTER_PLUGIN_LISTscreen_retriever+ url_launcher_linuxwindow_manager)diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swiftindex 20d068b3..e8a448b4 100644--- a/macos/Flutter/GeneratedPluginRegistrant.swift+++ b/macos/Flutter/GeneratedPluginRegistrant.swift@@ -11,6 +11,7 @@ import package_info_plusimport path_provider_macosimport screen_retrieverimport shared_preferences_macos+import url_launcher_macosimport window_managerfunc RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {@@ -20,5 +21,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))+ UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))}diff --git a/pubspec.lock b/pubspec.lockindex e143d235..1abdb496 100644--- a/pubspec.lock+++ b/pubspec.lock@@ -251,6 +251,13 @@ packages:url: "https://pub.dartlang.org"source: hostedversion: "2.0.1"+ flutter_markdown:+ dependency: "direct main"+ description:+ name: flutter_markdown+ url: "https://pub.dartlang.org"+ source: hosted+ version: "0.6.13"flutter_plugin_android_lifecycle:dependency: transitivedescription:@@ -417,6 +424,13 @@ packages:url: "https://pub.dartlang.org"source: hostedversion: "1.1.0"+ markdown:+ dependency: transitive+ description:+ name: markdown+ url: "https://pub.dartlang.org"+ source: hosted+ version: "6.0.1"matcher:dependency: transitivedescription:@@ -800,6 +814,62 @@ packages:url: "https://pub.dartlang.org"source: hostedversion: "1.3.1"+ url_launcher:+ dependency: "direct main"+ description:+ name: url_launcher+ url: "https://pub.dartlang.org"+ source: hosted+ version: "6.1.7"+ url_launcher_android:+ dependency: transitive+ description:+ name: url_launcher_android+ url: "https://pub.dartlang.org"+ source: hosted+ version: "6.0.22"+ url_launcher_ios:+ dependency: transitive+ description:+ name: url_launcher_ios+ url: "https://pub.dartlang.org"+ source: hosted+ version: "6.0.17"+ url_launcher_linux:+ dependency: transitive+ description:+ name: url_launcher_linux+ url: "https://pub.dartlang.org"+ source: hosted+ version: "3.0.1"+ url_launcher_macos:+ dependency: transitive+ description:+ name: url_launcher_macos+ url: "https://pub.dartlang.org"+ source: hosted+ version: "3.0.1"+ url_launcher_platform_interface:+ dependency: transitive+ description:+ name: url_launcher_platform_interface+ url: "https://pub.dartlang.org"+ source: hosted+ version: "2.1.1"+ url_launcher_web:+ dependency: transitive+ description:+ name: url_launcher_web+ url: "https://pub.dartlang.org"+ source: hosted+ version: "2.0.13"+ url_launcher_windows:+ dependency: transitive+ description:+ name: url_launcher_windows+ url: "https://pub.dartlang.org"+ source: hosted+ version: "3.0.1"uuid:dependency: "direct main"description:diff --git a/pubspec.yaml b/pubspec.yamlindex 888e3b14..42b7d9c8 100644--- a/pubspec.yaml+++ b/pubspec.yaml@@ -15,6 +15,7 @@ dependencies:file_picker: 5.2.4flutter:sdk: flutter+ flutter_markdown: 0.6.13flutter_riverpod: 2.1.1freezed_annotation: 2.2.0image_picker: 0.8.6@@ -28,6 +29,7 @@ dependencies:shelf_router: 1.1.3slang: 3.7.0slang_flutter: 3.7.0+ url_launcher: 6.1.7uuid: 3.0.7window_manager: 0.2.8@@ -43,4 +45,5 @@ flutter:uses-material-design: trueassets:- - assets/img/\ No newline at end of file+ - assets/img/+ - CHANGELOG.md\ No newline at end of filediff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.ccindex 1fdba3aa..f5e789c8 100644--- a/windows/flutter/generated_plugin_registrant.cc+++ b/windows/flutter/generated_plugin_registrant.cc@@ -8,6 +8,7 @@#include <network_info_plus/network_info_plus_windows_plugin.h>#include <screen_retriever/screen_retriever_plugin.h>+#include <url_launcher_windows/url_launcher_windows.h>#include <window_manager/window_manager_plugin.h>void RegisterPlugins(flutter::PluginRegistry* registry) {@@ -15,6 +16,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {registry->GetRegistrarForPlugin("NetworkInfoPlusWindowsPlugin"));ScreenRetrieverPluginRegisterWithRegistrar(registry->GetRegistrarForPlugin("ScreenRetrieverPlugin"));+ UrlLauncherWindowsRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("UrlLauncherWindows"));WindowManagerPluginRegisterWithRegistrar(registry->GetRegistrarForPlugin("WindowManagerPlugin"));}diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmakeindex 21a1a359..eb6cef4e 100644--- a/windows/flutter/generated_plugins.cmake+++ b/windows/flutter/generated_plugins.cmake@@ -5,6 +5,7 @@list(APPEND FLUTTER_PLUGIN_LISTnetwork_info_plusscreen_retriever+ url_launcher_windowswindow_manager)