updated project linter-rules and enforced them
This commit is contained in:
@ -5,7 +5,7 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:marianum_mobile/extensions/text.dart';
|
||||
import '../../../../extensions/text.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../../api/marianumcloud/talk/chat/getChatResponse.dart';
|
||||
@ -114,7 +114,7 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
);
|
||||
|
||||
Text timeText = Text(
|
||||
Jiffy.parseFromMillisecondsSinceEpoch(widget.bubbleData.timestamp * 1000).format(pattern: "HH:mm"),
|
||||
Jiffy.parseFromMillisecondsSinceEpoch(widget.bubbleData.timestamp * 1000).format(pattern: 'HH:mm'),
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(color: widget.timeIconColor, fontSize: widget.timeIconSize),
|
||||
);
|
||||
@ -184,7 +184,7 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
),
|
||||
onLongPress: () {
|
||||
showDialog(context: context, builder: (context) {
|
||||
List<String> commonReactions = ["👍", "👎", "😆", "❤️", "👀", "🤔"];
|
||||
List<String> commonReactions = ['👍', '👎', '😆', '❤️', '👀', '🤔'];
|
||||
bool canReact = widget.bubbleData.messageType == GetRoomResponseObjectMessageType.comment;
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
@ -222,7 +222,7 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
visible: canReact,
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.add_reaction_outlined),
|
||||
title: const Text("Reaktionen"),
|
||||
title: const Text('Reaktionen'),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => MessageReactions(
|
||||
token: widget.chatData.token,
|
||||
@ -235,7 +235,7 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
visible: !message.containsFile,
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.copy),
|
||||
title: const Text("Nachricht kopieren"),
|
||||
title: const Text('Nachricht kopieren'),
|
||||
onTap: () => {
|
||||
Clipboard.setData(ClipboardData(text: widget.bubbleData.message)),
|
||||
Navigator.of(context).pop(),
|
||||
@ -256,7 +256,7 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
visible: widget.isSender && DateTime.fromMillisecondsSinceEpoch(widget.bubbleData.timestamp * 1000).add(const Duration(hours: 6)).isAfter(DateTime.now()),
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.delete_outline),
|
||||
title: const Text("Nachricht löschen"),
|
||||
title: const Text('Nachricht löschen'),
|
||||
onTap: () {
|
||||
DeleteMessage(widget.chatData.token, widget.bubbleData.id).run().then((value) {
|
||||
Provider.of<ChatProps>(context, listen: false).run();
|
||||
@ -276,12 +276,12 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
if(downloadProgress > 0) {
|
||||
showDialog(context: context, builder: (context) {
|
||||
return AlertDialog(
|
||||
title: const Text("Download abbrechen?"),
|
||||
content: const Text("Möchtest du den Download abbrechen?"),
|
||||
title: const Text('Download abbrechen?'),
|
||||
content: const Text('Möchtest du den Download abbrechen?'),
|
||||
actions: [
|
||||
TextButton(onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
}, child: const Text("Nein")),
|
||||
}, child: const Text('Nein')),
|
||||
TextButton(onPressed: () {
|
||||
downloadCore?.then((value) {
|
||||
if(!value.isCancelled) value.cancel();
|
||||
@ -291,7 +291,7 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
downloadProgress = 0;
|
||||
downloadCore = null;
|
||||
});
|
||||
}, child: const Text("Ja, Abbrechen"))
|
||||
}, child: const Text('Ja, Abbrechen'))
|
||||
],
|
||||
);
|
||||
});
|
||||
@ -336,7 +336,7 @@ class _ChatBubbleState extends State<ChatBubble> {
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(right: 2.5, left: 2.5),
|
||||
child: ActionChip(
|
||||
label: Text("${e.key} ${e.value}"),
|
||||
label: Text('${e.key} ${e.value}'),
|
||||
visualDensity: const VisualDensity(vertical: VisualDensity.minimumDensity, horizontal: VisualDensity.minimumDensity),
|
||||
padding: EdgeInsets.zero,
|
||||
backgroundColor: hasSelfReacted ? Theme.of(context).primaryColor : null,
|
||||
|
@ -14,14 +14,14 @@ class ChatMessage {
|
||||
Map<String, RichObjectString>? originalData;
|
||||
|
||||
RichObjectString? file;
|
||||
String content = "";
|
||||
String content = '';
|
||||
|
||||
bool get containsFile => file != null;
|
||||
|
||||
ChatMessage({required this.originalMessage, this.originalData}) {
|
||||
if(originalData?.containsKey("file") ?? false) {
|
||||
if(originalData?.containsKey('file') ?? false) {
|
||||
file = originalData?['file'];
|
||||
content = file?.name ?? "Datei";
|
||||
content = file?.name ?? 'Datei';
|
||||
} else {
|
||||
content = RichObjectStringProcessor.parseToString(originalMessage, originalData);
|
||||
}
|
||||
@ -56,7 +56,7 @@ class ChatMessage {
|
||||
fadeInDuration: Duration.zero,
|
||||
fadeOutDuration: Duration.zero,
|
||||
errorListener: (value) {},
|
||||
imageUrl: "https://${AccountData().buildHttpAuthString()}@${EndpointData().nextcloud().full()}/index.php/core/preview?fileId=${file!.id}&x=100&y=-1&a=1",
|
||||
imageUrl: 'https://${AccountData().buildHttpAuthString()}@${EndpointData().nextcloud().full()}/index.php/core/preview?fileId=${file!.id}&x=100&y=-1&a=1',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -41,9 +41,9 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
}
|
||||
|
||||
String filename = "${path.split("/").last.split(".").first}-${const Uuid().v4()}.${path.split(".").last}";
|
||||
String shareFolder = "MarianumMobile";
|
||||
String shareFolder = 'MarianumMobile';
|
||||
WebdavApi.webdav.then((webdav) {
|
||||
webdav.mkcol(PathUri.parse("/$shareFolder"));
|
||||
webdav.mkcol(PathUri.parse('/$shareFolder'));
|
||||
});
|
||||
|
||||
showDialog(context: context, builder: (context) => FileUploadDialog(
|
||||
@ -55,7 +55,7 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
FileSharingApi().share(FileSharingApiParams(
|
||||
shareType: 10,
|
||||
shareWith: widget.sendToToken,
|
||||
path: "$shareFolder/$filename",
|
||||
path: '$shareFolder/$filename',
|
||||
)).then((value) => _query());
|
||||
},
|
||||
), barrierDismissible: false);
|
||||
@ -77,7 +77,7 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
_textBoxController.text = settings.val().talkSettings.drafts[widget.sendToToken] ?? "";
|
||||
_textBoxController.text = settings.val().talkSettings.drafts[widget.sendToToken] ?? '';
|
||||
|
||||
return Stack(
|
||||
children: <Widget>[
|
||||
@ -95,12 +95,10 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
children: [
|
||||
ListTile(
|
||||
leading: const Icon(Icons.file_open),
|
||||
title: const Text("Aus Dateien auswählen"),
|
||||
title: const Text('Aus Dateien auswählen'),
|
||||
onTap: () {
|
||||
context.loaderOverlay.show();
|
||||
FilePick.documentPick().then((value) {
|
||||
mediaUpload(value);
|
||||
});
|
||||
FilePick.documentPick().then(mediaUpload);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
@ -108,7 +106,7 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
visible: !Platform.isIOS,
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.image),
|
||||
title: const Text("Aus Gallerie auswählen"),
|
||||
title: const Text('Aus Gallerie auswählen'),
|
||||
onTap: () {
|
||||
context.loaderOverlay.show();
|
||||
FilePick.galleryPick().then((value) {
|
||||
@ -147,12 +145,12 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
maxLines: 7,
|
||||
minLines: 1,
|
||||
decoration: const InputDecoration(
|
||||
hintText: "Nachricht schreiben...",
|
||||
hintText: 'Nachricht schreiben...',
|
||||
border: InputBorder.none,
|
||||
),
|
||||
onChanged: (String text) {
|
||||
if(text.trim().toLowerCase() == "marbot marbot marbot") {
|
||||
var newText = "Roboter sind cool und so, aber Marbots sind besser!";
|
||||
if(text.trim().toLowerCase() == 'marbot marbot marbot') {
|
||||
var newText = 'Roboter sind cool und so, aber Marbots sind besser!';
|
||||
_textBoxController.text = newText;
|
||||
text = newText;
|
||||
}
|
||||
@ -175,8 +173,8 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
_textBoxController.text = "";
|
||||
setDraft("");
|
||||
_textBoxController.text = '';
|
||||
setDraft('');
|
||||
});
|
||||
},
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
|
@ -37,7 +37,7 @@ class _ChatTileState extends State<ChatTile> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
SharedPreferences.getInstance().then((value) => {
|
||||
username = value.getString("username")!
|
||||
username = value.getString('username')!
|
||||
});
|
||||
|
||||
bool isGroup = widget.data.type != GetRoomResponseObjectConversationType.oneToOne;
|
||||
@ -110,7 +110,7 @@ class _ChatTileState extends State<ChatTile> {
|
||||
minHeight: 20,
|
||||
),
|
||||
child: Text(
|
||||
"${widget.data.unreadMessages}",
|
||||
'${widget.data.unreadMessages}',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
@ -132,7 +132,7 @@ class _ChatTileState extends State<ChatTile> {
|
||||
visible: widget.data.unreadMessages > 0,
|
||||
replacement: ListTile(
|
||||
leading: const Icon(Icons.mark_chat_unread_outlined),
|
||||
title: const Text("Als ungelesen markieren"),
|
||||
title: const Text('Als ungelesen markieren'),
|
||||
onTap: () {
|
||||
SetReadMarker(widget.data.token, false).run().then((value) => widget.query(renew: true));
|
||||
Navigator.of(context).pop();
|
||||
@ -140,7 +140,7 @@ class _ChatTileState extends State<ChatTile> {
|
||||
),
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.mark_chat_read_outlined),
|
||||
title: const Text("Als gelesen markieren"),
|
||||
title: const Text('Als gelesen markieren'),
|
||||
onTap: () {
|
||||
setCurrentAsRead();
|
||||
Navigator.of(context).pop();
|
||||
@ -151,7 +151,7 @@ class _ChatTileState extends State<ChatTile> {
|
||||
visible: widget.data.isFavorite,
|
||||
replacement: ListTile(
|
||||
leading: const Icon(Icons.star_outline),
|
||||
title: const Text("Zu Favoriten hinzufügen"),
|
||||
title: const Text('Zu Favoriten hinzufügen'),
|
||||
onTap: () {
|
||||
SetFavorite(widget.data.token, true).run().then((value) => widget.query(renew: true));
|
||||
Navigator.of(context).pop();
|
||||
@ -159,7 +159,7 @@ class _ChatTileState extends State<ChatTile> {
|
||||
),
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.stars_outlined),
|
||||
title: const Text("Von Favoriten entfernen"),
|
||||
title: const Text('Von Favoriten entfernen'),
|
||||
onTap: () {
|
||||
SetFavorite(widget.data.token, false).run().then((value) => widget.query(renew: true));
|
||||
Navigator.of(context).pop();
|
||||
@ -168,12 +168,12 @@ class _ChatTileState extends State<ChatTile> {
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.delete_outline),
|
||||
title: const Text("Konversation verlassen"),
|
||||
title: const Text('Konversation verlassen'),
|
||||
onTap: () {
|
||||
ConfirmDialog(
|
||||
title: "Chat verlassen",
|
||||
content: "Du benötigst ggf. eine Einladung um erneut beizutreten.",
|
||||
confirmButton: "Löschen",
|
||||
title: 'Chat verlassen',
|
||||
content: 'Du benötigst ggf. eine Einladung um erneut beizutreten.',
|
||||
confirmButton: 'Löschen',
|
||||
onConfirm: () {
|
||||
LeaveRoom(widget.data.token).run().then((value) => widget.query(renew: true));
|
||||
Navigator.of(context).pop();
|
||||
|
@ -17,10 +17,10 @@ class SplitViewPlaceholder extends StatelessWidget {
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
invertColors: !AppTheme.isDarkMode(context),
|
||||
),
|
||||
child: Image.asset("assets/logo/icon.png", height: 200),
|
||||
child: Image.asset('assets/logo/icon.png', height: 200),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
const Text("Marianum Fulda\nTalk", textAlign: TextAlign.center, style: TextStyle(fontSize: 30)),
|
||||
const Text('Marianum Fulda\nTalk', textAlign: TextAlign.center, style: TextStyle(fontSize: 30)),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
Reference in New Issue
Block a user