diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 2eb411a23..68c90c59e 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -158,4 +158,10 @@
android:name="flutterEmbedding"
android:value="2" />
+
+
+
+
+
+
diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb
index 282acab40..ffdcadc2d 100644
--- a/assets/l10n/intl_en.arb
+++ b/assets/l10n/intl_en.arb
@@ -2812,7 +2812,7 @@
"type": "text",
"placeholders": {}
},
- "unableToFindClass": "We are unable to find the space. Please double-check the information with the space administrator. If you are still experiencing an issue, please contact support@pangea.chat.",
+ "unableToFindClass": "There's no space with that code. Please try again.",
"@unableToFindClass": {
"type": "text",
"placeholders": {}
@@ -3904,7 +3904,6 @@
"listen": "Listen",
"addConversationBot": "Enable Conversation Bot",
"addConversationBotDesc": "Add a bot to this chat",
- "convoBotSettingsTitle": "Conversation Bot Settings",
"convoBotSettingsDescription": "Edit conversation topic and difficulty",
"enterAConversationTopic": "Enter a conversation topic",
"conversationTopic": "Conversation topic",
@@ -4009,7 +4008,7 @@
"accuracy": "Accuracy",
"points": "Points",
"noPaymentInfo": "No payment info necessary!",
- "conversationBotModeSelectDescription": "Bot mode",
+ "conversationBotModeSelectDescription": "Chat Activity",
"conversationBotModeSelectOption_discussion": "Discussion",
"conversationBotModeSelectOption_custom": "Custom",
"conversationBotModeSelectOption_conversation": "Conversation",
@@ -4030,7 +4029,7 @@
"conversationBotCustomZone_customSystemPromptPlaceholder": "Set custom system prompt",
"conversationBotCustomZone_customSystemPromptEmptyError": "Missing custom system prompt",
"conversationBotCustomZone_customTriggerReactionEnabledLabel": "Responds on ⏩ reaction",
- "botConfig": "Conversation Bot Settings",
+ "botConfig": "Chat Settings",
"addConversationBotDialogTitleInvite": "Confirm inviting conversation bot",
"addConversationBotButtonInvite": "Invite",
"addConversationBotDialogInviteConfirmation": "Invite",
@@ -4038,7 +4037,7 @@
"addConversationBotButtonRemove": "Remove",
"addConversationBotDialogRemoveConfirmation": "Remove",
"conversationBotConfigConfirmChange": "Confirm",
- "conversationBotStatus": "Bot Status",
+ "conversationBotStatus": "Invite bot",
"conversationBotTextAdventureZone_title": "Text Adventure",
"conversationBotTextAdventureZone_instructionLabel": "Game Master Instructions",
"conversationBotTextAdventureZone_instructionPlaceholder": "Set game master instructions",
@@ -4086,6 +4085,7 @@
}
},
"roomCapacityExplanation": "{roomType} capacity limits the number of non-admins allowed in a room.",
+ "tooManyRequest": "Too many request, please try again later.",
"@roomCapacityExplanation": {
"type": "text",
"placeholders": {
@@ -4114,14 +4114,14 @@
"placeholders": {}
},
"addChatToSpaceDesc": "Adding a chat to a space will make the chat appear within the space for students and give them access.",
- "addSpaceToSpaceDesc": "Adding a sub space to space will make the sub space appear in the main space's chat list.",
+ "addSpaceToSpaceDesc": "Adding a sub space to space will make the sub space appear in the main space''s chat list.",
"spaceAnalytics": "Space Analytics",
"changeAnalyticsLanguage": "Change Analytics Language",
"suggestToSpace": "Suggest this space",
- "suggestToSpaceDesc": "Suggested sub spaces will appear in their main space's chat list",
+ "suggestToSpaceDesc": "Suggested sub spaces will appear in their main space''s chat list",
"practice": "Practice",
"noLanguagesSet": "No languages set",
- "noActivitiesFound": "That's enough on this for now! Come back later for more.",
+ "noActivitiesFound": "That''s enough on this for now! Come back later for more.",
"hintTitle": "Hint:",
"speechToTextBody": "See how well you did by looking at your Accuracy and Words Per Minute scores",
"previous": "Previous",
@@ -4225,17 +4225,144 @@
"discoverHomeservers": "Discover homeservers",
"whatIsAHomeserver": "What is a homeserver?",
"homeserverDescription": "All your data is stored on the homeserver, just like an email provider. You can choose which homeserver you want to use, while you can still communicate with everyone. Learn more at at https://matrix.org.",
- "doesNotSeemToBeAValidHomeserver": "Doesn't seem to be a compatible homeserver. Wrong URL?",
+ "doesNotSeemToBeAValidHomeserver": "Doesn''t seem to be a compatible homeserver. Wrong URL?",
"grammar": "Grammar",
"contactHasBeenInvitedToTheChat": "Contact has been invited to the chat",
"inviteChat": "📨 Invite chat",
"chatName": "Chat name",
"reportContentIssueTitle": "Report content issue",
"feedback": "Optional feedback",
- "reportContentIssueDescription": "Uh oh! AI can faciliate personalized learning experiences but... also hallucinates. Please provide any feedback you have and we'll try again.",
+ "reportContentIssueDescription": "Uh oh! AI can faciliate personalized learning experiences but... also hallucinates. Please provide any feedback you have and we''ll try again.",
"clickTheWordAgainToDeselect": "Click the selected word to deselect it.",
"l2SupportNa": "Not Available",
"l2SupportAlpha": "Alpha",
"l2SupportBeta": "Beta",
- "l2SupportFull": "Full"
+ "l2SupportFull": "Full",
+ "voiceNotAvailable": "It looks like you don't have a voice installed for this language.",
+ "openVoiceSettings": "Click here to open voice settings",
+ "playAudio": "Play",
+ "stop": "Stop",
+ "grammarCopySCONJ": "Subordinating Conjunction",
+ "grammarCopyNUM": "Number",
+ "grammarCopyVERB": "Verb",
+ "grammarCopyAFFIX": "Affix",
+ "grammarCopyPARTpos": "Particle",
+ "grammarCopyADJ": "Adjective",
+ "grammarCopyCCONJ": "Coordinating Conjunction",
+ "grammarCopyPUNCT": "Punctuation",
+ "grammarCopyADV": "Adverb",
+ "grammarCopyAUX": "Auxiliary",
+ "grammarCopySPACE": "Space",
+ "grammarCopySYM": "Symbol",
+ "grammarCopyDET": "Determiner",
+ "grammarCopyPRON": "Pronoun",
+ "grammarCopyADP": "Adposition",
+ "grammarCopyPROPN": "Proper Noun",
+ "grammarCopyNOUN": "Noun",
+ "grammarCopyINTJ": "Interjection",
+ "grammarCopyX": "Other",
+ "grammarCopyFem": "Feminine",
+ "grammarCopy2": "Second Person",
+ "grammarCopyImp": "Imperative",
+ "grammarCopyQest": "Question",
+ "grammarCopyPerf": "Perfect",
+ "grammarCopyAccNom": "Accusative, Nominative",
+ "grammarCopyObl": "Oblique Case",
+ "grammarCopyAct": "Active",
+ "grammarCopyBrck": "Bracket",
+ "grammarCopyArt": "Article",
+ "grammarCopySing": "Singular",
+ "grammarCopyMasc": "Masculine",
+ "grammarCopyMod": "Modal",
+ "grammarCopyAdverbial": "Adverbial",
+ "grammarCopyPeri": "Periphrastic",
+ "grammarCopyDigit": "Digit",
+ "grammarCopyNot_proper": "Not Proper",
+ "grammarCopyCard": "Cardinal",
+ "grammarCopyProp": "Proper",
+ "grammarCopyDash": "Dash",
+ "grammarCopyYes": "Yes",
+ "grammarCopySemi": "Semicolon",
+ "grammarCopyComm": "Comma",
+ "grammarCopyCnd": "Conditional",
+ "grammarCopyIntRel": "Interrogative, Relative",
+ "grammarCopyAcc": "Accusative",
+ "grammarCopyPartTag": "Partitive",
+ "grammarCopyInt": "Interrogative",
+ "grammarCopyPast": "Past",
+ "grammarCopySup": "Superlative",
+ "grammarCopyColo": "Colon",
+ "grammarCopy3": "Third Person",
+ "grammarCopyPlur": "Plural",
+ "grammarCopyNpr": "Proper Noun",
+ "grammarCopyInterrogative": "Interrogative",
+ "grammarCopyInfm": "Informal",
+ "grammarCopyTim": "Time",
+ "grammarCopyNeg": "Negative",
+ "grammarCopyTot": "Total",
+ "grammarCopyAdnomial": "Adnominal",
+ "grammarCopyProg": "Progressive",
+ "grammarCopySub": "Subjunctive",
+ "grammarCopyComplementive": "Complementive",
+ "grammarCopyNom": "Nominative",
+ "grammarCopyFut": "Future",
+ "grammarCopyDat": "Dative",
+ "grammarCopyPres": "Present",
+ "grammarCopyNeut": "Neuter",
+ "grammarCopyRel": "Relative",
+ "grammarCopyFinal_ending": "Final Ending",
+ "grammarCopyDem": "Demonstrative",
+ "grammarCopyPre": "Preposition",
+ "grammarCopyFin": "Finite",
+ "grammarCopyPos": "Positive",
+ "grammarCopyQuot": "Quotation",
+ "grammarCopyGer": "Gerund",
+ "grammarCopyPass": "Passive",
+ "grammarCopyGen": "Genitive",
+ "grammarCopyPrs": "Present",
+ "grammarCopyDef": "Definite",
+ "grammarCopyOrd": "Ordinal",
+ "grammarCopyIns": "Instrumental",
+ "grammarCopyAccDat": "Accusative, Dative",
+ "grammarCopyInf": "Infinitive",
+ "grammarCopyLong": "Long",
+ "grammarCopyInd": "Indicative",
+ "grammarCopyCmp": "Comparative",
+ "grammarCopyRelative_case": "Relative Case",
+ "grammarCopyExcl": "Exclamative",
+ "grammarCopy1": "First Person",
+ "grammarCopyIni": "Initial",
+ "grammarCopyPerson": "Person",
+ "grammarCopyForeign": "Foreign",
+ "grammarCopyVoice": "Voice",
+ "grammarCopyVerbType": "Verb Type",
+ "grammarCopyPoss": "Possessive",
+ "grammarCopyPrepCase": "Prepositional Case",
+ "grammarCopyNumType": "Numeral Type",
+ "grammarCopyNounType": "Noun Type",
+ "grammarCopyReflex": "Reflexive",
+ "grammarCopyPronType": "Pronoun Type",
+ "grammarCopyPunctSide": "Punctuation Side",
+ "grammarCopyVerbForm": "Verb Form",
+ "grammarCopyGender": "Gender",
+ "grammarCopyMood": "Mood",
+ "grammarCopyAspect": "Aspect",
+ "grammarCopyPunctType": "Punctuation Type",
+ "grammarCopyTense": "Tense",
+ "grammarCopyDegree": "Degree",
+ "grammarCopyPolite": "Politeness",
+ "grammarCopyAdvType": "Adverb Type",
+ "grammarCopyNumber": "Number",
+ "grammarCopyConjType": "Conjunction Type",
+ "grammarCopyPolarity": "Polarity",
+ "grammarCopyNumberPsor": "Possessor''s Number",
+ "grammarCopyCase": "Case",
+ "grammarCopyDefinite": "Definiteness",
+ "grammarCopyNumForm": "Numeral Form",
+ "grammarCopyUnknown": "Unknown",
+ "enterPrompt": "Please enter a system prompt",
+ "selectBotLanguage": "Select bot language",
+ "chooseVoice": "Choose a voice",
+ "enterLanguageLevel": "Please enter a language level",
+ "enterDiscussionTopic": "Please enter a discussion topic"
}
\ No newline at end of file
diff --git a/assets/l10n/intl_es.arb b/assets/l10n/intl_es.arb
index 49421500b..dd8312d8f 100644
--- a/assets/l10n/intl_es.arb
+++ b/assets/l10n/intl_es.arb
@@ -4244,7 +4244,7 @@
"joinWithClassCode": "Únete a una clase o a un intercambio",
"joinWithClassCodeDesc": "Conéctese a una clase o espacio de intercambio con el código de invitación de 6 dígitos proporcionado por el administrador del espacio.",
"joinWithClassCodeHint": "Introduzca el código de invitación",
- "unableToFindClass": "No podemos encontrar la clase o el intercambio. Por favor, vuelva a comprobar la información con el administrador del espacio. Si sigue teniendo problemas, póngase en contacto con support@pangea.chat.",
+ "unableToFindClass": "No hay espacio con ese código. Por favor inténtalo de nuevo.",
"welcomeToYourNewClass": "Bienvenido 🙂",
"welcomeToClass": "Bienvenido! 🙂\n- ¡Prueba a unirte a un chat!\n- ¡Diviértete chateando!",
"unableToFindClassCode": "No se puede encontrar el código.",
diff --git a/lib/config/routes.dart b/lib/config/routes.dart
index 0ee135e7d..515b25fd9 100644
--- a/lib/config/routes.dart
+++ b/lib/config/routes.dart
@@ -233,11 +233,7 @@ abstract class AppRoutes {
pageBuilder: (context, state) => defaultPageBuilder(
context,
state,
- NewGroup(
- // #Pangea
- spaceId: state.uri.queryParameters['spaceId'],
- // Pangea#
- ),
+ const NewGroup(),
),
redirect: loggedOutRedirect,
// #Pangea
diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart
index a51a86b37..d5cb30747 100644
--- a/lib/pages/chat/chat.dart
+++ b/lib/pages/chat/chat.dart
@@ -560,6 +560,7 @@ class ChatController extends State
//#Pangea
choreographer.stateListener.close();
choreographer.dispose();
+ clearSelectedEvents();
MatrixState.pAnyState.closeOverlay();
//Pangea#
super.dispose();
@@ -1334,13 +1335,18 @@ class ChatController extends State
}
// Pangea#
- void clearSelectedEvents() => setState(() {
- // #Pangea
- closeSelectionOverlay();
- // Pangea#
- selectedEvents.clear();
- showEmojiPicker = false;
- });
+ void clearSelectedEvents() {
+ // #Pangea
+ if (!mounted) return;
+ // Pangea#
+ setState(() {
+ // #Pangea
+ closeSelectionOverlay();
+ // Pangea#
+ selectedEvents.clear();
+ showEmojiPicker = false;
+ });
+ }
void clearSingleSelectedEvent() {
if (selectedEvents.length <= 1) {
diff --git a/lib/pages/chat/events/audio_player.dart b/lib/pages/chat/events/audio_player.dart
index 3213d085f..41e0dc388 100644
--- a/lib/pages/chat/events/audio_player.dart
+++ b/lib/pages/chat/events/audio_player.dart
@@ -25,7 +25,13 @@ class AudioPlayerWidget extends StatefulWidget {
static String? currentId;
- static const int wavesCount = 40;
+ // #Pangea
+ // static const int wavesCount = 40;
+ static const int wavesCount = kIsWeb ? 100 : 40;
+
+ final int? sectionStartMS;
+ final int? sectionEndMS;
+ // Pangea#
const AudioPlayerWidget(
this.event, {
@@ -33,6 +39,8 @@ class AudioPlayerWidget extends StatefulWidget {
// #Pangea
this.matrixFile,
this.autoplay = false,
+ this.sectionStartMS,
+ this.sectionEndMS,
// Pangea#
super.key,
});
@@ -72,6 +80,24 @@ class AudioPlayerState extends State {
super.dispose();
}
+ // #Pangea
+ // @override
+ // void didUpdateWidget(covariant oldWidget) {
+ // if ((oldWidget.sectionEndMS != widget.sectionEndMS) ||
+ // (oldWidget.sectionStartMS != widget.sectionStartMS)) {
+ // debugPrint('selection changed');
+ // if (widget.sectionStartMS != null) {
+ // audioPlayer?.seek(Duration(milliseconds: widget.sectionStartMS!));
+ // audioPlayer?.play();
+ // } else {
+ // audioPlayer?.stop();
+ // audioPlayer?.seek(null);
+ // }
+ // }
+ // super.didUpdateWidget(oldWidget);
+ // }
+ // Pangea#
+
Future _downloadAction() async {
// #Pangea
// if (status != AudioPlayerStatus.notDownloaded) return;
@@ -160,7 +186,16 @@ class AudioPlayerState extends State {
AudioPlayerWidget.wavesCount)
.round();
});
+ // #Pangea
+ // if (widget.sectionStartMS != null &&
+ // widget.sectionEndMS != null &&
+ // state.inMilliseconds.toDouble() >= widget.sectionEndMS!) {
+ // audioPlayer.stop();
+ // audioPlayer.seek(Duration(milliseconds: widget.sectionStartMS!));
+ // } else
if (state.inMilliseconds.toDouble() == maxPosition) {
+ // if (state.inMilliseconds.toDouble() == maxPosition) {
+ // Pangea#
audioPlayer.stop();
audioPlayer.seek(null);
}
@@ -194,6 +229,11 @@ class AudioPlayerState extends State {
}
// Pangea#
}
+ // #Pangea
+ // if (widget.sectionStartMS != null) {
+ // audioPlayer.seek(Duration(milliseconds: widget.sectionStartMS!));
+ // }
+ // Pangea#
audioPlayer.play().onError(
ErrorReporter(context, 'Unable to play audio message')
.onErrorCallback,
@@ -311,6 +351,17 @@ class AudioPlayerState extends State {
final statusText = this.statusText ??= _durationString ?? '00:00';
final audioPlayer = this.audioPlayer;
+
+ // #Pangea
+ final msPerWave = (maxPosition / AudioPlayerWidget.wavesCount);
+ final int? startWave = widget.sectionStartMS != null && msPerWave > 0
+ ? (widget.sectionStartMS! / msPerWave).floor()
+ : null;
+ final int? endWave = widget.sectionEndMS != null && msPerWave > 0
+ ? (widget.sectionEndMS! / msPerWave).ceil()
+ : null;
+ // Pangea#
+
return Padding(
// #Pangea
// padding: const EdgeInsets.all(12.0),
@@ -352,44 +403,98 @@ class AudioPlayerState extends State {
// #Pangea
// const SizedBox(width: 8),
const SizedBox(width: 5),
- // Pangea#
+ // Row(
+ // mainAxisSize: MainAxisSize.min,
+ // children: [
+ // for (var i = 0; i < AudioPlayerWidget.wavesCount; i++)
+ // GestureDetector(
+ // onTapDown: (_) => audioPlayer?.seek(
+ // Duration(
+ // milliseconds:
+ // (maxPosition / AudioPlayerWidget.wavesCount).round() *
+ // i,
+ // ),
+ // ),
+ // child: Container(
+ // height: 32,
+ // color: widget.color.withAlpha(0),
+ // alignment: Alignment.center,
+ // child: Opacity(
+ // opacity: currentPosition > i ? 1 : 0.5,
+ // child: Container(
+ // margin: const EdgeInsets.symmetric(horizontal: 1),
+ // decoration: BoxDecoration(
+ // color: widget.color,
+ // borderRadius: BorderRadius.circular(2),
+ // ),
+ // // #Pangea
+ // // width: 2,
+ // width: 1,
+ // // Pangea#
+ // height: 32 * (waveform[i] / 1024),
+ // ),
+ // ),
+ // ),
+ // ),
+ // ],
+ // ),
+ // const SizedBox(width: 8),
Row(
- mainAxisSize: MainAxisSize.min,
children: [
for (var i = 0; i < AudioPlayerWidget.wavesCount; i++)
- GestureDetector(
- onTapDown: (_) => audioPlayer?.seek(
- Duration(
- milliseconds:
- (maxPosition / AudioPlayerWidget.wavesCount).round() *
- i,
- ),
- ),
- child: Container(
- height: 32,
- color: widget.color.withAlpha(0),
- alignment: Alignment.center,
- child: Opacity(
- opacity: currentPosition > i ? 1 : 0.5,
- child: Container(
- margin: const EdgeInsets.symmetric(horizontal: 1),
- decoration: BoxDecoration(
- color: widget.color,
- borderRadius: BorderRadius.circular(2),
- ),
- // #Pangea
- // width: 2,
- width: 1,
- // Pangea#
- height: 32 * (waveform[i] / 1024),
+ Builder(
+ builder: (context) {
+ final double barOpacity = currentPosition > i ? 1 : 0.5;
+ return GestureDetector(
+ onTapDown: (_) {
+ audioPlayer?.seek(
+ Duration(
+ milliseconds:
+ (maxPosition / AudioPlayerWidget.wavesCount)
+ .round() *
+ i,
+ ),
+ );
+ },
+ child: Stack(
+ children: [
+ Container(
+ margin: const EdgeInsets.symmetric(
+ horizontal: 0.5,
+ ),
+ decoration: BoxDecoration(
+ color: widget.color.withOpacity(barOpacity),
+ borderRadius: BorderRadius.circular(2),
+ ),
+ height: 32 * (waveform[i] / 1024),
+ width: 1.5,
+ ),
+ ],
),
- ),
- ),
+ );
+ // return Container(
+ // height: 32,
+ // width: 2,
+ // alignment: Alignment.center,
+ // child: Opacity(
+ // opacity: barOpacity,
+ // child: Container(
+ // margin: const EdgeInsets.symmetric(
+ // horizontal: 1,
+ // ),
+ // decoration: BoxDecoration(
+ // color: widget.color,
+ // borderRadius: BorderRadius.circular(2),
+ // ),
+ // height: 32 * (waveform[i] / 1024),
+ // width: 2,
+ // ),
+ // ),
+ // );
+ },
),
],
),
- // #Pangea
- // const SizedBox(width: 8),
const SizedBox(width: 5),
// SizedBox(
// width: 36,
diff --git a/lib/pages/chat_details/chat_details.dart b/lib/pages/chat_details/chat_details.dart
index 050a1b272..a94430da1 100644
--- a/lib/pages/chat_details/chat_details.dart
+++ b/lib/pages/chat_details/chat_details.dart
@@ -5,7 +5,6 @@ import 'package:fluffychat/pages/chat_details/chat_details_view.dart';
import 'package:fluffychat/pages/settings/settings.dart';
import 'package:fluffychat/pangea/pages/class_settings/p_class_widgets/class_description_button.dart';
import 'package:fluffychat/pangea/utils/set_class_name.dart';
-import 'package:fluffychat/pangea/widgets/class/add_space_toggles.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/widgets/app_lock.dart';
import 'package:fluffychat/widgets/matrix.dart';
@@ -41,9 +40,7 @@ class ChatDetailsController extends State {
String? get roomId => widget.roomId;
// #Pangea
- final GlobalKey addToSpaceKey = GlobalKey();
- final GlobalKey
- addConversationBotKey =
+ final GlobalKey addConversationBotKey =
GlobalKey();
bool displayAddStudentOptions = false;
diff --git a/lib/pages/chat_details/chat_details_view.dart b/lib/pages/chat_details/chat_details_view.dart
index 5c5d1b840..90f2a8927 100644
--- a/lib/pages/chat_details/chat_details_view.dart
+++ b/lib/pages/chat_details/chat_details_view.dart
@@ -10,7 +10,6 @@ import 'package:fluffychat/pangea/pages/class_settings/p_class_widgets/class_inv
import 'package:fluffychat/pangea/pages/class_settings/p_class_widgets/class_name_button.dart';
import 'package:fluffychat/pangea/pages/class_settings/p_class_widgets/room_capacity_button.dart';
import 'package:fluffychat/pangea/utils/lock_room.dart';
-import 'package:fluffychat/pangea/widgets/class/add_space_toggles.dart';
import 'package:fluffychat/pangea/widgets/conversation_bot/conversation_bot_settings.dart';
import 'package:fluffychat/utils/fluffy_share.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
@@ -395,71 +394,6 @@ class ChatDetailsView extends StatelessWidget {
room: room,
),
const Divider(height: 1),
- if (!room.isDirectChat && room.isRoomAdmin)
- AddToSpaceToggles(
- roomId: room.id,
- key: controller.addToSpaceKey,
- startOpen: false,
- ),
- const Divider(height: 1),
- if (!room.isDirectChat)
- if (room.isRoomAdmin)
- ListTile(
- title: Text(
- room.isSpace
- ? L10n.of(context)!.archiveSpace
- : L10n.of(context)!.archive,
- style: TextStyle(
- color:
- Theme.of(context).colorScheme.secondary,
- fontWeight: FontWeight.bold,
- ),
- ),
- leading: CircleAvatar(
- backgroundColor:
- Theme.of(context).scaffoldBackgroundColor,
- foregroundColor: iconColor,
- child: const Icon(
- Icons.archive_outlined,
- ),
- ),
- onTap: () async {
- var confirmed = OkCancelResult.ok;
- var shouldGo = false;
- // archiveSpace has its own popup; only show if not space
- if (!room.isSpace) {
- confirmed = await showOkCancelAlertDialog(
- useRootNavigator: false,
- context: context,
- title: L10n.of(context)!.areYouSure,
- okLabel: L10n.of(context)!.ok,
- cancelLabel: L10n.of(context)!.cancel,
- message: L10n.of(context)!
- .archiveRoomDescription,
- );
- }
- if (confirmed == OkCancelResult.ok) {
- if (room.isSpace) {
- shouldGo = await room.archiveSpace(
- context,
- Matrix.of(context).client,
- );
- } else {
- final success =
- await showFutureLoadingDialog(
- context: context,
- future: () async {
- await room.archive();
- },
- );
- shouldGo = (success.error == null);
- }
- if (shouldGo) {
- context.go('/rooms');
- }
- }
- },
- ),
ListTile(
title: Text(
L10n.of(context)!.leave,
diff --git a/lib/pages/chat_list/chat_list_header.dart b/lib/pages/chat_list/chat_list_header.dart
index 4c018355c..1f7a1fbe9 100644
--- a/lib/pages/chat_list/chat_list_header.dart
+++ b/lib/pages/chat_list/chat_list_header.dart
@@ -23,7 +23,10 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
return SliverAppBar(
floating: true,
- toolbarHeight: 175,
+ // #Pangea
+ // toolbarHeight: 72,
+ toolbarHeight: controller.isSearchMode ? 72 : 175,
+ // Pangea#
pinned:
FluffyThemes.isColumnMode(context) || selectMode != SelectMode.normal,
scrolledUnderElevation: selectMode == SelectMode.normal ? 0 : null,
@@ -32,111 +35,124 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
// selectMode == SelectMode.normal ? Colors.transparent : null,
// Pangea#
automaticallyImplyLeading: false,
- leading: selectMode == SelectMode.normal
- ? null
- : IconButton(
- tooltip: L10n.of(context)!.cancel,
- icon: const Icon(Icons.close_outlined),
- onPressed: controller.cancelAction,
- color: theme.colorScheme.primary,
- ),
- title: selectMode == SelectMode.share
- ? Text(
- L10n.of(context)!.share,
- key: const ValueKey(SelectMode.share),
- )
- // #Pangea
- : Column(
- children: [
- ClientChooserButton(controller),
- const LearningProgressIndicators(),
- ],
- ),
- // : TextField(
- // controller: controller.searchController,
- // focusNode: controller.searchFocusNode,
- // textInputAction: TextInputAction.search,
- // onChanged: (text) => controller.onSearchEnter(
- // text,
- // globalSearch: globalSearch,
- // ),
- // decoration: InputDecoration(
- // filled: true,
- // fillColor: theme.colorScheme.secondaryContainer,
- // border: OutlineInputBorder(
- // borderSide: BorderSide.none,
- // borderRadius: BorderRadius.circular(99),
+ // #Pangea
+ // leading: selectMode == SelectMode.normal
+ // ? null
+ // : IconButton(
+ // tooltip: L10n.of(context)!.cancel,
+ // icon: const Icon(Icons.close_outlined),
+ // onPressed: controller.cancelAction,
+ // color: theme.colorScheme.primary,
// ),
- // contentPadding: EdgeInsets.zero,
- // hintText: L10n.of(context)!.searchChatsRooms,
- // hintStyle: TextStyle(
- // color: theme.colorScheme.onPrimaryContainer,
- // fontWeight: FontWeight.normal,
- // ),
- // floatingLabelBehavior: FloatingLabelBehavior.never,
- // prefixIcon: controller.isSearchMode
- // ? IconButton(
- // tooltip: L10n.of(context)!.cancel,
- // icon: const Icon(Icons.close_outlined),
- // onPressed: controller.cancelSearch,
- // color: theme.colorScheme.onPrimaryContainer,
- // )
- // : IconButton(
- // onPressed: controller.startSearch,
- // icon: Icon(
- // Icons.search_outlined,
- // color: theme.colorScheme.onPrimaryContainer,
- // ),
- // ),
- // suffixIcon: controller.isSearchMode && globalSearch
- // ? controller.isSearching
- // ? const Padding(
- // padding: EdgeInsets.symmetric(
- // vertical: 10.0,
- // horizontal: 12,
- // ),
- // child: SizedBox.square(
- // dimension: 24,
- // child: CircularProgressIndicator.adaptive(
- // strokeWidth: 2,
- // ),
- // ),
- // )
- // : TextButton.icon(
- // onPressed: controller.setServer,
- // style: TextButton.styleFrom(
- // shape: RoundedRectangleBorder(
- // borderRadius: BorderRadius.circular(99),
- // ),
- // textStyle: const TextStyle(fontSize: 12),
- // ),
- // icon: const Icon(Icons.edit_outlined, size: 16),
- // label: Text(
- // controller.searchServer ??
- // Matrix.of(context).client.homeserver!.host,
- // maxLines: 2,
- // ),
- // )
- // : SizedBox(
- // width: 0,
- // child: ClientChooserButton(controller),
- // ),
- // ),
- // ),
// Pangea#
- actions: selectMode == SelectMode.share
- ? [
- // #Pangea
- // Padding(
- // padding: const EdgeInsets.symmetric(
- // horizontal: 16.0,
- // vertical: 8.0,
- // ),
- // child: ClientChooserButton(controller),
- // ),
- // Pangea#
- ]
- : null,
+ title:
+ // #Pangea
+ // selectMode == SelectMode.share
+ // ? Text(
+ // L10n.of(context)!.share,
+ // key: const ValueKey(SelectMode.share),
+ // )
+ // :
+ // Pangea#
+ Column(
+ children: [
+ TextField(
+ controller: controller.searchController,
+ focusNode: controller.searchFocusNode,
+ textInputAction: TextInputAction.search,
+ onChanged: (text) => controller.onSearchEnter(
+ text,
+ globalSearch: globalSearch,
+ ),
+ decoration: InputDecoration(
+ filled: true,
+ fillColor: theme.colorScheme.secondaryContainer,
+ border: OutlineInputBorder(
+ borderSide: BorderSide.none,
+ borderRadius: BorderRadius.circular(99),
+ ),
+ contentPadding: EdgeInsets.zero,
+ hintText: L10n.of(context)!.searchChatsRooms,
+ hintStyle: TextStyle(
+ color: theme.colorScheme.onPrimaryContainer,
+ fontWeight: FontWeight.normal,
+ ),
+ floatingLabelBehavior: FloatingLabelBehavior.never,
+ prefixIcon: controller.isSearchMode
+ ? IconButton(
+ tooltip: L10n.of(context)!.cancel,
+ icon: const Icon(Icons.close_outlined),
+ onPressed: controller.cancelSearch,
+ color: theme.colorScheme.onPrimaryContainer,
+ )
+ : IconButton(
+ onPressed: controller.startSearch,
+ icon: Icon(
+ Icons.search_outlined,
+ color: theme.colorScheme.onPrimaryContainer,
+ ),
+ ),
+ suffixIcon: controller.isSearchMode && globalSearch
+ ? controller.isSearching
+ ? const Padding(
+ padding: EdgeInsets.symmetric(
+ vertical: 10.0,
+ horizontal: 12,
+ ),
+ child: SizedBox.square(
+ dimension: 24,
+ child: CircularProgressIndicator.adaptive(
+ strokeWidth: 2,
+ ),
+ ),
+ )
+ // #Pangea
+ : SizedBox(
+ width: 0,
+ child: ClientChooserButton(controller),
+ )
+ // : TextButton.icon(
+ // onPressed: controller.setServer,
+ // style: TextButton.styleFrom(
+ // shape: RoundedRectangleBorder(
+ // borderRadius: BorderRadius.circular(99),
+ // ),
+ // textStyle: const TextStyle(fontSize: 12),
+ // ),
+ // icon: const Icon(Icons.edit_outlined, size: 16),
+ // label: Text(
+ // controller.searchServer ??
+ // Matrix.of(context).client.homeserver!.host,
+ // maxLines: 2,
+ // ),
+ // )
+ // Pangea#
+ : SizedBox(
+ width: 0,
+ child: ClientChooserButton(controller),
+ ),
+ ),
+ ),
+ if (!controller.isSearchMode)
+ const Padding(
+ padding: EdgeInsets.only(top: 16.0),
+ child: LearningProgressIndicators(),
+ ),
+ ],
+ ),
+ // #Pangea
+ // actions: selectMode == SelectMode.share
+ // ? [
+ // Padding(
+ // padding: const EdgeInsets.symmetric(
+ // horizontal: 16.0,
+ // vertical: 8.0,
+ // ),
+ // child: ClientChooserButton(controller),
+ // ),
+ // ]
+ // : null,
+ // Pangea#
);
}
diff --git a/lib/pages/chat_list/client_chooser_button.dart b/lib/pages/chat_list/client_chooser_button.dart
index 0a406fa2c..b22512bbe 100644
--- a/lib/pages/chat_list/client_chooser_button.dart
+++ b/lib/pages/chat_list/client_chooser_button.dart
@@ -1,15 +1,15 @@
import 'package:adaptive_dialog/adaptive_dialog.dart';
-import 'package:fluffychat/pangea/utils/find_conversation_partner_dialog.dart';
import 'package:fluffychat/pangea/utils/logout.dart';
import 'package:fluffychat/pangea/utils/space_code.dart';
+import 'package:fluffychat/widgets/avatar.dart';
import 'package:fluffychat/widgets/matrix.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:go_router/go_router.dart';
+// import 'package:keyboard_shortcuts/keyboard_shortcuts.dart';
import 'package:matrix/matrix.dart';
-import '../../utils/fluffy_share.dart';
import 'chat_list.dart';
class ClientChooserButton extends StatelessWidget {
@@ -41,45 +41,30 @@ class ClientChooserButton extends StatelessWidget {
],
),
),
- // PopupMenuItem(
- // enabled: matrix.client.rooms.any(
- // (room) =>
- // room.isSpace &&
- // room.ownPowerLevel >= ClassDefaultValues.powerLevelOfAdmin,
- // ),
- // value: SettingsAction.spaceAnalytics,
- // child: Row(
- // children: [
- // const Icon(Icons.analytics_outlined),
- // const SizedBox(width: 18),
- // Expanded(child: Text(L10n.of(context)!.spaceAnalytics)),
- // ],
- // ),
- // ),
- // PopupMenuItem(
- // enabled: matrix.client.rooms.any(
- // (room) => !room.isSpace && !room.isArchived && !room.isAnalyticsRoom,
- // ),
- // value: SettingsAction.myAnalytics,
- // child: Row(
- // children: [
- // const Icon(Icons.analytics_outlined),
- // const SizedBox(width: 18),
- // Expanded(child: Text(L10n.of(context)!.myLearning)),
- // ],
- // ),
- // ),
- // PopupMenuItem(
- // value: SettingsAction.newGroup,
- // child: Row(
- // children: [
- // const Icon(Icons.group_add_outlined),
- // const SizedBox(width: 18),
- // Text(L10n.of(context)!.createGroup),
- // ],
- // ),
- // ),
+ PopupMenuItem(
+ value: SettingsAction.learning,
+ child: Row(
+ children: [
+ const Icon(Icons.psychology_outlined),
+ const SizedBox(width: 18),
+ Expanded(child: Text(L10n.of(context)!.learningSettings)),
+ ],
+ ),
+ ),
// Pangea#
+ PopupMenuItem(
+ value: SettingsAction.newGroup,
+ child: Row(
+ children: [
+ const Icon(Icons.group_add_outlined),
+ const SizedBox(width: 18),
+ // #Pangea
+ Expanded(child: Text(L10n.of(context)!.createGroup)),
+ // Text(L10n.of(context)!.createGroup),
+ // Pangea#
+ ],
+ ),
+ ),
PopupMenuItem(
value: SettingsAction.newSpace,
child: Row(
@@ -87,7 +72,7 @@ class ClientChooserButton extends StatelessWidget {
const Icon(Icons.workspaces_outlined),
const SizedBox(width: 18),
// #Pangea
- Expanded(child: Text(L10n.of(context)!.createNewSpace)),
+ Text(L10n.of(context)!.createNewSpace),
// Text(L10n.of(context)!.createNewSpace),
// Pangea#
],
@@ -123,22 +108,10 @@ class ClientChooserButton extends StatelessWidget {
children: [
const Icon(Icons.archive_outlined),
const SizedBox(width: 18),
- Text(L10n.of(context)!.archive),
+ Text(L10n.of(context)!!.archive),
],
),
),*/
- // #Pangea
- PopupMenuItem(
- value: SettingsAction.learning,
- child: Row(
- children: [
- const Icon(Icons.psychology_outlined),
- const SizedBox(width: 18),
- Expanded(child: Text(L10n.of(context)!.learningSettings)),
- ],
- ),
- ),
- // Pangea#
PopupMenuItem(
value: SettingsAction.settings,
child: Row(
@@ -146,13 +119,23 @@ class ClientChooserButton extends StatelessWidget {
const Icon(Icons.settings_outlined),
const SizedBox(width: 18),
// #Pangea
+ Text(L10n.of(context)!.settings),
// Text(L10n.of(context)!.settings),
- Expanded(child: Text(L10n.of(context)!.settings)),
// Pangea#
],
),
),
// #Pangea
+ PopupMenuItem(
+ value: SettingsAction.logout,
+ child: Row(
+ children: [
+ const Icon(Icons.logout_outlined),
+ const SizedBox(width: 18),
+ Expanded(child: Text(L10n.of(context)!.logout)),
+ ],
+ ),
+ ),
// const PopupMenuDivider(),
// for (final bundle in bundles) ...[
// if (matrix.accountBundles[bundle]!.length != 1 ||
@@ -223,16 +206,6 @@ class ClientChooserButton extends StatelessWidget {
// ],
// ),
// ),
- PopupMenuItem(
- value: SettingsAction.logout,
- child: Row(
- children: [
- const Icon(Icons.logout_outlined),
- const SizedBox(width: 18),
- Expanded(child: Text(L10n.of(context)!.logout)),
- ],
- ),
- ),
// Pangea#
];
}
@@ -281,32 +254,18 @@ class ClientChooserButton extends StatelessWidget {
// onKeysPressed: () => _previousAccount(matrix, context),
// child: const SizedBox.shrink(),
// ),
- ClipRRect(
- borderRadius: BorderRadius.circular(16),
+ // Pangea#
+ PopupMenuButton