Revert "Updated feedback to include screenshot and drawings"
This reverts commit 7b3c0b4885
.
This commit is contained in:
78
lib/view/pages/more/feedback/feedbackDialog.dart
Normal file
78
lib/view/pages/more/feedback/feedbackDialog.dart
Normal file
@ -0,0 +1,78 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:package_info/package_info.dart';
|
||||
|
||||
import '../../../../api/mhsl/server/feedback/addFeedback.dart';
|
||||
import '../../../../api/mhsl/server/feedback/addFeedbackParams.dart';
|
||||
import '../../../../model/accountData.dart';
|
||||
import '../../../../widget/infoDialog.dart';
|
||||
|
||||
class FeedbackDialog extends StatefulWidget {
|
||||
const FeedbackDialog({super.key});
|
||||
|
||||
@override
|
||||
State<FeedbackDialog> createState() => _FeedbackDialogState();
|
||||
}
|
||||
|
||||
class _FeedbackDialogState extends State<FeedbackDialog> {
|
||||
final TextEditingController _feedbackInput = TextEditingController();
|
||||
String? _error;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
|
||||
title: const Text("Feedback"),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text("Feedback, Anregungen, Ideen, Fehler und Verbesserungen"),
|
||||
const SizedBox(height: 10),
|
||||
const Text("Bitte gib keine geheimen Daten wie z.B. Passwörter weiter.", style: TextStyle(fontSize: 10)),
|
||||
const SizedBox(height: 10),
|
||||
TextField(
|
||||
controller: _feedbackInput,
|
||||
autofocus: true,
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
label: Text("Feedback und Verbesserungen")
|
||||
),
|
||||
// style: TextStyle(),
|
||||
// expands: true,
|
||||
minLines: 3,
|
||||
maxLines: 5,
|
||||
),
|
||||
Visibility(
|
||||
visible: _error != null,
|
||||
child: Text("Senden fehlgeschlagen: $_error", style: const TextStyle(color: Colors.red))
|
||||
)
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(onPressed: () => Navigator.of(context).pop(), child: const Text("Abbrechen")),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
AddFeedback(
|
||||
AddFeedbackParams(
|
||||
user: AccountData().getUserSecret(),
|
||||
feedback: _feedbackInput.text,
|
||||
appVersion: int.parse((await PackageInfo.fromPlatform()).buildNumber)
|
||||
)
|
||||
)
|
||||
.run()
|
||||
.then((value) {
|
||||
Navigator.of(context).pop();
|
||||
InfoDialog.show(context, "Danke für dein Feedback!");
|
||||
})
|
||||
.catchError((error, trace) {
|
||||
setState(() {
|
||||
_error = error.toString();
|
||||
});
|
||||
});
|
||||
},
|
||||
child: const Text("Senden"),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -1,99 +0,0 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../theming/darkAppTheme.dart';
|
||||
import '../../../../widget/loadingSpinner.dart';
|
||||
|
||||
class FeedbackForm extends StatefulWidget {
|
||||
final Future<void> Function(String, {Map<String, dynamic>? extras}) callback;
|
||||
final ScrollController? scrollController;
|
||||
const FeedbackForm({required this.scrollController, required this.callback, super.key});
|
||||
|
||||
@override
|
||||
State<FeedbackForm> createState() => _FeedbackFormState();
|
||||
}
|
||||
|
||||
class _FeedbackFormState extends State<FeedbackForm> {
|
||||
final TextEditingController _feedbackInput = TextEditingController();
|
||||
bool _textFieldEmpty = false;
|
||||
bool _isSending = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_feedbackInput.addListener(() {
|
||||
setState(() {
|
||||
_textFieldEmpty = _feedbackInput.text.isEmpty;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Theme(
|
||||
data: DarkAppTheme.theme,
|
||||
child: Visibility(
|
||||
visible: !_isSending,
|
||||
replacement: const LoadingSpinner(infoText: "Daten werden ermittelt"),
|
||||
child: SingleChildScrollView(
|
||||
controller: widget.scrollController,
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text("Bitte gib keine geheimen Daten wie z.B. Passwörter weiter!", style: TextStyle(fontSize: 10)),
|
||||
const SizedBox(height: 10),
|
||||
TextField(
|
||||
controller: _feedbackInput,
|
||||
autofocus: true,
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(),
|
||||
label: const Text("Dein Feedback"),
|
||||
errorText: _textFieldEmpty ? "Bitte gib eine Beschreibung an" : null
|
||||
),
|
||||
minLines: 1,
|
||||
maxLines: 2,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
if(_isSending) return;
|
||||
if(_feedbackInput.text.isEmpty) {
|
||||
setState(() {
|
||||
_textFieldEmpty = true;
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
setState(() {
|
||||
_isSending = true;
|
||||
});
|
||||
|
||||
widget.callback(_feedbackInput.text);
|
||||
},
|
||||
child: const Text("Senden"),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
const Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"Feedback, mal süß wie Kuchen, mal sauer wie Gurken, doch immer ein Schlüssel fürs Wachsen und Lernen.",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Icon(Icons.emoji_objects_outlined)
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:feedback/feedback.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:loader_overlay/loader_overlay.dart';
|
||||
import 'package:package_info/package_info.dart';
|
||||
|
||||
import '../../../../api/mhsl/server/feedback/addFeedback.dart';
|
||||
import '../../../../api/mhsl/server/feedback/addFeedbackParams.dart';
|
||||
import '../../../../model/accountData.dart';
|
||||
import '../../../../widget/infoDialog.dart';
|
||||
|
||||
class FeedbackSender {
|
||||
static send(BuildContext context, UserFeedback feedback) async {
|
||||
BetterFeedback.of(context).hide();
|
||||
context.loaderOverlay.show();
|
||||
AddFeedbackParams params = AddFeedbackParams(
|
||||
user: AccountData().getUserSecret(),
|
||||
feedback: feedback.text,
|
||||
screenshot: await compute((message) => base64Encode(message), feedback.screenshot),
|
||||
appVersion: int.parse((await PackageInfo.fromPlatform()).buildNumber)
|
||||
);
|
||||
AddFeedback(params).run().then((value) {
|
||||
InfoDialog.show(context, "Danke für dein Feedback!");
|
||||
context.loaderOverlay.hide();
|
||||
}).catchError((error, trace) {
|
||||
InfoDialog.show(context, error.toString());
|
||||
context.loaderOverlay.hide();
|
||||
});
|
||||
}
|
||||
}
|
@ -1,12 +1,13 @@
|
||||
|
||||
import 'package:feedback/feedback.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:in_app_review/in_app_review.dart';
|
||||
import 'package:marianum_mobile/widget/infoDialog.dart';
|
||||
import 'package:persistent_bottom_nav_bar_v2/persistent-tab-view.dart';
|
||||
|
||||
import '../../widget/ListItem.dart';
|
||||
import '../../widget/centeredLeading.dart';
|
||||
import '../../widget/infoDialog.dart';
|
||||
import '../settings/settings.dart';
|
||||
import 'more/feedback/feedbackSender.dart';
|
||||
import 'more/feedback/feedbackDialog.dart';
|
||||
import 'more/gradeAverages/gradeAverage.dart';
|
||||
import 'more/holidays/holidays.dart';
|
||||
import 'more/message/message.dart';
|
||||
@ -23,7 +24,7 @@ class Overhang extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
title: const Text("Mehr"),
|
||||
actions: [
|
||||
IconButton(onPressed: () => Navigator.of(context).push(MaterialPageRoute(builder: (context) => const Settings())), icon: const Icon(Icons.settings))
|
||||
IconButton(onPressed: () => pushNewScreen(context, screen: const Settings(), withNavBar: false), icon: const Icon(Icons.settings))
|
||||
],
|
||||
),
|
||||
body: ListView(
|
||||
@ -65,9 +66,7 @@ class Overhang extends StatelessWidget {
|
||||
title: const Text("Du hast eine Idee?"),
|
||||
subtitle: const Text("Fehler und Verbessungsvorschläge"),
|
||||
trailing: const Icon(Icons.arrow_right),
|
||||
onTap: () {
|
||||
BetterFeedback.of(context).show((UserFeedback feedback) => FeedbackSender.send(context, feedback));
|
||||
},
|
||||
onTap: () => showDialog(context: context, barrierDismissible: false, builder: (context) => const FeedbackDialog()),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -91,6 +91,7 @@ class _ChatViewState extends State<ChatView> {
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xffefeae2),
|
||||
appBar: ClickableAppBar(
|
||||
onTap: () {
|
||||
TalkNavigator.pushSplitView(context, ChatInfo(widget.room));
|
||||
|
@ -121,7 +121,7 @@ class _ChatTileState extends State<ChatTile> {
|
||||
onTap: () async {
|
||||
setCurrentAsRead();
|
||||
ChatView view = ChatView(room: widget.data, selfId: username, avatar: circleAvatar);
|
||||
TalkNavigator.pushSplitView(context, view, onSecondaryScreen: true);
|
||||
TalkNavigator.pushSplitView(context, view, overrideToSingleSubScreen: true);
|
||||
Provider.of<ChatProps>(context, listen: false).setQueryToken(widget.data.token);
|
||||
},
|
||||
onLongPress: () {
|
||||
|
@ -1,17 +1,18 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_split_view/flutter_split_view.dart';
|
||||
import 'package:persistent_bottom_nav_bar_v2/persistent-tab-view.dart';
|
||||
|
||||
class TalkNavigator {
|
||||
static bool hasSplitViewState(BuildContext context) => context.findAncestorStateOfType<SplitViewState>() != null;
|
||||
static bool isSecondaryVisible(BuildContext context) => hasSplitViewState(context) && SplitView.of(context).isSecondaryVisible;
|
||||
|
||||
static void pushSplitView(BuildContext context, Widget view, {bool onSecondaryScreen = false}) {
|
||||
static void pushSplitView(BuildContext context, Widget view, {bool overrideToSingleSubScreen = false}) {
|
||||
if(isSecondaryVisible(context)) {
|
||||
SplitViewState splitView = SplitView.of(context);
|
||||
onSecondaryScreen ? splitView.setSecondary(view) : splitView.push(view);
|
||||
overrideToSingleSubScreen ? splitView.setSecondary(view) : splitView.push(view);
|
||||
} else {
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => view));
|
||||
pushNewScreen(context, screen: view, withNavBar: false);
|
||||
}
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ import 'package:bottom_sheet/bottom_sheet.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:persistent_bottom_nav_bar_v2/persistent-tab-view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:rrule/rrule.dart';
|
||||
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
||||
@ -102,7 +103,7 @@ class AppointmentDetails {
|
||||
trailing: IconButton(
|
||||
icon: const Icon(Icons.house_outlined),
|
||||
onPressed: () {
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => const Roomplan()));
|
||||
pushNewScreen(context, withNavBar: false, screen: const Roomplan());
|
||||
},
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user