updated project linter-rules and enforced them
This commit is contained in:
@ -8,12 +8,12 @@ class About extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text("Über diese App"),
|
||||
title: const Text('Über diese App'),
|
||||
),
|
||||
body: const Card(
|
||||
elevation: 1,
|
||||
borderOnForeground: true,
|
||||
child: Text("Marianum Fulda"),
|
||||
child: Text('Marianum Fulda'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -32,13 +32,13 @@ class _AnimatedTimeState extends State<AnimatedTime> {
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
const Text("Noch "),
|
||||
const Text('Noch '),
|
||||
buildWidget(current.inDays),
|
||||
const Text(" Tage, "),
|
||||
const Text(' Tage, '),
|
||||
buildWidget(current.inHours > 24 ? current.inHours - current.inDays * 24 : current.inHours),
|
||||
const Text(":"),
|
||||
const Text(':'),
|
||||
buildWidget(current.inMinutes > 60 ? current.inMinutes - current.inHours * 60 : current.inMinutes),
|
||||
const Text(":"),
|
||||
const Text(':'),
|
||||
buildWidget(current.inSeconds > 60 ? current.inSeconds - current.inMinutes * 60 : current.inSeconds),
|
||||
],
|
||||
);
|
||||
|
@ -8,10 +8,10 @@ class ConfirmDialog extends StatelessWidget {
|
||||
final String confirmButton;
|
||||
final String cancelButton;
|
||||
final void Function() onConfirm;
|
||||
const ConfirmDialog({super.key, required this.title, this.content = "", this.icon, this.confirmButton = "Ok", this.cancelButton = "Abbrechen", required this.onConfirm});
|
||||
const ConfirmDialog({super.key, required this.title, this.content = '', this.icon, this.confirmButton = 'Ok', this.cancelButton = 'Abbrechen', required this.onConfirm});
|
||||
|
||||
void asDialog(BuildContext context) {
|
||||
showDialog(context: context, builder: (context) => build(context));
|
||||
showDialog(context: context, builder: build);
|
||||
}
|
||||
|
||||
@override
|
||||
@ -36,9 +36,9 @@ class ConfirmDialog extends StatelessWidget {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => ConfirmDialog(
|
||||
title: "Link öffnen",
|
||||
content: "Möchtest du den folgenden Link öffnen?\n$url",
|
||||
confirmButton: "Öffnen",
|
||||
title: 'Link öffnen',
|
||||
content: 'Möchtest du den folgenden Link öffnen?\n$url',
|
||||
confirmButton: 'Öffnen',
|
||||
onConfirm: () => launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication),
|
||||
),
|
||||
);
|
||||
|
@ -11,7 +11,7 @@ import '../../../widget/placeholderView.dart';
|
||||
import 'jsonViewer.dart';
|
||||
|
||||
class CacheView extends StatefulWidget {
|
||||
final collection = "MarianumMobile";
|
||||
final collection = 'MarianumMobile';
|
||||
const CacheView({super.key});
|
||||
|
||||
@override
|
||||
@ -42,7 +42,7 @@ class _CacheViewState extends State<CacheView> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text("Lokaler cache"),
|
||||
title: const Text('Lokaler cache'),
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: files,
|
||||
@ -52,7 +52,7 @@ class _CacheViewState extends State<CacheView> {
|
||||
itemCount: snapshot.data!.length,
|
||||
itemBuilder: (context, index) {
|
||||
Map<String, dynamic> element = snapshot.data![snapshot.data!.keys.elementAt(index)];
|
||||
String filename = snapshot.data!.keys.elementAt(index).split("/").last;
|
||||
String filename = snapshot.data!.keys.elementAt(index).split('/').last;
|
||||
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.text_snippet_outlined),
|
||||
@ -70,11 +70,11 @@ class _CacheViewState extends State<CacheView> {
|
||||
children: [
|
||||
const ListTile(
|
||||
leading: Icon(Icons.delete_forever),
|
||||
title: Text("Diese Datei löschen"),
|
||||
title: Text('Diese Datei löschen'),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.copy),
|
||||
title: const Text("Dateitext kopieren"),
|
||||
title: const Text('Dateitext kopieren'),
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(text: jsonEncode(element)));
|
||||
Navigator.of(context).pop();
|
||||
@ -93,7 +93,7 @@ class _CacheViewState extends State<CacheView> {
|
||||
);
|
||||
} else {
|
||||
return const Center(
|
||||
child: PlaceholderView(icon: Icons.hourglass_empty, text: "Keine Daten"),
|
||||
child: PlaceholderView(icon: Icons.hourglass_empty, text: 'Keine Daten'),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
@ -15,17 +15,17 @@ class DebugTile {
|
||||
|
||||
Widget jsonData(Map<String, dynamic> data, {bool ignoreConfig = false}) {
|
||||
return callback(
|
||||
title: "JSON daten anzeigen",
|
||||
title: 'JSON daten anzeigen',
|
||||
onTab: () => JsonViewer.asDialog(context, data)
|
||||
);
|
||||
}
|
||||
|
||||
Widget callback({String title = "Debugaktion", required void Function() onTab}) {
|
||||
Widget callback({String title = 'Debugaktion', required void Function() onTab}) {
|
||||
return child(
|
||||
ListTile(
|
||||
leading: const CenteredLeading(Icon(Icons.developer_mode_outlined)),
|
||||
title: Text(title),
|
||||
subtitle: const Text("Entwicklermodus aktiviert"),
|
||||
subtitle: const Text('Entwicklermodus aktiviert'),
|
||||
onTap: onTab,
|
||||
)
|
||||
);
|
||||
|
@ -30,20 +30,20 @@ class JsonViewer extends StatelessWidget {
|
||||
showDialog(context: context, builder: (context) {
|
||||
return AlertDialog(
|
||||
scrollable: true,
|
||||
title: const Row(children: [Icon(Icons.bug_report_outlined), Text("Rohdaten")]),
|
||||
title: const Row(children: [Icon(Icons.bug_report_outlined), Text('Rohdaten')]),
|
||||
content: Text(JsonViewer.format(dataMap)),
|
||||
actions: [
|
||||
TextButton(onPressed: () {
|
||||
Clipboard.setData(ClipboardData(text: JsonViewer.format(dataMap))).then((value) {
|
||||
showDialog(context: context, builder: (context) => const AlertDialog(content: Text("Formatiertes JSON wurde erfolgreich in deiner Zwischenlage abgelegt.")));
|
||||
showDialog(context: context, builder: (context) => const AlertDialog(content: Text('Formatiertes JSON wurde erfolgreich in deiner Zwischenlage abgelegt.')));
|
||||
});
|
||||
}, child: const Text("Kopieren")),
|
||||
}, child: const Text('Kopieren')),
|
||||
TextButton(onPressed: () {
|
||||
Clipboard.setData(ClipboardData(text: dataMap.toString())).then((value) {
|
||||
showDialog(context: context, builder: (context) => const AlertDialog(content: Text("Unformatiertes JSON wurde erfolgreich in deiner Zwischenablage abgelegt.")));
|
||||
showDialog(context: context, builder: (context) => const AlertDialog(content: Text('Unformatiertes JSON wurde erfolgreich in deiner Zwischenablage abgelegt.')));
|
||||
});
|
||||
}, child: const Text("Inline Kopieren")),
|
||||
TextButton(onPressed: () => Navigator.of(context).pop(), child: const Text("Schließen"))
|
||||
}, child: const Text('Inline Kopieren')),
|
||||
TextButton(onPressed: () => Navigator.of(context).pop(), child: const Text('Schließen'))
|
||||
],
|
||||
);
|
||||
});
|
||||
|
@ -37,7 +37,7 @@ class _FileViewerState extends State<FileViewer> {
|
||||
Widget build(BuildContext context) {
|
||||
AppBar appbar({List actions = const []}) {
|
||||
return AppBar(
|
||||
title: Text(widget.path.split("/").last),
|
||||
title: Text(widget.path.split('/').last),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () => Navigator.of(context).push(
|
||||
@ -59,12 +59,12 @@ class _FileViewerState extends State<FileViewer> {
|
||||
);
|
||||
}
|
||||
|
||||
switch(openExternal ? "" : widget.path.split(".").last.toLowerCase()) {
|
||||
case "png":
|
||||
case "jpg":
|
||||
case "jpeg":
|
||||
case "webp":
|
||||
case "gif":
|
||||
switch(openExternal ? '' : widget.path.split('.').last.toLowerCase()) {
|
||||
case 'png':
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
case 'webp':
|
||||
case 'gif':
|
||||
return Scaffold(
|
||||
appBar: appbar(
|
||||
actions: [
|
||||
@ -84,7 +84,7 @@ class _FileViewerState extends State<FileViewer> {
|
||||
);
|
||||
|
||||
|
||||
case "pdf":
|
||||
case 'pdf':
|
||||
return Scaffold(
|
||||
appBar: appbar(),
|
||||
body: SfPdfViewer.file(
|
||||
@ -105,11 +105,11 @@ class _FileViewerState extends State<FileViewer> {
|
||||
});
|
||||
|
||||
return PlaceholderView(
|
||||
text: "Datei extern geöffnet",
|
||||
text: 'Datei extern geöffnet',
|
||||
icon: Icons.open_in_new,
|
||||
button: TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: const Text("Zurück"),
|
||||
child: const Text('Zurück'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -11,10 +11,10 @@ class LargeProfilePictureView extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text("Profilbild"),
|
||||
title: const Text('Profilbild'),
|
||||
),
|
||||
body: PhotoView(
|
||||
imageProvider: Image.network("https://${EndpointData().nextcloud().full()}/avatar/$username/1024").image,
|
||||
imageProvider: Image.network('https://${EndpointData().nextcloud().full()}/avatar/$username/1024').image,
|
||||
backgroundDecoration: BoxDecoration(color: Theme.of(context).colorScheme.surface),
|
||||
),
|
||||
);
|
||||
|
@ -41,7 +41,7 @@ class _LoadingSpinnerState extends State<LoadingSpinner> {
|
||||
visible: textVisible,
|
||||
child: const Text(
|
||||
textAlign: TextAlign.center,
|
||||
"Irgendetwas funktioniert nicht!\nBist du mit dem Internet verbunden?\n\nVersuche die App neuzustarten"
|
||||
'Irgendetwas funktioniert nicht!\nBist du mit dem Internet verbunden?\n\nVersuche die App neuzustarten'
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -2,6 +2,6 @@ import 'package:flutter/material.dart';
|
||||
|
||||
class UnimplementedDialog {
|
||||
static void show(BuildContext context) {
|
||||
showDialog(context: context, builder: (context) => const AlertDialog(content: Text("Not implemented yet")));
|
||||
showDialog(context: context, builder: (context) => const AlertDialog(content: Text('Not implemented yet')));
|
||||
}
|
||||
}
|
@ -16,7 +16,7 @@ class UserAvatar extends StatelessWidget {
|
||||
return CircleAvatar(
|
||||
foregroundImage: Image(
|
||||
image: CachedNetworkImageProvider(
|
||||
"https://${AccountData().buildHttpAuthString()}@${EndpointData().nextcloud().full()}/ocs/v2.php/apps/spreed/api/v1/room/$id/avatar",
|
||||
'https://${AccountData().buildHttpAuthString()}@${EndpointData().nextcloud().full()}/ocs/v2.php/apps/spreed/api/v1/room/$id/avatar',
|
||||
errorListener: (p0) {}
|
||||
)
|
||||
).image,
|
||||
@ -30,7 +30,7 @@ class UserAvatar extends StatelessWidget {
|
||||
return CircleAvatar(
|
||||
foregroundImage: Image(
|
||||
image: CachedNetworkImageProvider(
|
||||
"https://${EndpointData().nextcloud().full()}/avatar/$id/$size",
|
||||
'https://${EndpointData().nextcloud().full()}/avatar/$id/$size',
|
||||
errorListener: (p0) {}
|
||||
),
|
||||
).image,
|
||||
|
Reference in New Issue
Block a user