Add donation link

This commit is contained in:
Ming Ming 2022-05-17 19:27:23 +08:00
parent 2a39fe6cf7
commit a69d07d974
4 changed files with 42 additions and 0 deletions

View file

@ -10,3 +10,5 @@ const enhanceEsrganUrl = "https://bit.ly/3wO0NJP";
const enhanceStyleTransferUrl = "https://bit.ly/3agpTcF";
const enhanceDeepLabColorPopUrl = "https://bit.ly/3Rx0YCD";
const editPhotosUrl = "https://bit.ly/3v82oKA";
const donateUrl = "https://bit.ly/3wQOHPZ";

View file

@ -1452,6 +1452,10 @@
"description": "Save the image on your Nextcloud server"
},
"donationTitle": "Buy me a coffee",
"donationButtonLabel": "BUY ME A COFFEE",
"donationShortMessage": "Want to help?",
"errorUnauthenticated": "Unauthenticated access. Please sign-in again if the problem continues",
"@errorUnauthenticated": {
"description": "Error message when server responds with HTTP401"

View file

@ -1,6 +1,9 @@
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'package:nc_photos/app_localizations.dart';
import 'package:nc_photos/help_utils.dart' as help_util;
import 'package:nc_photos/theme.dart';
import 'package:nc_photos/url_launcher_util.dart';
class ChangelogArguments {
const ChangelogArguments(this.fromVersion);
@ -39,11 +42,33 @@ class Changelog extends StatelessWidget {
AppBar _buildAppBar() => AppBar(
title: const Text("Changelog"),
elevation: 0,
);
Widget _buildContent(BuildContext context) {
return Column(
children: [
Container(
padding: const EdgeInsets.symmetric(horizontal: 16),
color: Theme.of(context).brightness == Brightness.light
? Colors.blue[100]
: Colors.blueGrey[800],
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Expanded(
child: Text(L10n.global().donationShortMessage),
),
TextButton(
onPressed: () {
launch(help_util.donateUrl);
},
child: Text(L10n.global().donationButtonLabel),
),
],
),
),
Expanded(
child: ListView.builder(
itemCount: _changelogs.length,

View file

@ -11,6 +11,7 @@ import 'package:nc_photos/di_container.dart';
import 'package:nc_photos/entity/sqlite_table_extension.dart' as sql;
import 'package:nc_photos/event/event.dart';
import 'package:nc_photos/exception_util.dart' as exception_util;
import 'package:nc_photos/help_utils.dart' as help_util;
import 'package:nc_photos/k.dart' as k;
import 'package:nc_photos/language_util.dart' as language_util;
import 'package:nc_photos/mobile/android/android_info.dart';
@ -233,6 +234,16 @@ class _SettingsState extends State<Settings> {
}
},
),
ListTile(
leading: Icon(
Icons.coffee_outlined,
color: AppTheme.getUnfocusedIconColor(context),
),
title: Text(L10n.global().donationTitle),
onTap: () {
launch(help_util.donateUrl);
},
),
ListTile(
title: Text(L10n.global().settingsSourceCodeTitle),
onTap: () {