mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-25 15:02:33 +01:00
chore: Nicer message info dialog
This commit is contained in:
parent
69b7359b96
commit
effea76139
@ -83,7 +83,10 @@ class ChatView extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
const Icon(Icons.report_outlined),
|
const Icon(
|
||||||
|
Icons.shield_outlined,
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Text(L10n.of(context).reportMessage),
|
Text(L10n.of(context).reportMessage),
|
||||||
],
|
],
|
||||||
|
@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
|
|
||||||
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
import 'package:fluffychat/utils/date_time_extension.dart';
|
import 'package:fluffychat/utils/date_time_extension.dart';
|
||||||
import 'package:fluffychat/widgets/avatar.dart';
|
import 'package:fluffychat/widgets/avatar.dart';
|
||||||
|
|
||||||
@ -27,7 +28,7 @@ class EventInfoDialog extends StatelessWidget {
|
|||||||
|
|
||||||
String get prettyJson {
|
String get prettyJson {
|
||||||
const JsonDecoder decoder = JsonDecoder();
|
const JsonDecoder decoder = JsonDecoder();
|
||||||
const JsonEncoder encoder = JsonEncoder.withIndent(' ');
|
const JsonEncoder encoder = JsonEncoder.withIndent(' ');
|
||||||
final object = decoder.convert(jsonEncode(event.toJson()));
|
final object = decoder.convert(jsonEncode(event.toJson()));
|
||||||
return encoder.convert(object);
|
return encoder.convert(object);
|
||||||
}
|
}
|
||||||
@ -52,7 +53,7 @@ class EventInfoDialog extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
title: Text(L10n.of(context).sender),
|
title: Text(L10n.of(context).sender),
|
||||||
subtitle:
|
subtitle:
|
||||||
Text('${event.sender.calcDisplayname()} <${event.senderId}>'),
|
Text('${event.sender.calcDisplayname()} [${event.senderId}]'),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(L10n.of(context).time),
|
title: Text(L10n.of(context).time),
|
||||||
@ -62,14 +63,17 @@ class EventInfoDialog extends StatelessWidget {
|
|||||||
title: Text(L10n.of(context).messageType),
|
title: Text(L10n.of(context).messageType),
|
||||||
subtitle: Text(event.humanreadableType),
|
subtitle: Text(event.humanreadableType),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(title: Text('${L10n.of(context).sourceCode}:')),
|
||||||
title: Text(L10n.of(context).sourceCode),
|
|
||||||
),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(12.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: SingleChildScrollView(
|
child: Material(
|
||||||
scrollDirection: Axis.horizontal,
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||||
child: Text(prettyJson),
|
color: Theme.of(context).colorScheme.surface,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: SelectableText(prettyJson),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user