fluffychat merge - resolve conflicts

pull/1384/head
ggurdin 1 year ago
commit ebc4a88d4e
No known key found for this signature in database
GPG Key ID: A01CB41737CBB478

@ -9,6 +9,7 @@ linter:
- prefer_final_in_for_each - prefer_final_in_for_each
- sort_pub_dependencies - sort_pub_dependencies
- require_trailing_commas - require_trailing_commas
- omit_local_variable_types
analyzer: analyzer:
errors: errors:

@ -1,6 +1,10 @@
{ {
"@@locale": "de", "@@locale": "de",
"@@last_modified": "2021-08-14 12:41:10.119255", "@@last_modified": "2021-08-14 12:41:10.119255",
"alwaysUse24HourFormat": "true",
"@alwaysUse24HourFormat": {
"description": "Set to true to always display time of day in 24 hour format."
},
"about": "Über", "about": "Über",
"@about": { "@about": {
"type": "text", "type": "text",

@ -1,6 +1,10 @@
{ {
"@@locale": "en", "@@locale": "en",
"@@last_modified": "2021-08-14 12:38:37.885451", "@@last_modified": "2021-08-14 12:38:37.885451",
"alwaysUse24HourFormat": "false",
"@alwaysUse24HourFormat": {
"description": "Set to true to always display time of day in 24 hour format."
},
"repeatPassword": "Repeat password", "repeatPassword": "Repeat password",
"@repeatPassword": {}, "@repeatPassword": {},
"notAnImage": "Not an image file.", "notAnImage": "Not an image file.",

@ -13,96 +13,141 @@ class ChatEmojiPicker extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final theme = Theme.of(context);
// #Pangea return AnimatedContainer(
return Material( duration: FluffyThemes.animationDuration,
// Pangea# curve: FluffyThemes.animationCurve,
child: AnimatedContainer( clipBehavior: Clip.hardEdge,
duration: FluffyThemes.animationDuration, decoration: const BoxDecoration(),
curve: FluffyThemes.animationCurve, height: controller.showEmojiPicker
clipBehavior: Clip.hardEdge, ? MediaQuery.of(context).size.height / 2
decoration: const BoxDecoration(), : 0,
height: controller.showEmojiPicker child: controller.showEmojiPicker
? MediaQuery.of(context).size.height / 2 ? DefaultTabController(
: 0, length: 2,
child: controller.showEmojiPicker child: Column(
? DefaultTabController( children: [
length: 2, TabBar(
child: Column( tabs: [
children: [ Tab(text: L10n.of(context)!.emojis),
TabBar( Tab(text: L10n.of(context)!.stickers),
tabs: [ ],
Tab(text: L10n.of(context)!.emojis), ),
Tab(text: L10n.of(context)!.stickers), Expanded(
child: TabBarView(
children: [
EmojiPicker(
onEmojiSelected: controller.onEmojiSelected,
onBackspacePressed: controller.emojiPickerBackspace,
config: Config(
emojiViewConfig: EmojiViewConfig(
noRecents: const NoRecent(),
backgroundColor: Theme.of(context)
.colorScheme
.onInverseSurface,
),
bottomActionBarConfig: const BottomActionBarConfig(
enabled: false,
),
categoryViewConfig: CategoryViewConfig(
backspaceColor: theme.colorScheme.primary,
iconColor:
theme.colorScheme.primary.withOpacity(0.5),
iconColorSelected: theme.colorScheme.primary,
indicatorColor: theme.colorScheme.primary,
),
skinToneConfig: SkinToneConfig(
dialogBackgroundColor: Color.lerp(
theme.colorScheme.surface,
theme.colorScheme.primaryContainer,
0.75,
)!,
indicatorColor: theme.colorScheme.onSurface,
),
),
),
StickerPickerDialog(
room: controller.room,
onSelected: (sticker) {
controller.room.sendEvent(
{
'body': sticker.body,
'info': sticker.info ?? {},
'url': sticker.url.toString(),
},
type: EventTypes.Sticker,
);
controller.hideEmojiPicker();
},
),
], ],
), ),
Expanded( ),
child: TabBarView( Expanded(
children: [ child: TabBarView(
EmojiPicker( children: [
onEmojiSelected: controller.onEmojiSelected, EmojiPicker(
onBackspacePressed: controller.emojiPickerBackspace, onEmojiSelected: controller.onEmojiSelected,
config: Config( onBackspacePressed: controller.emojiPickerBackspace,
emojiViewConfig: EmojiViewConfig( config: Config(
noRecents: const NoRecent(), emojiViewConfig: EmojiViewConfig(
backgroundColor: Theme.of(context) noRecents: const NoRecent(),
.colorScheme backgroundColor: Theme.of(context)
.onInverseSurface, .colorScheme
), .onInverseSurface,
bottomActionBarConfig: ),
const BottomActionBarConfig( bottomActionBarConfig: const BottomActionBarConfig(
enabled: false, enabled: false,
), ),
categoryViewConfig: CategoryViewConfig( categoryViewConfig: CategoryViewConfig(
backspaceColor: theme.colorScheme.primary, backspaceColor: theme.colorScheme.primary,
iconColor: iconColor:
theme.colorScheme.primary.withOpacity(0.5), theme.colorScheme.primary.withOpacity(0.5),
iconColorSelected: theme.colorScheme.primary, iconColorSelected: theme.colorScheme.primary,
indicatorColor: theme.colorScheme.primary, indicatorColor: theme.colorScheme.primary,
), ),
skinToneConfig: SkinToneConfig( skinToneConfig: SkinToneConfig(
dialogBackgroundColor: Color.lerp( dialogBackgroundColor: Color.lerp(
theme.colorScheme.surface, theme.colorScheme.surface,
theme.colorScheme.primaryContainer, theme.colorScheme.primaryContainer,
0.75, 0.75,
)!, )!,
indicatorColor: theme.colorScheme.onSurface, indicatorColor: theme.colorScheme.onSurface,
),
), ),
), ),
StickerPickerDialog( ),
room: controller.room, StickerPickerDialog(
onSelected: (sticker) { room: controller.room,
controller.room.sendEvent( onSelected: (sticker) {
{ controller.room.sendEvent(
'body': sticker.body, {
'info': sticker.info ?? {}, 'body': sticker.body,
'url': sticker.url.toString(), 'info': sticker.info ?? {},
}, 'url': sticker.url.toString(),
type: EventTypes.Sticker, },
); type: EventTypes.Sticker,
controller.hideEmojiPicker(); );
}, controller.hideEmojiPicker();
), },
], ),
), ],
), ),
// #Pangea ),
Padding( // #Pangea
padding: const EdgeInsets.symmetric(vertical: 8.0), Padding(
child: FloatingActionButton( padding: const EdgeInsets.symmetric(vertical: 8.0),
onPressed: controller.hideEmojiPicker, child: FloatingActionButton(
shape: const CircleBorder(), onPressed: controller.hideEmojiPicker,
mini: true, shape: const CircleBorder(),
child: const Icon(Icons.close), mini: true,
), child: const Icon(Icons.close),
), ),
// Pangea# ),
], // Pangea#
), ],
) ),
: null, )
), : null,
); );
} }
} }

@ -28,8 +28,8 @@ class EventInfoDialog extends StatelessWidget {
}); });
String get prettyJson { String get prettyJson {
const JsonDecoder decoder = JsonDecoder(); const decoder = JsonDecoder();
const JsonEncoder encoder = JsonEncoder.withIndent(' '); const 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);
} }

@ -51,9 +51,6 @@ class InputBar extends StatelessWidget {
}); });
List<Map<String, String?>> getSuggestions(String text) { List<Map<String, String?>> getSuggestions(String text) {
// #Pangea
final List<Map<String, String?>> ret = <Map<String, String?>>[];
// Pangea#
if (controller!.selection.baseOffset != if (controller!.selection.baseOffset !=
controller!.selection.extentOffset || controller!.selection.extentOffset ||
controller!.selection.baseOffset < 0) { controller!.selection.baseOffset < 0) {
@ -61,9 +58,7 @@ class InputBar extends StatelessWidget {
} }
final searchText = final searchText =
controller!.text.substring(0, controller!.selection.baseOffset); controller!.text.substring(0, controller!.selection.baseOffset);
// #Pangea final ret = <Map<String, String?>>[];
// final List<Map<String, String?>> ret = <Map<String, String?>>[];
// Pangea#
const maxResults = 30; const maxResults = 30;
final commandMatch = RegExp(r'^/(\w*)$').firstMatch(searchText); final commandMatch = RegExp(r'^/(\w*)$').firstMatch(searchText);

@ -64,7 +64,7 @@ class SendFileDialogState extends State<SendFileDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var sendStr = L10n.of(context)!.sendFile; var sendStr = L10n.of(context)!.sendFile;
final bool allFilesAreImages = final allFilesAreImages =
widget.files.every((file) => file is MatrixImageFile); widget.files.every((file) => file is MatrixImageFile);
final sizeString = widget.files final sizeString = widget.files
.fold<double>(0, (p, file) => p + file.bytes.length) .fold<double>(0, (p, file) => p + file.bytes.length)

@ -259,7 +259,7 @@ class ClientChooserButton extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final matrix = Matrix.of(context); final matrix = Matrix.of(context);
int clientCount = 0; var clientCount = 0;
matrix.accountBundles.forEach((key, value) => clientCount += value.length); matrix.accountBundles.forEach((key, value) => clientCount += value.length);
return FutureBuilder<Profile>( return FutureBuilder<Profile>(
future: matrix.client.fetchOwnProfile(), future: matrix.client.fetchOwnProfile(),
@ -430,7 +430,7 @@ class ClientChooserButton extends StatelessWidget {
); );
// beginning from end if negative // beginning from end if negative
if (index < 0) { if (index < 0) {
int clientCount = 0; var clientCount = 0;
matrix.accountBundles matrix.accountBundles
.forEach((key, value) => clientCount += value.length); .forEach((key, value) => clientCount += value.length);
_handleKeyboardShortcut(matrix, clientCount, context); _handleKeyboardShortcut(matrix, clientCount, context);
@ -450,7 +450,7 @@ class ClientChooserButton extends StatelessWidget {
} }
int? _shortcutIndexOfClient(MatrixState matrix, Client client) { int? _shortcutIndexOfClient(MatrixState matrix, Client client) {
int index = 0; var index = 0;
final bundles = matrix.accountBundles.keys.toList() final bundles = matrix.accountBundles.keys.toList()
..sort( ..sort(

@ -35,7 +35,9 @@ extension DateTimeExtension on DateTime {
/// Returns a simple time String. /// Returns a simple time String.
String localizedTimeOfDay(BuildContext context) => String localizedTimeOfDay(BuildContext context) =>
DateFormat.Hm(L10n.of(context)!.localeName).format(this); L10n.of(context)!.alwaysUse24HourFormat == 'true'
? DateFormat('HH:mm', L10n.of(context)!.localeName).format(this)
: DateFormat('h:mm a', L10n.of(context)!.localeName).format(this);
/// Returns [localizedTimeOfDay()] if the ChatTime is today, the name of the week /// Returns [localizedTimeOfDay()] if the ChatTime is today, the name of the week
/// day if the ChatTime is this week and a date string else. /// day if the ChatTime is this week and a date string else.

@ -82,7 +82,7 @@ class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
} }
static Future<String> findDatabasePath(Client client) async { static Future<String> findDatabasePath(Client client) async {
String path = client.clientName; var path = client.clientName;
if (!kIsWeb) { if (!kIsWeb) {
Directory directory; Directory directory;
try { try {

Loading…
Cancel
Save