diff --git a/lib/pangea/choreographer/controllers/choreographer.dart b/lib/pangea/choreographer/controllers/choreographer.dart index 6f65ea836..edb364f80 100644 --- a/lib/pangea/choreographer/controllers/choreographer.dart +++ b/lib/pangea/choreographer/controllers/choreographer.dart @@ -536,9 +536,9 @@ class Choreographer { chatController.room, ); - bool get itAutoPlayEnabled { - return pangeaController.userController.profile.userSettings.itAutoPlay; - } + // bool get itAutoPlayEnabled { + // return pangeaController.userController.profile.userSettings.itAutoPlay; + // } bool get definitionsEnabled => pangeaController.permissionsController.isToolEnabled( diff --git a/lib/pangea/choreographer/controllers/igc_controller.dart b/lib/pangea/choreographer/controllers/igc_controller.dart index ed770cca4..6d0e848aa 100644 --- a/lib/pangea/choreographer/controllers/igc_controller.dart +++ b/lib/pangea/choreographer/controllers/igc_controller.dart @@ -99,7 +99,7 @@ class IgcController { final PangeaMatch match = igcTextData!.matches[firstMatchIndex]; if (match.isITStart && - choreographer.itAutoPlayEnabled && + // choreographer.itAutoPlayEnabled && igcTextData != null) { choreographer.onITStart(igcTextData!.matches[firstMatchIndex]); return; diff --git a/lib/pangea/constants/model_keys.dart b/lib/pangea/constants/model_keys.dart index 424c07830..253d73e55 100644 --- a/lib/pangea/constants/model_keys.dart +++ b/lib/pangea/constants/model_keys.dart @@ -24,7 +24,7 @@ class ModelKey { // making this a random string so that it's harder to guess static const String activatedTrialKey = '7C4EuKIsph'; static const String autoPlayMessages = 'autoPlayMessages'; - static const String itAutoPlay = 'itAutoPlay'; + static const String itAutoPlay = 'autoPlayIT'; static const String clientClassCity = "city"; static const String clientClassCountry = "country"; diff --git a/lib/pangea/enum/construct_use_type_enum.dart b/lib/pangea/enum/construct_use_type_enum.dart index 6ced270b7..196cf89b4 100644 --- a/lib/pangea/enum/construct_use_type_enum.dart +++ b/lib/pangea/enum/construct_use_type_enum.dart @@ -105,23 +105,23 @@ extension ConstructUseTypeExtension on ConstructUseTypeEnum { return 2; case ConstructUseTypeEnum.corIt: + return 1; + case ConstructUseTypeEnum.ignIt: case ConstructUseTypeEnum.ignIGC: case ConstructUseTypeEnum.ignPA: case ConstructUseTypeEnum.ignWL: - return 1; - case ConstructUseTypeEnum.unk: case ConstructUseTypeEnum.nan: return 0; case ConstructUseTypeEnum.incIt: case ConstructUseTypeEnum.incIGC: - return -1; + return -2; case ConstructUseTypeEnum.incPA: case ConstructUseTypeEnum.incWL: - return -2; + return -3; } } } diff --git a/lib/pangea/models/user_model.dart b/lib/pangea/models/user_model.dart index 7ef85fbd5..1fdebef3a 100644 --- a/lib/pangea/models/user_model.dart +++ b/lib/pangea/models/user_model.dart @@ -12,7 +12,7 @@ class UserSettings { DateTime? dateOfBirth; DateTime? createdAt; bool autoPlayMessages; - bool itAutoPlay; + // bool itAutoPlay; bool activatedFreeTrial; bool publicProfile; String? targetLanguage; @@ -23,7 +23,7 @@ class UserSettings { this.dateOfBirth, this.createdAt, this.autoPlayMessages = false, - this.itAutoPlay = false, + // this.itAutoPlay = true, this.activatedFreeTrial = false, this.publicProfile = false, this.targetLanguage, @@ -37,7 +37,7 @@ class UserSettings { ? DateTime.parse(json[ModelKey.userCreatedAt]) : null, autoPlayMessages: json[ModelKey.autoPlayMessages] ?? false, - itAutoPlay: json[ModelKey.itAutoPlay] ?? false, + // itAutoPlay: json[ModelKey.itAutoPlay] ?? true, activatedFreeTrial: json[ModelKey.activatedTrialKey] ?? false, publicProfile: json[ModelKey.publicProfile] ?? false, targetLanguage: json[ModelKey.l2LanguageKey], @@ -50,7 +50,7 @@ class UserSettings { data[ModelKey.userDateOfBirth] = dateOfBirth?.toIso8601String(); data[ModelKey.userCreatedAt] = createdAt?.toIso8601String(); data[ModelKey.autoPlayMessages] = autoPlayMessages; - data[ModelKey.itAutoPlay] = itAutoPlay; + // data[ModelKey.itAutoPlay] = itAutoPlay; data[ModelKey.activatedTrialKey] = activatedFreeTrial; data[ModelKey.publicProfile] = publicProfile; data[ModelKey.l2LanguageKey] = targetLanguage; @@ -96,9 +96,9 @@ class UserSettings { autoPlayMessages: (accountData[ModelKey.autoPlayMessages] ?.content[ModelKey.autoPlayMessages] as bool?) ?? false, - itAutoPlay: (accountData[ModelKey.itAutoPlay] - ?.content[ModelKey.itAutoPlay] as bool?) ?? - false, + // itAutoPlay: (accountData[ModelKey.itAutoPlay] + // ?.content[ModelKey.itAutoPlay] as bool?) ?? + // true, activatedFreeTrial: (accountData[ModelKey.activatedTrialKey] ?.content[ModelKey.activatedTrialKey] as bool?) ?? false, diff --git a/lib/pangea/pages/settings_learning/settings_learning_view.dart b/lib/pangea/pages/settings_learning/settings_learning_view.dart index 943d81ca2..13dd8d4d7 100644 --- a/lib/pangea/pages/settings_learning/settings_learning_view.dart +++ b/lib/pangea/pages/settings_learning/settings_learning_view.dart @@ -48,19 +48,19 @@ class SettingsLearningView extends StatelessWidget { value, ), ), - ProfileSettingsSwitchListTile.adaptive( - defaultValue: controller.pangeaController.userController.profile - .userSettings.itAutoPlay, - title: - L10n.of(context)!.interactiveTranslatorAutoPlaySliderHeader, - subtitle: L10n.of(context)!.interactiveTranslatorAutoPlayDesc, - onChange: (bool value) => controller - .pangeaController.userController - .updateProfile((profile) { - profile.userSettings.itAutoPlay = value; - return profile; - }), - ), + // ProfileSettingsSwitchListTile.adaptive( + // defaultValue: controller.pangeaController.userController.profile + // .userSettings.itAutoPlay, + // title: + // L10n.of(context)!.interactiveTranslatorAutoPlaySliderHeader, + // subtitle: L10n.of(context)!.interactiveTranslatorAutoPlayDesc, + // onChange: (bool value) => controller + // .pangeaController.userController + // .updateProfile((profile) { + // profile.userSettings.itAutoPlay = value; + // return profile; + // }), + // ), // ProfileSettingsSwitchListTile.adaptive( // defaultValue: controller.pangeaController.userController.profile // .userSettings.autoPlayMessages, diff --git a/lib/pangea/widgets/chat_list/analytics_summary/analytics_popup.dart b/lib/pangea/widgets/chat_list/analytics_summary/analytics_popup.dart index 9dcc7b06b..7f609ce11 100644 --- a/lib/pangea/widgets/chat_list/analytics_summary/analytics_popup.dart +++ b/lib/pangea/widgets/chat_list/analytics_summary/analytics_popup.dart @@ -16,6 +16,11 @@ class AnalyticsPopup extends StatelessWidget { super.key, }); + // we just want to show the constructs that have points + List get constructs => constructsModel.constructList + .where((constructUse) => constructUse.points > 0) + .toList(); + @override Widget build(BuildContext context) { return Dialog( @@ -36,16 +41,16 @@ class AnalyticsPopup extends StatelessWidget { ), body: Padding( padding: const EdgeInsets.symmetric(vertical: 20), - child: constructsModel.constructList.isEmpty + child: constructs.isEmpty ? Center( child: Text(L10n.of(context)!.noDataFound), ) : ListView.builder( - itemCount: constructsModel.constructList.length, + itemCount: constructs.length, itemBuilder: (context, index) { return Tooltip( message: - "${constructsModel.constructList[index].points} / ${constructsModel.maxXPPerLemma}", + "${constructs[index].points} / ${constructsModel.maxXPPerLemma}", child: ListTile( onTap: () {}, title: Text( @@ -55,12 +60,11 @@ class AnalyticsPopup extends StatelessWidget { .constructList[index].lemma, context, ) - : constructsModel.constructList[index].lemma, + : constructs[index].lemma, ), subtitle: LinearProgressIndicator( - value: - constructsModel.constructList[index].points / - constructsModel.maxXPPerLemma, + value: constructs[index].points / + constructsModel.maxXPPerLemma, minHeight: 20, borderRadius: const BorderRadius.all( Radius.circular(AppConfig.borderRadius), diff --git a/lib/pangea/widgets/igc/pangea_text_controller.dart b/lib/pangea/widgets/igc/pangea_text_controller.dart index b7bbc1af8..a8ad07d71 100644 --- a/lib/pangea/widgets/igc/pangea_text_controller.dart +++ b/lib/pangea/widgets/igc/pangea_text_controller.dart @@ -90,7 +90,7 @@ class PangeaTextController extends TextEditingController { // if autoplay on and it start then just start it if (matchIndex != -1 && - choreographer.itAutoPlayEnabled && + // choreographer.itAutoPlayEnabled && choreographer.igc.igcTextData!.matches[matchIndex].isITStart) { return choreographer.onITStart( choreographer.igc.igcTextData!.matches[matchIndex], diff --git a/lib/pangea/widgets/igc/span_card.dart b/lib/pangea/widgets/igc/span_card.dart index ddfa43ba4..63ecad332 100644 --- a/lib/pangea/widgets/igc/span_card.dart +++ b/lib/pangea/widgets/igc/span_card.dart @@ -355,16 +355,16 @@ class WordMatchContent extends StatelessWidget { ), ], ), - if (controller.widget.scm.pangeaMatch!.isITStart) - DontShowSwitchListTile( - controller: pangeaController, - onSwitch: (bool value) { - pangeaController.userController.updateProfile((profile) { - profile.userSettings.itAutoPlay = value; - return profile; - }); - }, - ), + // if (controller.widget.scm.pangeaMatch!.isITStart) + // DontShowSwitchListTile( + // controller: pangeaController, + // onSwitch: (bool value) { + // pangeaController.userController.updateProfile((profile) { + // profile.userSettings.itAutoPlay = value; + // return profile; + // }); + // }, + // ), ], ), ],