mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 10:58:40 +00:00
fix #140
This commit is contained in:
parent
586c4aa16a
commit
9291c54600
11 changed files with 134 additions and 4 deletions
|
|
@ -112,6 +112,7 @@
|
|||
"settingsNotifyTroubleshootingNoProblemDesc": "Klicke auf OK, um eine Testbenachrichtigung zu erhalten. Wenn du auch nach 10 Minuten warten keine Nachricht erhältst, sende uns bitte dein Diagnoseprotokoll unter Einstellungen > Hilfe > Diagnoseprotokoll, damit wir uns das Problem ansehen können.",
|
||||
"settingsHelp": "Hilfe",
|
||||
"settingsHelpSupport": "Support-Center",
|
||||
"settingsHelpContactUs": "Kontaktiere uns",
|
||||
"settingsHelpDiagnostics": "Diagnoseprotokoll",
|
||||
"settingsHelpVersion": "Version",
|
||||
"settingsHelpLicenses": "Lizenzen (Source-Code)",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,8 @@
|
|||
"@settingsHelpDiagnostics": {},
|
||||
"settingsHelpSupport": "Support Center",
|
||||
"@settingsHelpSupport": {},
|
||||
"settingsHelpContactUs": "Contact us",
|
||||
"@settingsHelpContactUs": {},
|
||||
"settingsHelpVersion": "Version",
|
||||
"@settingsHelpVersion": {},
|
||||
"settingsHelpLicenses": "Licenses (Source-Code)",
|
||||
|
|
|
|||
|
|
@ -677,6 +677,12 @@ abstract class AppLocalizations {
|
|||
/// **'Support Center'**
|
||||
String get settingsHelpSupport;
|
||||
|
||||
/// No description provided for @settingsHelpContactUs.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Contact us'**
|
||||
String get settingsHelpContactUs;
|
||||
|
||||
/// No description provided for @settingsHelpVersion.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
|
|
|||
|
|
@ -303,6 +303,9 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
@override
|
||||
String get settingsHelpSupport => 'Support-Center';
|
||||
|
||||
@override
|
||||
String get settingsHelpContactUs => 'Kontaktiere uns';
|
||||
|
||||
@override
|
||||
String get settingsHelpVersion => 'Version';
|
||||
|
||||
|
|
|
|||
|
|
@ -303,6 +303,9 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||
@override
|
||||
String get settingsHelpSupport => 'Support Center';
|
||||
|
||||
@override
|
||||
String get settingsHelpContactUs => 'Contact us';
|
||||
|
||||
@override
|
||||
String get settingsHelpVersion => 'Version';
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class ChatListEntry extends StatelessWidget {
|
|||
Widget getReactionRow() {
|
||||
List<Widget> children = [];
|
||||
bool hasOneTextReaction = false;
|
||||
bool hasOneStored = false;
|
||||
// bool hasOneStored = false;
|
||||
bool hasOneReopened = false;
|
||||
for (final reaction in reactions) {
|
||||
MessageContent? content = MessageContent.fromJson(
|
||||
|
|
|
|||
106
lib/src/views/settings/help/contact_us_view.dart
Normal file
106
lib/src/views/settings/help/contact_us_view.dart
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:twonly/src/utils/misc.dart';
|
||||
import 'package:twonly/src/utils/storage.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class ContactUsView extends StatefulWidget {
|
||||
const ContactUsView({super.key});
|
||||
|
||||
@override
|
||||
State<ContactUsView> createState() => _ContactUsState();
|
||||
}
|
||||
|
||||
class _ContactUsState extends State<ContactUsView> {
|
||||
final TextEditingController _controller = TextEditingController();
|
||||
|
||||
Future<void> _submitFeedback() async {
|
||||
final String feedback = _controller.text;
|
||||
|
||||
if (feedback.isEmpty) {
|
||||
// Show a message if the text field is empty
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Please enter your message.')),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
final user = await getUser();
|
||||
if (user == null) return;
|
||||
|
||||
final feedbackFull = "${user.username}\n\n$feedback";
|
||||
|
||||
final response = await http.post(
|
||||
Uri.parse('https://twonly.theconnectapp.de/subscribe.twonly.php'),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
body: {
|
||||
'feedback': feedbackFull,
|
||||
},
|
||||
);
|
||||
if (!context.mounted) return;
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
// Handle successful response
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Feedback submitted successfully!')),
|
||||
);
|
||||
Navigator.pop(context);
|
||||
} else {
|
||||
// Handle error response
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Failed to submit feedback.')),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(context.lang.settingsHelpContactUs),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
children: [
|
||||
TextField(
|
||||
controller: _controller,
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Your Feedback.',
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
maxLines: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: SafeArea(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
launchUrl(Uri.parse("https://twonly.eu/support"));
|
||||
},
|
||||
child: Text(
|
||||
'Have you read our FAQ yet?',
|
||||
style: TextStyle(
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: _submitFeedback,
|
||||
child: Text('Submit'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,8 +2,9 @@ import 'package:flutter/material.dart';
|
|||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:twonly/src/utils/misc.dart';
|
||||
import 'package:twonly/src/views/settings/credits_view.dart';
|
||||
import 'package:twonly/src/views/settings/diagnostics_view.dart';
|
||||
import 'package:twonly/src/views/settings/help/contact_us_view.dart';
|
||||
import 'package:twonly/src/views/settings/help/credits_view.dart';
|
||||
import 'package:twonly/src/views/settings/help/diagnostics_view.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class HelpView extends StatelessWidget {
|
||||
|
|
@ -24,6 +25,14 @@ class HelpView extends StatelessWidget {
|
|||
trailing:
|
||||
FaIcon(FontAwesomeIcons.arrowUpRightFromSquare, size: 15),
|
||||
),
|
||||
ListTile(
|
||||
title: Text(context.lang.settingsHelpContactUs),
|
||||
onTap: () {
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) {
|
||||
return ContactUsView();
|
||||
}));
|
||||
},
|
||||
),
|
||||
Divider(),
|
||||
FutureBuilder(
|
||||
future: PackageInfo.fromPlatform(),
|
||||
|
|
@ -11,7 +11,7 @@ import 'package:twonly/src/views/settings/chat/chat_settings_view.dart';
|
|||
import 'package:twonly/src/views/settings/data_and_storage_view.dart';
|
||||
import 'package:twonly/src/views/settings/notification_view.dart';
|
||||
import 'package:twonly/src/views/settings/profile/profile_view.dart';
|
||||
import 'package:twonly/src/views/settings/help_view.dart';
|
||||
import 'package:twonly/src/views/settings/help/help_view.dart';
|
||||
import 'package:twonly/src/views/settings/privacy_view.dart';
|
||||
|
||||
class SettingsMainView extends StatefulWidget {
|
||||
|
|
|
|||
Loading…
Reference in a new issue