dart format
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
@@ -46,40 +45,49 @@ class _FeedbackDialogState extends State<FeedbackDialog> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Feedback'),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
const SizedBox(height: 5),
|
||||
const Text('Feedback, Anregungen, Ideen, Fehler und Verbesserungen', textAlign: TextAlign.center),
|
||||
const SizedBox(height: 15),
|
||||
const Text('Bitte gib keine geheimen Daten wie z.B. Passwörter weiter.', textAlign: TextAlign.center, style: TextStyle(fontSize: 11)),
|
||||
const SizedBox(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: TextField(
|
||||
onChanged: (value) {
|
||||
if(value.trim().toLowerCase() == 'ranzig') {
|
||||
_feedbackInput.text = 'selber';
|
||||
}
|
||||
},
|
||||
controller: _feedbackInput,
|
||||
autofocus: true,
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(),
|
||||
label: const Text('Feedback und Verbesserungen'),
|
||||
errorText: _textFieldEmpty ? 'Bitte gib eine Beschreibung an!' : null,
|
||||
),
|
||||
minLines: 4,
|
||||
maxLines: 7,
|
||||
onTapOutside: (PointerDownEvent event) => FocusBehaviour.textFieldTapOutside(context),
|
||||
appBar: AppBar(title: const Text('Feedback')),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
const SizedBox(height: 5),
|
||||
const Text(
|
||||
'Feedback, Anregungen, Ideen, Fehler und Verbesserungen',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
const Text(
|
||||
'Bitte gib keine geheimen Daten wie z.B. Passwörter weiter.',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 11),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: TextField(
|
||||
onChanged: (value) {
|
||||
if (value.trim().toLowerCase() == 'ranzig') {
|
||||
_feedbackInput.text = 'selber';
|
||||
}
|
||||
},
|
||||
controller: _feedbackInput,
|
||||
autofocus: true,
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(),
|
||||
label: const Text('Feedback und Verbesserungen'),
|
||||
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(
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
if (_image != null)
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
badges.Badge(
|
||||
@@ -109,76 +117,95 @@ class _FeedbackDialogState extends State<FeedbackDialog> {
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: Visibility(
|
||||
visible: _error != null,
|
||||
child: Visibility(
|
||||
visible: _error != null,
|
||||
child: Visibility(
|
||||
visible: context.read<SettingsCubit>().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)),
|
||||
visible: context.read<SettingsCubit>().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();
|
||||
final picked = await FilePick.multipleGalleryPick();
|
||||
final imageData = await picked?.first.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();
|
||||
unawaited(AddFeedback(
|
||||
AddFeedbackParams(
|
||||
user: AccountData().getUserSecret(),
|
||||
feedback: _feedbackInput.text,
|
||||
screenshot: _image != null ? base64Encode(_image!) : null,
|
||||
appVersion: int.parse((await PackageInfo.fromPlatform()).buildNumber),
|
||||
),
|
||||
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();
|
||||
final picked = await FilePick.multipleGalleryPick();
|
||||
final imageData = await picked?.first.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();
|
||||
unawaited(
|
||||
AddFeedback(
|
||||
AddFeedbackParams(
|
||||
user: AccountData().getUserSecret(),
|
||||
feedback: _feedbackInput.text,
|
||||
screenshot: _image != null
|
||||
? base64Encode(_image!)
|
||||
: null,
|
||||
appVersion: int.parse(
|
||||
(await PackageInfo.fromPlatform()).buildNumber,
|
||||
),
|
||||
).run().then((value) {
|
||||
),
|
||||
)
|
||||
.run()
|
||||
.then((value) {
|
||||
if (!context.mounted) return;
|
||||
Navigator.of(context).pop();
|
||||
InfoDialog.show(context, 'Danke für dein Feedback!');
|
||||
InfoDialog.show(
|
||||
context,
|
||||
'Danke für dein Feedback!',
|
||||
);
|
||||
context.loaderOverlay.hide();
|
||||
}).catchError((Object error, StackTrace trace) {
|
||||
})
|
||||
.catchError((Object error, StackTrace trace) {
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_error = error.toString();
|
||||
});
|
||||
if (!context.mounted) return;
|
||||
context.loaderOverlay.hide();
|
||||
}));
|
||||
},
|
||||
child: const Text('Senden'),
|
||||
)
|
||||
]
|
||||
)
|
||||
)
|
||||
|
||||
],
|
||||
),
|
||||
}),
|
||||
);
|
||||
},
|
||||
child: const Text('Senden'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,14 +6,14 @@ class Roomplan extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Raumplan'),
|
||||
appBar: AppBar(title: const Text('Raumplan')),
|
||||
body: PhotoView(
|
||||
imageProvider: Image.asset('assets/img/raumplan.png').image,
|
||||
minScale: 0.5,
|
||||
maxScale: 2.0,
|
||||
backgroundDecoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
body: PhotoView(
|
||||
imageProvider: Image.asset('assets/img/raumplan.png').image,
|
||||
minScale: 0.5,
|
||||
maxScale: 2.0,
|
||||
backgroundDecoration: BoxDecoration(color: Theme.of(context).colorScheme.surface),
|
||||
),
|
||||
);
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,10 @@ class AppSharePlatformView extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(title, style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
@@ -26,8 +29,8 @@ class AppSharePlatformView extends StatelessWidget {
|
||||
version: QrVersions.auto,
|
||||
size: 200,
|
||||
dataModuleStyle: QrDataModuleStyle(
|
||||
color: foregroundColor,
|
||||
dataModuleShape: QrDataModuleShape.square
|
||||
color: foregroundColor,
|
||||
dataModuleShape: QrDataModuleShape.square,
|
||||
),
|
||||
eyeStyle: QrEyeStyle(
|
||||
color: foregroundColor,
|
||||
|
||||
@@ -25,23 +25,29 @@ class _QrShareViewState extends State<QrShareView> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => DefaultTabController(
|
||||
length: 2,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Teile die App'),
|
||||
bottom: const TabBar(
|
||||
tabs: [
|
||||
Tab(icon: Icon(Icons.android_outlined), text: 'Android'),
|
||||
Tab(icon: Icon(Icons.apple_outlined), text: 'iOS & iPadOS'),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: const TabBarView(
|
||||
children: [
|
||||
AppSharePlatformView('Für Android', 'https://play.google.com/store/apps/details?id=eu.mhsl.marianum.mobile.client'),
|
||||
AppSharePlatformView('Für iOS & iPad', 'https://apps.apple.com/us/app/marianum-fulda/id6458789560'),
|
||||
length: 2,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Teile die App'),
|
||||
bottom: const TabBar(
|
||||
tabs: [
|
||||
Tab(icon: Icon(Icons.android_outlined), text: 'Android'),
|
||||
Tab(icon: Icon(Icons.apple_outlined), text: 'iOS & iPadOS'),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
body: const TabBarView(
|
||||
children: [
|
||||
AppSharePlatformView(
|
||||
'Für Android',
|
||||
'https://play.google.com/store/apps/details?id=eu.mhsl.marianum.mobile.client',
|
||||
),
|
||||
AppSharePlatformView(
|
||||
'Für iOS & iPad',
|
||||
'https://apps.apple.com/us/app/marianum-fulda/id6458789560',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -30,14 +30,17 @@ Future<ShareTargetType?> showSelectShareTypeSheet(BuildContext context) {
|
||||
trailing: const Icon(Icons.arrow_right),
|
||||
onTap: () {
|
||||
Navigator.of(sheetCtx).pop();
|
||||
SharePlus.instance.share(ShareParams(
|
||||
sharePositionOrigin: SharePositionOrigin.get(sheetCtx),
|
||||
subject: 'App Teilen',
|
||||
text: 'Hol dir die für das Marianum maßgeschneiderte App:'
|
||||
'\n\nAndroid: https://play.google.com/store/apps/details?id=eu.mhsl.marianum.mobile.client '
|
||||
'\niOS: https://apps.apple.com/us/app/marianum-fulda/id6458789560 '
|
||||
'\n\nViel Spaß!',
|
||||
));
|
||||
SharePlus.instance.share(
|
||||
ShareParams(
|
||||
sharePositionOrigin: SharePositionOrigin.get(sheetCtx),
|
||||
subject: 'App Teilen',
|
||||
text:
|
||||
'Hol dir die für das Marianum maßgeschneiderte App:'
|
||||
'\n\nAndroid: https://play.google.com/store/apps/details?id=eu.mhsl.marianum.mobile.client '
|
||||
'\niOS: https://apps.apple.com/us/app/marianum-fulda/id6458789560 '
|
||||
'\n\nViel Spaß!',
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user