feedback dialog is now scrollable
This commit is contained in:
parent
51373fe7a2
commit
dfd9459922
@ -48,125 +48,127 @@ class _FeedbackDialogState extends State<FeedbackDialog> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Feedback'),
|
title: const Text('Feedback'),
|
||||||
),
|
),
|
||||||
body: Column(
|
body: SingleChildScrollView(
|
||||||
mainAxisSize: MainAxisSize.max,
|
child: Column(
|
||||||
children: [
|
mainAxisSize: MainAxisSize.max,
|
||||||
const SizedBox(height: 5),
|
children: [
|
||||||
const Text('Feedback, Anregungen, Ideen, Fehler und Verbesserungen', textAlign: TextAlign.center),
|
const SizedBox(height: 5),
|
||||||
const SizedBox(height: 15),
|
const Text('Feedback, Anregungen, Ideen, Fehler und Verbesserungen', textAlign: TextAlign.center),
|
||||||
const Text('Bitte gib keine geheimen Daten wie z.B. Passwörter weiter.', textAlign: TextAlign.center, style: TextStyle(fontSize: 11)),
|
const SizedBox(height: 15),
|
||||||
const SizedBox(height: 20),
|
const Text('Bitte gib keine geheimen Daten wie z.B. Passwörter weiter.', textAlign: TextAlign.center, style: TextStyle(fontSize: 11)),
|
||||||
Padding(
|
const SizedBox(height: 20),
|
||||||
padding: const EdgeInsets.all(10),
|
Padding(
|
||||||
child: TextField(
|
padding: const EdgeInsets.all(10),
|
||||||
controller: _feedbackInput,
|
child: TextField(
|
||||||
autofocus: true,
|
controller: _feedbackInput,
|
||||||
decoration: InputDecoration(
|
autofocus: true,
|
||||||
|
decoration: InputDecoration(
|
||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
label: const Text('Feedback und Verbesserungen'),
|
label: const Text('Feedback und Verbesserungen'),
|
||||||
errorText: _textFieldEmpty ? 'Bitte gib eine Beschreibung an' : null,
|
errorText: _textFieldEmpty ? 'Bitte gib eine Beschreibung an' : null,
|
||||||
),
|
|
||||||
minLines: 4,
|
|
||||||
maxLines: 7,
|
|
||||||
onTapOutside: (PointerDownEvent event) => FocusBehaviour.textFieldTapOutside(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
if(_image != null) Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
badges.Badge(
|
|
||||||
badgeContent: const Icon(Icons.close_outlined, size: 17),
|
|
||||||
badgeStyle: const badges.BadgeStyle(
|
|
||||||
padding: EdgeInsets.all(2),
|
|
||||||
),
|
),
|
||||||
child: Container(
|
minLines: 4,
|
||||||
decoration: BoxDecoration(
|
maxLines: 7,
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
onTapOutside: (PointerDownEvent event) => FocusBehaviour.textFieldTapOutside(context),
|
||||||
border: Border.all(
|
),
|
||||||
width: 3,
|
),
|
||||||
color: Theme.of(context).primaryColor,
|
const SizedBox(height: 10),
|
||||||
|
if(_image != null) Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
badges.Badge(
|
||||||
|
badgeContent: const Icon(Icons.close_outlined, size: 17),
|
||||||
|
badgeStyle: const badges.BadgeStyle(
|
||||||
|
padding: EdgeInsets.all(2),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
||||||
|
border: Border.all(
|
||||||
|
width: 3,
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
height: 150,
|
||||||
|
child: Image(
|
||||||
|
image: Image.memory(_image!).image,
|
||||||
|
fit: BoxFit.contain,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
height: 150,
|
onTap: () async {
|
||||||
child: Image(
|
setState(() {
|
||||||
image: Image.memory(_image!).image,
|
_image = null;
|
||||||
fit: BoxFit.contain,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: () async {
|
|
||||||
setState(() {
|
|
||||||
_image = null;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(5),
|
|
||||||
child: Visibility(
|
|
||||||
visible: _error != null,
|
|
||||||
child: Visibility(
|
|
||||||
visible: Provider.of<SettingsProvider>(context, listen: false).val().devToolsEnabled,
|
|
||||||
replacement: const Text('Senden fehlgeschlagen, bitte überprüfe die Internetverbindung.', textAlign: TextAlign.center, style: TextStyle(color: Colors.red)),
|
|
||||||
child: Text('Senden fehlgeschlagen: \n $_error', textAlign: TextAlign.center, style: const TextStyle(color: Colors.red)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 20, left: 10),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Visibility(
|
|
||||||
visible: _image == null,
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () async {
|
|
||||||
context.loaderOverlay.show();
|
|
||||||
var imageData = await (await FilePick.galleryPick())?.readAsBytes();
|
|
||||||
if(context.mounted) context.loaderOverlay.hide();
|
|
||||||
setState(() {
|
|
||||||
_image = imageData;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.attach_file_outlined),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Expanded(child: SizedBox.shrink()),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () async {
|
|
||||||
if(_feedbackInput.text.isEmpty){
|
|
||||||
setState(() {
|
|
||||||
_textFieldEmpty = true;
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
context.loaderOverlay.show();
|
|
||||||
AddFeedback(
|
|
||||||
AddFeedbackParams(
|
|
||||||
user: AccountData().getUserSecret(),
|
|
||||||
feedback: _feedbackInput.text,
|
|
||||||
screenshot: _image != null ? base64Encode(_image!) : null,
|
|
||||||
appVersion: int.parse((await PackageInfo.fromPlatform()).buildNumber),
|
|
||||||
)
|
|
||||||
).run().then((value) {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
InfoDialog.show(context, 'Danke für dein Feedback!');
|
|
||||||
context.loaderOverlay.hide();
|
|
||||||
}).catchError((error, trace) {
|
|
||||||
setState(() {
|
|
||||||
_error = error.toString();
|
|
||||||
});
|
|
||||||
context.loaderOverlay.hide();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: const Text('Senden'),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(5),
|
||||||
|
child: Visibility(
|
||||||
|
visible: _error != null,
|
||||||
|
child: Visibility(
|
||||||
|
visible: Provider.of<SettingsProvider>(context, listen: false).val().devToolsEnabled,
|
||||||
|
replacement: const Text('Senden fehlgeschlagen, bitte überprüfe die Internetverbindung.', textAlign: TextAlign.center, style: TextStyle(color: Colors.red)),
|
||||||
|
child: Text('Senden fehlgeschlagen: \n $_error', textAlign: TextAlign.center, style: const TextStyle(color: Colors.red)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 20, left: 10),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Visibility(
|
||||||
|
visible: _image == null,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () async {
|
||||||
|
context.loaderOverlay.show();
|
||||||
|
var imageData = await (await FilePick.galleryPick())?.readAsBytes();
|
||||||
|
if(context.mounted) context.loaderOverlay.hide();
|
||||||
|
setState(() {
|
||||||
|
_image = imageData;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.attach_file_outlined),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Expanded(child: SizedBox.shrink()),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () async {
|
||||||
|
if(_feedbackInput.text.isEmpty){
|
||||||
|
setState(() {
|
||||||
|
_textFieldEmpty = true;
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
context.loaderOverlay.show();
|
||||||
|
AddFeedback(
|
||||||
|
AddFeedbackParams(
|
||||||
|
user: AccountData().getUserSecret(),
|
||||||
|
feedback: _feedbackInput.text,
|
||||||
|
screenshot: _image != null ? base64Encode(_image!) : null,
|
||||||
|
appVersion: int.parse((await PackageInfo.fromPlatform()).buildNumber),
|
||||||
|
)
|
||||||
|
).run().then((value) {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
InfoDialog.show(context, 'Danke für dein Feedback!');
|
||||||
|
context.loaderOverlay.hide();
|
||||||
|
}).catchError((error, trace) {
|
||||||
|
setState(() {
|
||||||
|
_error = error.toString();
|
||||||
|
});
|
||||||
|
context.loaderOverlay.hide();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: const Text('Senden'),
|
||||||
|
)
|
||||||
|
]
|
||||||
)
|
)
|
||||||
]
|
|
||||||
)
|
)
|
||||||
)
|
|
||||||
|
|
||||||
],
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user