From 75112808f66e4beb71aac2a98be2ed1714fffed3 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Mon, 4 Dec 2023 03:36:44 +0100 Subject: [PATCH] dart fix --- .github/workflows/main_deploy.yaml | 2 +- lib/config/firebase_options.dart | 2 +- .../chat/cupertino_widgets_bottom_sheet.dart | 3 +- lib/pages/chat/widgets_bottom_sheet.dart | 2 +- .../controllers/choreographer.dart | 8 ++-- .../controllers/igc_controller.dart | 2 +- .../controllers/it_controller.dart | 8 ++-- .../choreographer/widgets/choice_array.dart | 11 +++-- .../choreographer/widgets/counters.dart | 8 ++-- .../widgets/has_error_button.dart | 6 +-- lib/pangea/choreographer/widgets/it_bar.dart | 31 +++++++------- .../choreographer/widgets/it_bar_buttons.dart | 10 ++--- .../choreographer/widgets/it_shimmer.dart | 14 +++---- .../widgets/language_display_toggle.dart | 4 +- .../language_permissions_warning_buttons.dart | 4 +- .../choreographer/widgets/send_button.dart | 4 +- .../widgets/translation_finished_flow.dart | 11 +++-- lib/pangea/config/environment.dart | 2 - .../contextual_definition_controller.dart | 12 +++--- .../controllers/language_list_controller.dart | 4 +- .../message_analytics_controller.dart | 16 ++++---- .../controllers/message_data_controller.dart | 8 ++-- .../controllers/my_analytics_controller.dart | 10 ++--- .../controllers/subscription_controller.dart | 6 +-- .../controllers/word_net_controller.dart | 2 +- lib/pangea/extensions/client_extension.dart | 16 ++++---- .../extensions/pangea_room_extension.dart | 2 +- lib/pangea/models/chart_analytics_model.dart | 4 +- .../models/choreo_init_response.model.dart | 2 +- lib/pangea/models/choreo_record.dart | 16 ++++---- lib/pangea/models/class_analytics_model.dart | 41 +++++++++---------- lib/pangea/models/class_model.dart | 4 +- .../models/constructs_analytics_model.dart | 4 +- .../custom_input_translation_model.dart | 2 +- lib/pangea/models/headwords.dart | 2 +- lib/pangea/models/igc_text_data_model.dart | 4 +- lib/pangea/models/language_model.dart | 18 ++++---- lib/pangea/models/mobile_subscriptions.dart | 4 +- lib/pangea/models/pangea_match_model.dart | 6 +-- lib/pangea/models/pangea_text_tap.dart | 4 +- lib/pangea/models/pangea_token_model.dart | 4 +- lib/pangea/models/span_data.dart | 2 +- .../models/student_analytics_event.dart | 2 +- .../student_analytics_summary_model.dart | 2 +- lib/pangea/models/user_model.dart | 4 +- .../models/user_profile_search_model.dart | 2 - lib/pangea/models/widget_measurement.dart | 4 +- lib/pangea/network/p_api_exception.dart | 15 ++++--- lib/pangea/network/requests.dart | 8 ++-- .../pages/analytics/analytics_list_tile.dart | 4 +- .../pages/analytics/bar_chart_card.dart | 4 +- .../analytics/bar_chart_placeholder_data.dart | 6 +-- .../pages/analytics/base_analytics_page.dart | 24 +++++------ .../analytics/chart_view_picker_button.dart | 3 +- .../class_analytics/class_analytics.dart | 2 +- .../class_analytics/class_analytics_view.dart | 4 +- .../analytics/class_list/class_list.dart | 4 +- .../analytics/class_list/class_list_view.dart | 2 +- .../pages/analytics/construct_cloud.dart | 10 ++--- .../pages/analytics/construct_list.dart | 8 ++-- .../analytics/list_summary_analytics.dart | 6 +-- .../pages/analytics/messages_bar_chart.dart | 17 ++++---- .../analytics/messages_legend_widget.dart | 6 +-- .../student_analytics/student_analytics.dart | 4 +- .../student_analytics_view.dart | 12 +++--- .../analytics/time_span_menu_button.dart | 3 +- .../pages/analytics/vocab_bar_chart.dart | 8 ++-- .../pages/analytics/vocab_legend_widget.dart | 6 +-- .../pages/class_analytics/measure_able.dart | 3 +- .../class_invitation_selection.dart | 2 +- .../class_settings/class_name_header.dart | 6 +-- .../class_settings/class_settings_page.dart | 2 +- .../class_settings/class_settings_view.dart | 3 +- .../class_analytics_button.dart | 2 +- .../class_description_button.dart | 4 +- ...lass_details_toggle_add_students_tile.dart | 6 +-- .../class_invitation_buttons.dart | 3 +- .../p_class_widgets/class_name_button.dart | 4 +- .../class_settings_button.dart | 2 +- .../class_show_edit_dialog.dart | 4 +- .../p_class_widgets/room_rules_editor.dart | 7 ++-- lib/pangea/pages/connect/p_sso_button.dart | 4 +- .../pages/exchange/add_exchange_to_class.dart | 2 +- .../pages/find_partner/find_partner.dart | 2 +- .../pages/find_partner/find_partner_view.dart | 22 +++++----- lib/pangea/pages/new_class/new_class.dart | 2 +- .../pages/new_class/new_class_view.dart | 2 +- lib/pangea/pages/p_user_age/p_user_age.dart | 2 +- .../pages/p_user_age/p_user_age_view.dart | 2 +- .../settings_learning/settings_learning.dart | 2 +- .../settings_learning_view.dart | 2 +- .../settings_subscription.dart | 2 +- .../settings_subscription_view.dart | 8 ++-- lib/pangea/pages/sign_up/signup.dart | 2 +- lib/pangea/repo/class_analytics_repo.dart | 2 +- lib/pangea/repo/class_repo.dart | 4 +- .../repo/contextualized_translation_repo.dart | 2 +- lib/pangea/repo/exchange_repo.dart | 4 +- .../repo/full_text_translation_repo.dart | 2 +- lib/pangea/repo/igc_repo.dart | 10 ++--- .../repo/interactive_translation_repo.dart | 8 ++-- lib/pangea/repo/message_service.repo.dart | 4 +- lib/pangea/repo/span_data_repo.dart | 2 +- lib/pangea/repo/subscription_repo.dart | 6 +-- lib/pangea/repo/tokens_repo.dart | 4 +- lib/pangea/repo/topic_data_repo.dart | 3 +- lib/pangea/repo/user_repo.dart | 2 +- lib/pangea/repo/word_repo.dart | 4 +- lib/pangea/utils/any_state_holder.dart | 2 +- lib/pangea/utils/class_chat_power_levels.dart | 2 +- lib/pangea/utils/download_chat.dart | 18 ++++---- lib/pangea/utils/error_handler.dart | 6 +-- lib/pangea/utils/firebase_analytics.dart | 28 ++++++------- lib/pangea/utils/overlay.dart | 8 ++-- lib/pangea/utils/p_store.dart | 2 +- lib/pangea/utils/password_forgotten.dart | 2 +- lib/pangea/utils/report_message.dart | 5 +-- lib/pangea/utils/set_class_name.dart | 4 +- lib/pangea/utils/shared_prefs.dart | 18 ++++---- lib/pangea/utils/sync_status_util.dart | 7 ++-- lib/pangea/utils/sync_status_util_v2.dart | 7 ++-- .../widgets/chat/locked_chat_message.dart | 2 +- .../widgets/class/add_class_and_invite.dart | 4 +- lib/pangea/widgets/class/join_with_link.dart | 2 +- lib/pangea/widgets/common/aligned_dialog.dart | 19 ++++----- lib/pangea/widgets/common/bot_face_svg.dart | 4 +- .../widgets/common/list_placeholder.dart | 8 ++-- .../widgets/common/p_circular_loader.dart | 2 +- .../widgets/common/pangea_logo_svg.dart | 3 +- lib/pangea/widgets/common/star_rating.dart | 11 +++-- .../common_widgets/edit_list_tile.dart | 8 ++-- .../common_widgets/overlay_container.dart | 4 +- .../widgets/common_widgets/p_input_field.dart | 8 ++-- lib/pangea/widgets/flag.dart | 4 +- lib/pangea/widgets/igc/card_error_widget.dart | 4 +- lib/pangea/widgets/igc/card_header.dart | 4 +- lib/pangea/widgets/igc/pangea_rich_text.dart | 16 ++++---- .../widgets/igc/pangea_text_controller.dart | 4 +- lib/pangea/widgets/igc/span_card.dart | 32 +++++++-------- lib/pangea/widgets/igc/span_data.dart | 7 ++-- lib/pangea/widgets/igc/word_data_card.dart | 24 +++++------ .../widgets/login/home_picker_logo.dart | 3 +- lib/pangea/widgets/new_group/vocab_list.dart | 24 +++++------ lib/pangea/widgets/space/class_settings.dart | 11 +++-- .../subscription/subscription_buttons.dart | 4 +- .../subscription/subscription_options.dart | 6 +-- .../subscription/subscription_paywall.dart | 4 +- .../user_settings/country_picker_tile.dart | 2 +- .../widgets/user_settings/language_tile.dart | 8 ++-- .../user_settings/p_language_dialog.dart | 6 +-- .../user_settings/p_question_container.dart | 2 +- .../p_settings_switch_list_tile.dart | 4 +- .../word_cloud/word_cloud_tap_view.dart | 4 +- lib/pangea/word_cloud/word_cloud_view.dart | 4 +- lib/widgets/profile_bottom_sheet.dart | 4 +- 155 files changed, 492 insertions(+), 527 deletions(-) diff --git a/.github/workflows/main_deploy.yaml b/.github/workflows/main_deploy.yaml index 9048d81c3..d6bb59c42 100644 --- a/.github/workflows/main_deploy.yaml +++ b/.github/workflows/main_deploy.yaml @@ -34,6 +34,6 @@ jobs: uses: peaceiris/actions-gh-pages@v3 with: personal_token: ${{ secrets.PAGES_DEPLOY_TOKEN }} - publish_dir: ./public + publish_dir: ./public/web publish_branch: gh-pages # cname: app.staging.pangea.chat.im diff --git a/lib/config/firebase_options.dart b/lib/config/firebase_options.dart index 1be493933..6c19689e9 100644 --- a/lib/config/firebase_options.dart +++ b/lib/config/firebase_options.dart @@ -64,7 +64,7 @@ class DefaultFirebaseOptions { databaseURL: 'https://pangea-chat-936ee-default-rtdb.firebaseio.com', storageBucket: 'pangea-chat-936ee.appspot.com', androidClientId: - '545984292675-2amsnoan1mt6lec1fld1a7eagu6gej7o.apps.googleusercontent.com'); + '545984292675-2amsnoan1mt6lec1fld1a7eagu6gej7o.apps.googleusercontent.com',); static const FirebaseOptions ios = FirebaseOptions( apiKey: 'AIzaSyCl8QZd9_PnaqJY2zLHCwlsmSWdq7hnH-U', diff --git a/lib/pages/chat/cupertino_widgets_bottom_sheet.dart b/lib/pages/chat/cupertino_widgets_bottom_sheet.dart index 0bc7ac346..23dddfa9b 100644 --- a/lib/pages/chat/cupertino_widgets_bottom_sheet.dart +++ b/lib/pages/chat/cupertino_widgets_bottom_sheet.dart @@ -9,8 +9,7 @@ import 'edit_widgets_dialog.dart'; class CupertinoWidgetsBottomSheet extends StatelessWidget { final Room room; - const CupertinoWidgetsBottomSheet({Key? key, required this.room}) - : super(key: key); + const CupertinoWidgetsBottomSheet({super.key, required this.room}); @override Widget build(BuildContext context) { diff --git a/lib/pages/chat/widgets_bottom_sheet.dart b/lib/pages/chat/widgets_bottom_sheet.dart index 7a52929ce..9ea89f614 100644 --- a/lib/pages/chat/widgets_bottom_sheet.dart +++ b/lib/pages/chat/widgets_bottom_sheet.dart @@ -9,7 +9,7 @@ import 'edit_widgets_dialog.dart'; class WidgetsBottomSheet extends StatelessWidget { final Room room; - const WidgetsBottomSheet({Key? key, required this.room}) : super(key: key); + const WidgetsBottomSheet({super.key, required this.room}); @override Widget build(BuildContext context) { diff --git a/lib/pangea/choreographer/controllers/choreographer.dart b/lib/pangea/choreographer/controllers/choreographer.dart index 6c3dd830e..263afb593 100644 --- a/lib/pangea/choreographer/controllers/choreographer.dart +++ b/lib/pangea/choreographer/controllers/choreographer.dart @@ -231,7 +231,7 @@ class Choreographer { _textController.text + step.continuances[step.chosen!].text, step.continuances[step.chosen!].gold ? EditType.itGold - : EditType.itStandard); + : EditType.itStandard,); _textController.selection = TextSelection.collapsed(offset: _textController.text.length); giveInputFocus(); @@ -329,14 +329,14 @@ class Choreographer { igc.igcTextData!.matches[matchIndex].status = PangeaMatchStatus.ignored; choreoRecord.addRecord(_textController.text, - match: igc.igcTextData!.matches[matchIndex]); + match: igc.igcTextData!.matches[matchIndex],); igc.igcTextData!.matches.removeAt(matchIndex); } catch (err, stack) { debugger(when: kDebugMode); Sentry.addBreadcrumb( Breadcrumb.fromJson( - {"igcTextData": igc.igcTextData?.toJson(), "offset": cursorOffset}), + {"igcTextData": igc.igcTextData?.toJson(), "offset": cursorOffset},), ); ErrorHandler.logError( e: err, @@ -452,7 +452,7 @@ class Choreographer { bool get _useCustomInput => [ EditType.keyboard, EditType.igc, - EditType.alternativeTranslation + EditType.alternativeTranslation, ].contains(_textController.editType); bool get editTypeIsKeyboard => EditType.keyboard == _textController.editType; diff --git a/lib/pangea/choreographer/controllers/igc_controller.dart b/lib/pangea/choreographer/controllers/igc_controller.dart index 2c341811a..14416b405 100644 --- a/lib/pangea/choreographer/controllers/igc_controller.dart +++ b/lib/pangea/choreographer/controllers/igc_controller.dart @@ -202,7 +202,7 @@ class IgcController { if (igcTextData!.originalInput != choreographer.currentText) { debugPrint( - "returning isIGCTextDataRelevant false because text has changed"); + "returning isIGCTextDataRelevant false because text has changed",); return false; } return true; diff --git a/lib/pangea/choreographer/controllers/it_controller.dart b/lib/pangea/choreographer/controllers/it_controller.dart index a541eb27e..82be64687 100644 --- a/lib/pangea/choreographer/controllers/it_controller.dart +++ b/lib/pangea/choreographer/controllers/it_controller.dart @@ -76,8 +76,8 @@ class ITController { Sentry.addBreadcrumb( Breadcrumb(message: "choreo context", data: { "igcTextData": choreographer.igc.igcTextData?.toJson(), - "currentText": choreographer.currentText - }), + "currentText": choreographer.currentText, + },), ); throw Exception("null _itStartData or empty text in _setSourceText"); } @@ -125,7 +125,7 @@ class ITController { completedITSteps.add(ITStep( currentITStep!.continuances, customInput: currentText, - )); + ),); } currentITStep = null; @@ -419,7 +419,7 @@ class CurrentITStep { } return e; }), - goldCont + goldCont, ]; continuances.shuffle(); } else { diff --git a/lib/pangea/choreographer/widgets/choice_array.dart b/lib/pangea/choreographer/widgets/choice_array.dart index 9b9b2af0e..f01a94339 100644 --- a/lib/pangea/choreographer/widgets/choice_array.dart +++ b/lib/pangea/choreographer/widgets/choice_array.dart @@ -17,7 +17,7 @@ class ChoicesArray extends StatelessWidget { final String originalSpan; final String Function(int) uniqueKeyForLayerLink; const ChoicesArray({ - Key? key, + super.key, required this.isLoading, required this.choices, required this.onPressed, @@ -25,7 +25,7 @@ class ChoicesArray extends StatelessWidget { required this.uniqueKeyForLayerLink, required this.selectedChoiceIndex, this.onLongPress, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -64,13 +64,12 @@ class Choice { class ChoiceItem extends StatelessWidget { const ChoiceItem( - {Key? key, + {super.key, required this.theme, required this.onLongPress, required this.onPressed, required this.entry, - required this.isSelected}) - : super(key: key); + required this.isSelected,}); final MapEntry entry; final ThemeData theme; @@ -102,7 +101,7 @@ class ChoiceItem extends StatelessWidget { child: TextButton( style: ButtonStyle( padding: MaterialStateProperty.all( - const EdgeInsets.symmetric(horizontal: 7)), + const EdgeInsets.symmetric(horizontal: 7),), //if index is selected, then give the background a slight primary color backgroundColor: MaterialStateProperty.all( entry.value.color != null diff --git a/lib/pangea/choreographer/widgets/counters.dart b/lib/pangea/choreographer/widgets/counters.dart index 484da0fe3..5e1c57b9c 100644 --- a/lib/pangea/choreographer/widgets/counters.dart +++ b/lib/pangea/choreographer/widgets/counters.dart @@ -10,11 +10,11 @@ class Counter extends StatelessWidget { final String label; final Color color; const Counter({ - Key? key, + super.key, required this.count, required this.label, required this.color, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -49,12 +49,12 @@ class CounterDisplay extends StatelessWidget { final int yellow; final int custom; const CounterDisplay({ - Key? key, + super.key, required this.correct, required this.incorrect, required this.yellow, required this.custom, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/pangea/choreographer/widgets/has_error_button.dart b/lib/pangea/choreographer/widgets/has_error_button.dart index 8c04bad77..a26401b6e 100644 --- a/lib/pangea/choreographer/widgets/has_error_button.dart +++ b/lib/pangea/choreographer/widgets/has_error_button.dart @@ -10,8 +10,8 @@ class ChoreographerHasErrorButton extends StatelessWidget { const ChoreographerHasErrorButton( this.pangeaController, this.error, { - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { @@ -24,7 +24,7 @@ class ChoreographerHasErrorButton extends StatelessWidget { SnackBar( duration: const Duration(seconds: 5), content: Text( - "${error.title(context)} ${error.description(context)}"), + "${error.title(context)} ${error.description(context)}",), ), ); } else if (error.type == ChoreoErrorType.unsubscribed) { diff --git a/lib/pangea/choreographer/widgets/it_bar.dart b/lib/pangea/choreographer/widgets/it_bar.dart index 3bbb84f42..6215801b8 100644 --- a/lib/pangea/choreographer/widgets/it_bar.dart +++ b/lib/pangea/choreographer/widgets/it_bar.dart @@ -17,7 +17,7 @@ import 'choice_array.dart'; class ITBar extends StatelessWidget { final Choreographer choreographer; - const ITBar({Key? key, required this.choreographer}) : super(key: key); + const ITBar({super.key, required this.choreographer}); ITController get controller => choreographer.itController; @@ -36,7 +36,7 @@ class ITBar extends StatelessWidget { borderRadius: const BorderRadius.only( topLeft: Radius.circular(AppConfig.borderRadius), topRight: Radius.circular(AppConfig.borderRadius), - )), + ),), width: double.infinity, padding: const EdgeInsets.fromLTRB(0, 3, 3, 3), child: Stack( @@ -89,7 +89,7 @@ class ITBar extends StatelessWidget { ? ChoiceFeedbackText(controller: controller) : controller.isTranslationDone ? TranslationFeedback( - controller: controller) + controller: controller,) : ITChoices(controller: controller), ), ), @@ -111,9 +111,9 @@ class ITBar extends StatelessWidget { class ChoiceFeedbackText extends StatelessWidget { const ChoiceFeedbackText({ - Key? key, + super.key, required this.controller, - }) : super(key: key); + }); final ITController controller; @@ -140,9 +140,9 @@ class ChoiceFeedbackText extends StatelessWidget { class OriginalText extends StatelessWidget { const OriginalText({ - Key? key, + super.key, required this.controller, - }) : super(key: key); + }); final ITController controller; @@ -155,7 +155,7 @@ class OriginalText extends StatelessWidget { borderRadius: BorderRadius.only( topLeft: Radius.circular(AppConfig.borderRadius), topRight: Radius.circular(AppConfig.borderRadius), - )), + ),), child: Row( //PTODO - does this already update after reset or we need to setState? mainAxisAlignment: MainAxisAlignment.center, @@ -192,9 +192,9 @@ class OriginalText extends StatelessWidget { class ITChoices extends StatelessWidget { const ITChoices({ - Key? key, + super.key, required this.controller, - }) : super(key: key); + }); // final choices = [ // "we need a really long translation to see what's going to happen with that. it should probably have multiple sentences so that we can see what happens there.we need a really long translation to see what's going to happen with that. it should probably have multiple sentences so that we can see what happens there.", @@ -215,7 +215,7 @@ class ITChoices extends StatelessWidget { } void showCard(BuildContext context, int index, - [Color? borderColor, String? choiceFeedback]) => + [Color? borderColor, String? choiceFeedback,]) => OverlayUtil.showPositionedCard( context: context, cardToShow: WordDataCard( @@ -227,7 +227,7 @@ class ITChoices extends StatelessWidget { : controller.targetLangCode, hasInfo: controller.currentITStep!.continuances[index].hasInfo, choiceFeedback: choiceFeedback, - room: controller.choreographer.chatController.room), + room: controller.choreographer.chatController.room,), cardSize: const Size(300, 300), borderColor: borderColor, transformTargetId: controller.choreographer.itBarTransformTargetKey, @@ -260,7 +260,7 @@ class ITChoices extends StatelessWidget { debugPrint("is gold? ${continuance.gold}"); if (continuance.level == 1 || continuance.wasClicked) { Future.delayed(const Duration(milliseconds: 500), - () => controller.selectTranslation(index)); + () => controller.selectTranslation(index),); } else { showCard( context, @@ -290,8 +290,7 @@ class ITChoices extends StatelessWidget { class ITError extends StatelessWidget { final ITController controller; final Object error; - const ITError({Key? key, required this.error, required this.controller}) - : super(key: key); + const ITError({super.key, required this.error, required this.controller}); @override Widget build(BuildContext context) { @@ -309,7 +308,7 @@ class ITError extends StatelessWidget { // Haga clic en su mensaje para ver los significados de las palabras. style: TextStyle( fontStyle: FontStyle.italic, - color: Theme.of(context).colorScheme.error), + color: Theme.of(context).colorScheme.error,), ), ), ITRestartButton(controller: controller), diff --git a/lib/pangea/choreographer/widgets/it_bar_buttons.dart b/lib/pangea/choreographer/widgets/it_bar_buttons.dart index eecadbe97..815020d17 100644 --- a/lib/pangea/choreographer/widgets/it_bar_buttons.dart +++ b/lib/pangea/choreographer/widgets/it_bar_buttons.dart @@ -9,9 +9,9 @@ import '../controllers/it_controller.dart'; class ITCloseButton extends StatelessWidget { const ITCloseButton({ - Key? key, + super.key, required this.choreographer, - }) : super(key: key); + }); final Choreographer choreographer; @@ -31,7 +31,7 @@ class ITCloseButton extends StatelessWidget { } class ITBotButton extends StatelessWidget { - const ITBotButton({Key? key, required this.choreographer}) : super(key: key); + const ITBotButton({super.key, required this.choreographer}); final Choreographer choreographer; @@ -58,9 +58,9 @@ class ITBotButton extends StatelessWidget { class ITRestartButton extends StatelessWidget { ITRestartButton({ - Key? key, + super.key, required this.controller, - }) : super(key: key); + }); final ITController controller; final PangeaController pangeaController = MatrixState.pangeaController; diff --git a/lib/pangea/choreographer/widgets/it_shimmer.dart b/lib/pangea/choreographer/widgets/it_shimmer.dart index c9a570fe5..d0e1a3b13 100644 --- a/lib/pangea/choreographer/widgets/it_shimmer.dart +++ b/lib/pangea/choreographer/widgets/it_shimmer.dart @@ -5,19 +5,19 @@ import 'package:flutter/material.dart'; import 'package:fluffychat/config/app_config.dart'; class ItShimmer extends StatelessWidget { - const ItShimmer({Key? key, required this.originalSpan}) : super(key: key); + const ItShimmer({super.key, required this.originalSpan}); final String originalSpan; Iterable renderShimmerIfListEmpty(BuildContext context, - {int noOfBars = 3}) { + {int noOfBars = 3,}) { final List dummyStrings = []; for (int i = 0; i < noOfBars; i++) { dummyStrings.add(originalSpan); } return dummyStrings.map((e) => ITShimmerElement( text: e, - )); + ),); } // PTODO - bring this back, make it shimmer @@ -32,9 +32,9 @@ class ItShimmer extends StatelessWidget { class ITShimmerElement extends StatelessWidget { const ITShimmerElement({ - Key? key, + super.key, required this.text, - }) : super(key: key); + }); final String text; @@ -57,14 +57,14 @@ class ITShimmerElement extends StatelessWidget { child: TextButton( style: ButtonStyle( padding: MaterialStateProperty.all( - const EdgeInsets.symmetric(horizontal: 7)), + const EdgeInsets.symmetric(horizontal: 7),), shape: MaterialStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), ), backgroundColor: MaterialStateProperty.all( - AppConfig.primaryColor.withOpacity(0.2)), + AppConfig.primaryColor.withOpacity(0.2),), ), onPressed: () {}, child: Text( diff --git a/lib/pangea/choreographer/widgets/language_display_toggle.dart b/lib/pangea/choreographer/widgets/language_display_toggle.dart index a634a73e2..a399fda44 100644 --- a/lib/pangea/choreographer/widgets/language_display_toggle.dart +++ b/lib/pangea/choreographer/widgets/language_display_toggle.dart @@ -7,9 +7,9 @@ import '../../../pages/chat/chat.dart'; class LanguageDisplayToggle extends StatelessWidget { const LanguageDisplayToggle({ - Key? key, + super.key, required this.controller, - }) : super(key: key); + }); final ChatController controller; diff --git a/lib/pangea/choreographer/widgets/language_permissions_warning_buttons.dart b/lib/pangea/choreographer/widgets/language_permissions_warning_buttons.dart index ef444a533..93d441aa4 100644 --- a/lib/pangea/choreographer/widgets/language_permissions_warning_buttons.dart +++ b/lib/pangea/choreographer/widgets/language_permissions_warning_buttons.dart @@ -26,10 +26,10 @@ class LanguagePermissionsButtons extends StatelessWidget { final Choreographer choreographer; const LanguagePermissionsButtons({ - Key? key, + super.key, required this.roomID, required this.choreographer, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/pangea/choreographer/widgets/send_button.dart b/lib/pangea/choreographer/widgets/send_button.dart index 36d19ece2..045f0c516 100644 --- a/lib/pangea/choreographer/widgets/send_button.dart +++ b/lib/pangea/choreographer/widgets/send_button.dart @@ -7,9 +7,9 @@ import '../../../pages/chat/chat.dart'; class ChoreographerSendButton extends StatelessWidget { const ChoreographerSendButton({ - Key? key, + super.key, required this.controller, - }) : super(key: key); + }); final ChatController controller; diff --git a/lib/pangea/choreographer/widgets/translation_finished_flow.dart b/lib/pangea/choreographer/widgets/translation_finished_flow.dart index b63424565..197d7d463 100644 --- a/lib/pangea/choreographer/widgets/translation_finished_flow.dart +++ b/lib/pangea/choreographer/widgets/translation_finished_flow.dart @@ -7,8 +7,7 @@ import 'choice_array.dart'; class TranslationFeedback extends StatelessWidget { final ITController controller; - const TranslationFeedback({Key? key, required this.controller}) - : super(key: key); + const TranslationFeedback({super.key, required this.controller}); @override Widget build(BuildContext context) { @@ -59,9 +58,9 @@ class TranslationFeedback extends StatelessWidget { class AlternativeTranslations extends StatelessWidget { const AlternativeTranslations({ - Key? key, + super.key, required this.controller, - }) : super(key: key); + }); final ITController controller; @@ -73,12 +72,12 @@ class AlternativeTranslations extends StatelessWidget { controller.choreographer.altTranslator.loadingAlternativeTranslations, // choices: controller.choreographer.altTranslator.similarityResponse.scores choices: [ - Choice(text: controller.choreographer.altTranslator.translations.first) + Choice(text: controller.choreographer.altTranslator.translations.first), ], // choices: controller.choreographer.altTranslator.translations, onPressed: (int index) { controller.choreographer.onSelectAlternativeTranslation( - controller.choreographer.altTranslator.translations[index]); + controller.choreographer.altTranslator.translations[index],); }, uniqueKeyForLayerLink: (int index) => "altTranslation$index", selectedChoiceIndex: null, diff --git a/lib/pangea/config/environment.dart b/lib/pangea/config/environment.dart index f9eaf43de..bbb337a58 100644 --- a/lib/pangea/config/environment.dart +++ b/lib/pangea/config/environment.dart @@ -1,8 +1,6 @@ -import 'package:flutter/foundation.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; -import '../../utils/platform_infos.dart'; class Environment { static bool get itIsTime => diff --git a/lib/pangea/controllers/contextual_definition_controller.dart b/lib/pangea/controllers/contextual_definition_controller.dart index a8947aea7..83ec6bb0e 100644 --- a/lib/pangea/controllers/contextual_definition_controller.dart +++ b/lib/pangea/controllers/contextual_definition_controller.dart @@ -22,12 +22,12 @@ class ContextualDefinitionController { } _ContextualDefinitionCacheItem? _getLocal( - ContextualDefinitionRequestModel req) => + ContextualDefinitionRequestModel req,) => _definitions.firstWhereOrNull( - (e) => e.word == req.word && e.fullText == req.fullText); + (e) => e.word == req.word && e.fullText == req.fullText,); Future get( - ContextualDefinitionRequestModel req) { + ContextualDefinitionRequestModel req,) { final _ContextualDefinitionCacheItem? localItem = _getLocal(req); if (localItem != null) return localItem.data; @@ -55,7 +55,7 @@ class ContextualDefinitionController { return res; } catch (err, stack) { debugPrint( - "error getting contextual definition for ${request.word} in '${request.fullText}'"); + "error getting contextual definition for ${request.word} in '${request.fullText}'",); ErrorHandler.logError(e: err, s: stack, data: request.toJson()); return null; } @@ -120,14 +120,14 @@ class ContextualDefinitionRequestModel { required this.word, required this.feedbackLang, required this.fullTextLang, - required this.wordLang}); + required this.wordLang,}); Map toJson() => { ModelKey.fullText: fullText, ModelKey.word: word, ModelKey.lang: feedbackLang, ModelKey.fullTextLang: fullTextLang, - ModelKey.wordLang: wordLang + ModelKey.wordLang: wordLang, }; } diff --git a/lib/pangea/controllers/language_list_controller.dart b/lib/pangea/controllers/language_list_controller.dart index e713b662a..946243c2e 100644 --- a/lib/pangea/controllers/language_list_controller.dart +++ b/lib/pangea/controllers/language_list_controller.dart @@ -36,7 +36,7 @@ class PangeaLanguage { } _langList.removeWhere((element) => LanguageModel.codeFromNameOrCode(element.langCode) == - LanguageKeys.unknownLanguage); + LanguageKeys.unknownLanguage,); _langList.sort((a, b) => a.displayName.compareTo(b.displayName)); _langList.insert(0, LanguageModel.multiLingual()); } catch (err, stack) { @@ -64,7 +64,7 @@ class PangeaLanguage { static Future _saveFlags(List langFlags) async { final Map flagMap = { - PrefKey.flags: langFlags.map((e) => e.toJson()).toList() + PrefKey.flags: langFlags.map((e) => e.toJson()).toList(), }; await MyShared.saveJson(PrefKey.flags, flagMap); } diff --git a/lib/pangea/controllers/message_analytics_controller.dart b/lib/pangea/controllers/message_analytics_controller.dart index fe4e6d9d4..ccdaaf9a1 100644 --- a/lib/pangea/controllers/message_analytics_controller.dart +++ b/lib/pangea/controllers/message_analytics_controller.dart @@ -124,7 +124,7 @@ class AnalyticsController extends BaseController { } else { if (studentId != null) { studentAnalyticsSummaryEvents = [ - await classRoom.getStudentAnalytics(studentId) + await classRoom.getStudentAnalytics(studentId), ]; } else { studentAnalyticsSummaryEvents = await classRoom.getClassAnalytics(); @@ -159,7 +159,7 @@ class AnalyticsController extends BaseController { studentId: studentId, chatId: chatId, chartAnalyticsModel: newModel, - )); + ),); return newModel; } catch (err, s) { @@ -171,7 +171,7 @@ class AnalyticsController extends BaseController { Future vocabHeadwordsWithTotals( String langCode, List vocab, - [String? chatId]) async { + [String? chatId,]) async { final VocabHeadwords vocabHeadwords = await VocabHeadwords.getHeadwords(langCode); for (final vocabList in vocabHeadwords.lists) { @@ -214,7 +214,7 @@ class AnalyticsController extends BaseController { for (final event in studentAnalyticsSummaryEvents) { if (event != null) { msgs.addAll(event.content.messages - .where((m) => directChatIds.contains(m.chatId))); + .where((m) => directChatIds.contains(m.chatId)),); } else { debugPrint("studentAnalyticsSummaryEvent is null"); } @@ -231,7 +231,7 @@ class AnalyticsController extends BaseController { studentId: null, chatId: AnalyticsEntryType.privateChats.toString(), chartAnalyticsModel: newModel, - )); + ),); return newModel; } catch (err, s) { @@ -251,7 +251,7 @@ class AnalyticsController extends BaseController { } Future> studentConstructs( - String studentId, String langCode) { + String studentId, String langCode,) { final Room? analyticsRoom = _pangeaController.matrixState.client .analyticsRoomLocal(langCode, studentId); return analyticsRoom!.allConstructEvents; @@ -385,14 +385,14 @@ class AnalyticsController extends BaseController { chatIdsToFilterBy.addAll(_pangeaController.matrixState.client .getRoomById(defaultSelected.id) ?.childrenAndGrandChildrenDirectChatIds ?? - []); + [],); } else if (defaultSelected.type == AnalyticsEntryType.space) { chatIdsToFilterBy.addAll(_pangeaController.matrixState.client .getRoomById(defaultSelected.id) ?.childrenAndGrandChildren .where((e) => e.roomId != null) .map((e) => e.roomId!) ?? - []); + [],); } if (chatIdsToFilterBy.isNotEmpty) { for (final event in events) { diff --git a/lib/pangea/controllers/message_data_controller.dart b/lib/pangea/controllers/message_data_controller.dart index 87f357cab..7f6531d5f 100644 --- a/lib/pangea/controllers/message_data_controller.dart +++ b/lib/pangea/controllers/message_data_controller.dart @@ -31,7 +31,7 @@ class MessageDataController extends BaseController { CacheItem? getItem(String parentId, String type, String langCode) => _cache.firstWhereOrNull((e) => - e.parentId == parentId && e.type == type && e.langCode == langCode); + e.parentId == parentId && e.type == type && e.langCode == langCode,); Future _getTokens( TokensRequestModel req, @@ -66,7 +66,7 @@ class MessageDataController extends BaseController { } catch (err, stack) { Sentry.addBreadcrumb( Breadcrumb( - message: "err in _getTokenEvent with repEventId $repEventId"), + message: "err in _getTokenEvent with repEventId $repEventId",), ); Sentry.addBreadcrumb( Breadcrumb.fromJson({"req": req.toJson()}), @@ -99,7 +99,7 @@ class MessageDataController extends BaseController { req: req, room: room, ), - )); + ),); return _cache.last.data; } @@ -201,7 +201,7 @@ class MessageDataQueueItem { UseType useType; MessageDataQueueItem( - this.transactionId, this.repTokensAndRecords, this.useType + this.transactionId, this.repTokensAndRecords, this.useType, // required this.recentMessageRecord, ); } diff --git a/lib/pangea/controllers/my_analytics_controller.dart b/lib/pangea/controllers/my_analytics_controller.dart index 1b2863284..244329243 100644 --- a/lib/pangea/controllers/my_analytics_controller.dart +++ b/lib/pangea/controllers/my_analytics_controller.dart @@ -24,13 +24,13 @@ class MyAnalyticsController { //PTODO - locally cache and update periodically Future handleMessage( - Room room, RecentMessageRecord messageRecord) async { + Room room, RecentMessageRecord messageRecord,) async { try { debugPrint("in handle message with type ${messageRecord.useType}"); if (_userId == null) { debugger(when: kDebugMode); ErrorHandler.logError( - m: "null userId in updateAnalytics", s: StackTrace.current); + m: "null userId in updateAnalytics", s: StackTrace.current,); return; } @@ -55,7 +55,7 @@ class MyAnalyticsController { } Future> analyticsEvents( - List spaces) async { + List spaces,) async { final List> events = []; for (final space in spaces) { events.add(space.getStudentAnalytics(_userId!)); @@ -69,7 +69,7 @@ class MyAnalyticsController { ); Future saveConstructsMixed( - List allUses, String langCode) async { + List allUses, String langCode,) async { try { final Map> aggregatedVocabUse = {}; for (final use in allUses) { @@ -84,7 +84,7 @@ class MyAnalyticsController { debugPrint("saving of type ${uses.value.first.constructType}"); saveFutures.add( analyticsRoom.saveConstructUsesSameLemma( - uses.key, uses.value.first.constructType!, uses.value), + uses.key, uses.value.first.constructType!, uses.value,), ); } diff --git a/lib/pangea/controllers/subscription_controller.dart b/lib/pangea/controllers/subscription_controller.dart index 1cd26a54f..b47e2dc46 100644 --- a/lib/pangea/controllers/subscription_controller.dart +++ b/lib/pangea/controllers/subscription_controller.dart @@ -88,7 +88,7 @@ class SubscriptionController extends BaseController { } Future showPaywall(BuildContext context, - [bool forceShow = false]) async { + [bool forceShow = false,]) async { try { if (!initialized) { await initialize(); @@ -157,7 +157,7 @@ class SubscriptionController extends BaseController { void submitSubscriptionChange( SubscriptionDetails? selectedSubscription, BuildContext context, - {bool isPromo = false}) async { + {bool isPromo = false,}) async { if (selectedSubscription != null) { if (kIsWeb) { if (selectedSubscription.duration == null) { @@ -187,7 +187,7 @@ class SubscriptionController extends BaseController { } try { GoogleAnalytics.beginPurchaseSubscription( - selectedSubscription, context); + selectedSubscription, context,); await Purchases.purchasePackage(selectedSubscription.package!); GoogleAnalytics.updateUserSubscriptionStatus(true); } catch (err) { diff --git a/lib/pangea/controllers/word_net_controller.dart b/lib/pangea/controllers/word_net_controller.dart index b909f9175..4a7f7c470 100644 --- a/lib/pangea/controllers/word_net_controller.dart +++ b/lib/pangea/controllers/word_net_controller.dart @@ -27,7 +27,7 @@ class WordController extends BaseController { f: fullText, l1: userL1, l2: userL2, - )); + ),); Future getWordDataGlobal({ required String word, diff --git a/lib/pangea/extensions/client_extension.dart b/lib/pangea/extensions/client_extension.dart index 6012383d5..9fdffca70 100644 --- a/lib/pangea/extensions/client_extension.dart +++ b/lib/pangea/extensions/client_extension.dart @@ -19,25 +19,25 @@ extension PangeaClient on Client { List get classesImTeaching => rooms .where((e) => e.isPangeaClass && - e.ownPowerLevel == ClassDefaultValues.powerLevelOfAdmin) + e.ownPowerLevel == ClassDefaultValues.powerLevelOfAdmin,) .toList(); List get classesAndExchangesImTeaching => rooms .where((e) => (e.isPangeaClass || e.isExchange) && - e.ownPowerLevel == ClassDefaultValues.powerLevelOfAdmin) + e.ownPowerLevel == ClassDefaultValues.powerLevelOfAdmin,) .toList(); List get classesImIn => rooms .where((e) => e.isPangeaClass && - e.ownPowerLevel < ClassDefaultValues.powerLevelOfAdmin) + e.ownPowerLevel < ClassDefaultValues.powerLevelOfAdmin,) .toList(); List get classesAndExchangesImStudyingIn => rooms .where((e) => (e.isPangeaClass || e.isExchange) && - e.ownPowerLevel < ClassDefaultValues.powerLevelOfAdmin) + e.ownPowerLevel < ClassDefaultValues.powerLevelOfAdmin,) .toList(); List get classesAndExchangesImIn => @@ -101,7 +101,7 @@ extension PangeaClient on Client { analyticsRoom .join() .onError((error, stackTrace) => - ErrorHandler.logError(e: error, s: stackTrace)) + ErrorHandler.logError(e: error, s: stackTrace),) .then((value) => analyticsRoom.postLoad()); return analyticsRoom; } @@ -112,14 +112,14 @@ extension PangeaClient on Client { final String roomID = await createRoom( creationContent: { 'type': PangeaRoomTypes.analytics, - ModelKey.langCode: langCode + ModelKey.langCode: langCode, }, name: "$userID $langCode Analytics", topic: "This room stores learning analytics for $userID.", invite: [ - ...(await myTeachers).map((e) => e.id).toList(), + ...(await myTeachers).map((e) => e.id), // BotName.localBot, - BotName.byEnvironment + BotName.byEnvironment, ], visibility: Visibility.private, roomAliasName: "${userID!.localpart}_${langCode}_analytics", diff --git a/lib/pangea/extensions/pangea_room_extension.dart b/lib/pangea/extensions/pangea_room_extension.dart index ff8ea326a..0e2b788fd 100644 --- a/lib/pangea/extensions/pangea_room_extension.dart +++ b/lib/pangea/extensions/pangea_room_extension.dart @@ -753,7 +753,7 @@ extension PangeaRoom on Room { final toAdd = [ ...getParticipants([Membership.invite, Membership.join]) .map((e) => e.id) - .toList(), + , BotName.byEnvironment, ]; for (final teacher in await client.myTeachers) { diff --git a/lib/pangea/models/chart_analytics_model.dart b/lib/pangea/models/chart_analytics_model.dart index 0b0cb085d..af06a0958 100644 --- a/lib/pangea/models/chart_analytics_model.dart +++ b/lib/pangea/models/chart_analytics_model.dart @@ -25,7 +25,7 @@ class TimeSeriesTotals { UseType.ta.string: ta, UseType.ga.string: ga, UseType.wa.string: wa, - UseType.un.string: un + UseType.un.string: un, }; factory TimeSeriesTotals.fromJson(json) => TimeSeriesTotals( @@ -77,7 +77,7 @@ class TimeSeriesInterval { Map toJson() => { "strt": start.toIso8601String(), "end": end.toIso8601String(), - "totals": totals.toJson() + "totals": totals.toJson(), }; factory TimeSeriesInterval.fromJson(json) => TimeSeriesInterval( diff --git a/lib/pangea/models/choreo_init_response.model.dart b/lib/pangea/models/choreo_init_response.model.dart index d91233ce8..6535848f0 100644 --- a/lib/pangea/models/choreo_init_response.model.dart +++ b/lib/pangea/models/choreo_init_response.model.dart @@ -5,7 +5,7 @@ class ChoreoResponseModel { String? feedbackMessage; int? payloadId; ChoreoResponseModel( - {this.grammarData, this.detectedLang, this.route, this.feedbackMessage}); + {this.grammarData, this.detectedLang, this.route, this.feedbackMessage,}); ChoreoResponseModel.fromJson(Map json) { grammarData = json['grammar_data'] != null diff --git a/lib/pangea/models/choreo_record.dart b/lib/pangea/models/choreo_record.dart index 5a2a457d6..10f2e78de 100644 --- a/lib/pangea/models/choreo_record.dart +++ b/lib/pangea/models/choreo_record.dart @@ -68,7 +68,7 @@ class ChoreoRecord { throw Exception("match and step should not both be defined"); } choreoSteps.add(ChoreoRecordStep( - text: text, acceptedOrIgnoredMatch: match, itStep: step)); + text: text, acceptedOrIgnoredMatch: match, itStep: step,),); } bool get hasAcceptedMatches => choreoSteps.any( @@ -118,11 +118,11 @@ class ChoreoRecord { /// for each continuance /// if not within the final message, save ignIT/incIT List toVocabUse( - List tokens, String chatId, String msgId) { + List tokens, String chatId, String msgId,) { final List uses = []; final DateTime now = DateTime.now(); List lemmasToVocabUses( - List lemmas, ConstructUseType type) { + List lemmas, ConstructUseType type,) { final List uses = []; for (final lemma in lemmas) { if (lemma.saveVocab) { @@ -134,7 +134,7 @@ class ChoreoRecord { form: lemma.form, msgId: msgId, constructType: ConstructType.vocab, - )); + ),); } } return uses; @@ -147,7 +147,7 @@ class ChoreoRecord { if (step.acceptedOrIgnoredMatch?.status == PangeaMatchStatus.accepted && (step.acceptedOrIgnoredMatch!.match.choices?.any((r) => r.value.contains(token.text.content) && - step.text.contains(r.value)) ?? + step.text.contains(r.value),) ?? false)) { return lemmasToVocabUses(token.lemmas, ConstructUseType.ga); } @@ -212,7 +212,7 @@ class ChoreoRecord { form: name, msgId: msgId, constructType: ConstructType.grammar, - )); + ),); } } return uses; @@ -253,10 +253,10 @@ class ChoreoRecordStep { ITStep? itStep; ChoreoRecordStep( - {required this.text, this.acceptedOrIgnoredMatch, this.itStep}) { + {required this.text, this.acceptedOrIgnoredMatch, this.itStep,}) { if (itStep != null && acceptedOrIgnoredMatch != null) { throw Exception( - "itStep and acceptedOrIgnoredMatch should not both be defined"); + "itStep and acceptedOrIgnoredMatch should not both be defined",); } } diff --git a/lib/pangea/models/class_analytics_model.dart b/lib/pangea/models/class_analytics_model.dart index 8c55be5aa..3e37ee4d1 100644 --- a/lib/pangea/models/class_analytics_model.dart +++ b/lib/pangea/models/class_analytics_model.dart @@ -14,11 +14,11 @@ class ClassAnalyticsModel { } Map toJson() { - final _data = {}; - _data['class_id'] = classId; - _data['user_ids'] = userIds; - _data['analytics'] = analytics.map((e) => e.toJson()).toList(); - return _data; + final data = {}; + data['class_id'] = classId; + data['user_ids'] = userIds; + data['analytics'] = analytics.map((e) => e.toJson()).toList(); + return data; } } @@ -37,10 +37,10 @@ class Analytics { } Map toJson() { - final _data = {}; - _data['title'] = title; - _data['section'] = section.map((e) => e.toJson()).toList(); - return _data; + final data = {}; + data['title'] = title; + data['section'] = section.map((e) => e.toJson()).toList(); + return data; } } @@ -61,11 +61,11 @@ class Section { } Map toJson() { - final _data = {}; - _data['title'] = title; - _data['class_total'] = classTotal; - _data['data'] = data.map((e) => e.toJson()).toList(); - return _data; + final data = {}; + data['title'] = title; + data['class_total'] = classTotal; + data['data'] = data.map((e) => e.toJson()).toList(); + return data; } } @@ -73,9 +73,6 @@ class Data { Data(); set value(String val) => _value = val; String get value { - if (_value == null) { - return _value.toString(); - } if (value_type == 'date') { return DateFormat('yyyy/M/dd hh:mm a') .format(DateTime.parse(_value).toLocal()) @@ -94,10 +91,10 @@ class Data { } Map toJson() { - final _data = {}; - _data['user_id'] = userId; - _data['value'] = _value; - _data['value_type'] = value_type; - return _data; + final data = {}; + data['user_id'] = userId; + data['value'] = _value; + data['value_type'] = value_type; + return data; } } diff --git a/lib/pangea/models/class_model.dart b/lib/pangea/models/class_model.dart index b58a5f56a..a31999b19 100644 --- a/lib/pangea/models/class_model.dart +++ b/lib/pangea/models/class_model.dart @@ -44,9 +44,9 @@ class ClassSettingsModel { city: json['city'], country: json['country'], dominantLanguage: LanguageModel.codeFromNameOrCode( - json['dominant_language'] ?? LanguageKeys.unknownLanguage), + json['dominant_language'] ?? LanguageKeys.unknownLanguage,), targetLanguage: LanguageModel.codeFromNameOrCode( - json['target_language'] ?? LanguageKeys.unknownLanguage), + json['target_language'] ?? LanguageKeys.unknownLanguage,), languageLevel: json['language_level'], schoolName: json['school_name'], ); diff --git a/lib/pangea/models/constructs_analytics_model.dart b/lib/pangea/models/constructs_analytics_model.dart index 03b2069af..7c9babc99 100644 --- a/lib/pangea/models/constructs_analytics_model.dart +++ b/lib/pangea/models/constructs_analytics_model.dart @@ -29,12 +29,12 @@ class ConstructUses { // try { debugger( when: kDebugMode && - (json['uses'] == null || json[ModelKey.lemma] == null)); + (json['uses'] == null || json[ModelKey.lemma] == null),); return ConstructUses( lemma: json[ModelKey.lemma], uses: (json['uses'] as Iterable) .map( - (use) => use != null ? OneConstructUse.fromJson(use) : null) + (use) => use != null ? OneConstructUse.fromJson(use) : null,) .where((element) => element != null) .cast() .toList(), diff --git a/lib/pangea/models/custom_input_translation_model.dart b/lib/pangea/models/custom_input_translation_model.dart index 6a45911c9..7d2989d73 100644 --- a/lib/pangea/models/custom_input_translation_model.dart +++ b/lib/pangea/models/custom_input_translation_model.dart @@ -36,6 +36,6 @@ class CustomInputRequestModel { ModelKey.tgtLang: targetLangCode, 'user_id': userId, 'room_id': roomId, - 'class_id': classId + 'class_id': classId, }; } diff --git a/lib/pangea/models/headwords.dart b/lib/pangea/models/headwords.dart index 13253ba8f..f872d51ac 100644 --- a/lib/pangea/models/headwords.dart +++ b/lib/pangea/models/headwords.dart @@ -22,7 +22,7 @@ class VocabHeadwords { lists.add(VocabList( name: entry.key, lemmas: (entry.value as Iterable).cast().toList(), - )); + ),); } return VocabHeadwords(lists: lists); } diff --git a/lib/pangea/models/igc_text_data_model.dart b/lib/pangea/models/igc_text_data_model.dart index 8f6f74928..ba51a4a72 100644 --- a/lib/pangea/models/igc_text_data_model.dart +++ b/lib/pangea/models/igc_text_data_model.dart @@ -213,7 +213,7 @@ class IGCTextData { Breadcrumb.fromJson( { "fullText": originalInput, - "tokens": tokens.map((e) => e.toJson()).toString() + "tokens": tokens.map((e) => e.toJson()).toString(), }, ), ); @@ -306,7 +306,7 @@ class IGCTextData { transformTargetId: transformTargetId, )) : null, - )); + ),); final int charBetween = getAfterTokenSpacingByIndex( index, diff --git a/lib/pangea/models/language_model.dart b/lib/pangea/models/language_model.dart index 02d3f706e..eddcec842 100644 --- a/lib/pangea/models/language_model.dart +++ b/lib/pangea/models/language_model.dart @@ -79,7 +79,7 @@ class LanguageModel { languageFlag: "", displayName: "Unknown", l2: false, - l1: false); + l1: false,); static LanguageModel multiLingual([BuildContext? context]) => LanguageModel( displayName: context != null @@ -522,7 +522,7 @@ class _LanguageLocal { "ce": {"name": "Chechen", "nativeName": "нохчийн мотт"}, "ny": { "name": "Chichewa, Chewa, Nyanja", - "nativeName": "chiCheŵa, chinyanja" + "nativeName": "chiCheŵa, chinyanja", }, "zh": {"name": "Chinese", "nativeName": "中文 (Zhōngwén), 汉语, 漢語"}, "cv": {"name": "Chuvash", "nativeName": "чӑваш чӗлхи"}, @@ -544,7 +544,7 @@ class _LanguageLocal { "fr": {"name": "French", "nativeName": "français, langue française"}, "ff": { "name": "Fula; Fulah; Pulaar; Pular", - "nativeName": "Fulfulde, Pulaar, Pular" + "nativeName": "Fulfulde, Pulaar, Pular", }, "gl": {"name": "Galician", "nativeName": "Galego"}, "ka": {"name": "Georgian", "nativeName": "ქართული"}, @@ -563,7 +563,7 @@ class _LanguageLocal { "id": {"name": "Indonesian", "nativeName": "Bahasa Indonesia"}, "ie": { "name": "Interlingue", - "nativeName": "Originally called Occidental; then Interlingue after WWII" + "nativeName": "Originally called Occidental; then Interlingue after WWII", }, "ga": {"name": "Irish", "nativeName": "Gaeilge"}, "ig": {"name": "Igbo", "nativeName": "Asụsụ Igbo"}, @@ -576,7 +576,7 @@ class _LanguageLocal { "jv": {"name": "Javanese", "nativeName": "basa Jawa"}, "kl": { "name": "Kalaallisut, Greenlandic", - "nativeName": "kalaallisut, kalaallit oqaasii" + "nativeName": "kalaallisut, kalaallit oqaasii", }, "kn": {"name": "Kannada", "nativeName": "ಕನ್ನಡ"}, "kr": {"name": "Kanuri", "nativeName": "Kanuri"}, @@ -594,12 +594,12 @@ class _LanguageLocal { "la": {"name": "Latin", "nativeName": "latine, lingua latina"}, "lb": { "name": "Luxembourgish, Letzeburgesch", - "nativeName": "Lëtzebuergesch" + "nativeName": "Lëtzebuergesch", }, "lg": {"name": "Luganda", "nativeName": "Luganda"}, "li": { "name": "Limburgish, Limburgan, Limburger", - "nativeName": "Limburgs" + "nativeName": "Limburgs", }, "ln": {"name": "Lingala", "nativeName": "Lingála"}, "lo": {"name": "Lao", "nativeName": "ພາສາລາວ"}, @@ -631,7 +631,7 @@ class _LanguageLocal { "cu": { "name": "Old Church Slavonic, Church Slavic, Church Slavonic, Old Bulgarian, Old Slavonic", - "nativeName": "ѩзыкъ словѣньскъ" + "nativeName": "ѩзыкъ словѣньскъ", }, "om": {"name": "Oromo", "nativeName": "Afaan Oromoo"}, "or": {"name": "Oriya", "nativeName": "ଓଡ଼ିଆ"}, @@ -673,7 +673,7 @@ class _LanguageLocal { "ti": {"name": "Tigrinya", "nativeName": "ትግርኛ"}, "bo": { "name": "Tibetan Standard, Tibetan, Central", - "nativeName": "བོད་ཡིག" + "nativeName": "བོད་ཡིག", }, "tk": {"name": "Turkmen", "nativeName": "Türkmen, Түркмен"}, "tl": {"name": "Tagalog", "nativeName": "Wikang Tagalog, ᜏᜒᜃᜅ᜔ ᜆᜄᜎᜓᜄ᜔"}, diff --git a/lib/pangea/models/mobile_subscriptions.dart b/lib/pangea/models/mobile_subscriptions.dart index 559cc44b1..c2f1d9d09 100644 --- a/lib/pangea/models/mobile_subscriptions.dart +++ b/lib/pangea/models/mobile_subscriptions.dart @@ -161,13 +161,13 @@ class MobileSubscriptionInfo extends SubscriptionInfo { .entitlements.all.entries .where((MapEntry entry) => entry.value.expirationDate == null || - DateTime.parse(entry.value.expirationDate!).isAfter(DateTime.now())) + DateTime.parse(entry.value.expirationDate!).isAfter(DateTime.now()),) .map((MapEntry entry) => entry.value) .toList(); allEntitlements = info.entitlements.all.entries .map((MapEntry entry) => - entry.value.productIdentifier) + entry.value.productIdentifier,) .cast() .toList(); diff --git a/lib/pangea/models/pangea_match_model.dart b/lib/pangea/models/pangea_match_model.dart index 40c8b2afc..7e71f65ef 100644 --- a/lib/pangea/models/pangea_match_model.dart +++ b/lib/pangea/models/pangea_match_model.dart @@ -70,7 +70,7 @@ class PangeaMatch { bool get needsTranslation => match.rule?.id != null ? [ MatchRuleIds.tokenNeedsTranslation, - MatchRuleIds.tokenSpanNeedsTranslation + MatchRuleIds.tokenSpanNeedsTranslation, ].contains(match.rule!.id) : false; @@ -81,7 +81,7 @@ class PangeaMatch { Map toJson() => { _matchKey: match.toJson(), // _detectionsKey: detections.map((e) => e.toJson()).toList(), - _statusKey: _statusEnumToString(status) + _statusKey: _statusEnumToString(status), }; String get matchContent { @@ -99,7 +99,7 @@ class PangeaMatch { debugger(when: kDebugMode); ErrorHandler.logError( m: "match.offset + match.length > match.fullText.length", - data: match.toJson()); + data: match.toJson(),); } else { end = match.offset + match.length; } diff --git a/lib/pangea/models/pangea_text_tap.dart b/lib/pangea/models/pangea_text_tap.dart index d409f6e85..a96d56314 100644 --- a/lib/pangea/models/pangea_text_tap.dart +++ b/lib/pangea/models/pangea_text_tap.dart @@ -7,13 +7,13 @@ class PTextTapModel { {required this.cursorOffset, required this.isHighLighted, required this.textAtOffSet, - required this.word}); + required this.word,}); toJson() { return { 'cursorOffset': cursorOffset, 'word': word, 'isHighlighted': isHighLighted, - 'textAtOffSet': textAtOffSet + 'textAtOffSet': textAtOffSet, }; } } diff --git a/lib/pangea/models/pangea_token_model.dart b/lib/pangea/models/pangea_token_model.dart index 14497ab15..9174144e2 100644 --- a/lib/pangea/models/pangea_token_model.dart +++ b/lib/pangea/models/pangea_token_model.dart @@ -73,14 +73,14 @@ class PangeaTokenText { int length; PangeaTokenText( - {required this.offset, required this.content, required this.length}); + {required this.offset, required this.content, required this.length,}); factory PangeaTokenText.fromJson(Map json) { debugger(when: kDebugMode && json[_offsetKey] == null); return PangeaTokenText( offset: json[_offsetKey], content: json[_contentKey], - length: json[_lengthKey] ?? (json[_contentKey] as String).length); + length: json[_lengthKey] ?? (json[_contentKey] as String).length,); } static const String _offsetKey = "offset"; diff --git a/lib/pangea/models/span_data.dart b/lib/pangea/models/span_data.dart index af9edebe8..2d92e9318 100644 --- a/lib/pangea/models/span_data.dart +++ b/lib/pangea/models/span_data.dart @@ -111,7 +111,7 @@ class SpanChoice { value: json['value'] as String, type: json['type'] != null ? SpanChoiceType.values.firstWhereOrNull( - (element) => element.name == json['type']) ?? + (element) => element.name == json['type'],) ?? SpanChoiceType.bestCorrection : SpanChoiceType.bestCorrection, feedback: json['feedback'], diff --git a/lib/pangea/models/student_analytics_event.dart b/lib/pangea/models/student_analytics_event.dart index c6e8274a8..ea54706b1 100644 --- a/lib/pangea/models/student_analytics_event.dart +++ b/lib/pangea/models/student_analytics_event.dart @@ -112,7 +112,7 @@ class StudentAnalyticsEvent { } Future getTimeServiesInterval( - DateTime start, DateTime end, String? chatId) async { + DateTime start, DateTime end, String? chatId,) async { final TimeSeriesInterval interval = TimeSeriesInterval( start: start, end: end, diff --git a/lib/pangea/models/student_analytics_summary_model.dart b/lib/pangea/models/student_analytics_summary_model.dart index df13f3239..682768b28 100644 --- a/lib/pangea/models/student_analytics_summary_model.dart +++ b/lib/pangea/models/student_analytics_summary_model.dart @@ -85,7 +85,7 @@ class StudentAnalyticsSummary { Map toJson() => { _messagesKey: jsonEncode(_messages.map((e) => e.toJson()).toList()), - _lastUpdatedKey: lastUpdated.toIso8601String() + _lastUpdatedKey: lastUpdated.toIso8601String(), }; factory StudentAnalyticsSummary.fromJson(json) { diff --git a/lib/pangea/models/user_model.dart b/lib/pangea/models/user_model.dart index f1ee6feca..64beb375a 100644 --- a/lib/pangea/models/user_model.dart +++ b/lib/pangea/models/user_model.dart @@ -66,9 +66,9 @@ class Profile { factory Profile.fromJson(Map json) { final l2 = LanguageModel.codeFromNameOrCode( - json[ModelKey.l2LanguageKey] ?? LanguageKeys.unknownLanguage); + json[ModelKey.l2LanguageKey] ?? LanguageKeys.unknownLanguage,); final l1 = LanguageModel.codeFromNameOrCode( - json[ModelKey.l1LanguageKey] ?? LanguageKeys.unknownLanguage); + json[ModelKey.l1LanguageKey] ?? LanguageKeys.unknownLanguage,); return Profile( // fullName: json[ModelKey.userFullName], diff --git a/lib/pangea/models/user_profile_search_model.dart b/lib/pangea/models/user_profile_search_model.dart index 97a7e91c1..ae58cfdbb 100644 --- a/lib/pangea/models/user_profile_search_model.dart +++ b/lib/pangea/models/user_profile_search_model.dart @@ -1,5 +1,3 @@ -import 'dart:convert'; -import 'dart:developer'; import 'user_model.dart'; diff --git a/lib/pangea/models/widget_measurement.dart b/lib/pangea/models/widget_measurement.dart index 851abec62..20abf88c3 100644 --- a/lib/pangea/models/widget_measurement.dart +++ b/lib/pangea/models/widget_measurement.dart @@ -6,7 +6,7 @@ class WidgetMeasurements { static WidgetMeasurements defaultFromKey(String key) { if (_fromKey[key] == null) { _fromKey[key] = WidgetMeasurements( - position: const Offset(0, 0), size: const Size(0, 0), uid: key); + position: const Offset(0, 0), size: const Size(0, 0), uid: key,); } final WidgetMeasurements? weg = _fromKey[key]; @@ -17,7 +17,7 @@ class WidgetMeasurements { Size? size; String? uid; WidgetMeasurements( - {required this.position, required this.size, required this.uid}); + {required this.position, required this.size, required this.uid,}); toJson() => {'position': position, 'size': size, 'uid': uid}; } diff --git a/lib/pangea/network/p_api_exception.dart b/lib/pangea/network/p_api_exception.dart index 536e5d97b..8562e037c 100644 --- a/lib/pangea/network/p_api_exception.dart +++ b/lib/pangea/network/p_api_exception.dart @@ -1,4 +1,3 @@ -import 'dart:convert'; import 'package:flutter/foundation.dart'; @@ -20,7 +19,7 @@ class ApiException { debugPrint(statusCode.toString()); } PToastController.toastMsg( - msg: "Exception: Unauthorized access", success: false); + msg: "Exception: Unauthorized access", success: false,); return; case 403: @@ -29,7 +28,7 @@ class ApiException { debugPrint(statusCode.toString()); } PToastController.toastMsg( - msg: "Exception: Don't have permissions!", success: false); + msg: "Exception: Don't have permissions!", success: false,); return; case 500: if (kDebugMode) { @@ -37,7 +36,7 @@ class ApiException { debugPrint(statusCode.toString()); } PToastController.toastMsg( - msg: "Exception: Internal Server Error", success: false); + msg: "Exception: Internal Server Error", success: false,); return; case 502: if (kDebugMode) { @@ -45,7 +44,7 @@ class ApiException { debugPrint(statusCode.toString()); } PToastController.toastMsg( - msg: "Exception: Bad Gateway", success: false); + msg: "Exception: Bad Gateway", success: false,); return; case 503: @@ -54,7 +53,7 @@ class ApiException { debugPrint(statusCode.toString()); } PToastController.toastMsg( - msg: "Exception: Service Unavailable", success: false); + msg: "Exception: Service Unavailable", success: false,); return; case 504: @@ -63,7 +62,7 @@ class ApiException { debugPrint(statusCode.toString()); } PToastController.toastMsg( - msg: "Exception: Gateway timeout error!", success: false); + msg: "Exception: Gateway timeout error!", success: false,); return; default: @@ -72,7 +71,7 @@ class ApiException { debugPrint(statusCode.toString()); } PToastController.toastMsg( - msg: "Unknown exception accrued!", success: false); + msg: "Unknown exception accrued!", success: false,); return; } } diff --git a/lib/pangea/network/requests.dart b/lib/pangea/network/requests.dart index 241b84d41..42e8b2c66 100644 --- a/lib/pangea/network/requests.dart +++ b/lib/pangea/network/requests.dart @@ -15,10 +15,10 @@ class Requests { {this.accessToken, this.baseUrl = '', this.matrixAccessToken, - this.choreoApiKey}); + this.choreoApiKey,}); Future post( - {required String url, required Map body}) async { + {required String url, required Map body,}) async { dynamic encoded; encoded = jsonEncode(body); @@ -35,7 +35,7 @@ class Requests { } Future put( - {required String url, required Map body}) async { + {required String url, required Map body,}) async { dynamic encoded; encoded = jsonEncode(body); @@ -85,7 +85,7 @@ class Requests { } void handleError(http.Response response, - {Map? body, String? objectId}) { + {Map? body, String? objectId,}) { //PTODO - handle 401 error - unauthorized call //kick them back to login? diff --git a/lib/pangea/pages/analytics/analytics_list_tile.dart b/lib/pangea/pages/analytics/analytics_list_tile.dart index 0cf241a24..1120d31d5 100644 --- a/lib/pangea/pages/analytics/analytics_list_tile.dart +++ b/lib/pangea/pages/analytics/analytics_list_tile.dart @@ -14,7 +14,7 @@ import 'list_summary_analytics.dart'; class AnalyticsListTile extends StatelessWidget { const AnalyticsListTile({ - Key? key, + super.key, required this.model, required this.displayName, required this.avatar, @@ -23,7 +23,7 @@ class AnalyticsListTile extends StatelessWidget { required this.selected, required this.onTap, required this.allowNavigateOnSelect, - }) : super(key: key); + }); final Uri? avatar; final String displayName; diff --git a/lib/pangea/pages/analytics/bar_chart_card.dart b/lib/pangea/pages/analytics/bar_chart_card.dart index f68afb5e4..a81f3e5c5 100644 --- a/lib/pangea/pages/analytics/bar_chart_card.dart +++ b/lib/pangea/pages/analytics/bar_chart_card.dart @@ -4,12 +4,12 @@ import 'package:fl_chart/fl_chart.dart'; class BarChartCard extends StatelessWidget { const BarChartCard({ - Key? key, + super.key, required this.barChartTitle, required this.barChart, required this.legend, required this.loadingData, - }) : super(key: key); + }); final String barChartTitle; final BarChart? barChart; diff --git a/lib/pangea/pages/analytics/bar_chart_placeholder_data.dart b/lib/pangea/pages/analytics/bar_chart_placeholder_data.dart index 6dcb18a4f..11e5a2621 100644 --- a/lib/pangea/pages/analytics/bar_chart_placeholder_data.dart +++ b/lib/pangea/pages/analytics/bar_chart_placeholder_data.dart @@ -6,7 +6,7 @@ import '../../enum/use_type.dart'; class BarChartPlaceHolderData { static BarChartRodData randomBarChartRodData( - BuildContext context, int index) { + BuildContext context, int index,) { // final total = Random().nextInt(100); // final it = total != 0 ? Random().nextInt(max(total - index, 1)) : 0; // final igc = total != 0 ? Random().nextInt(max(total - it - index, 1)) : 0; @@ -54,7 +54,7 @@ class BarChartPlaceHolderData { 14, 15, 16, - 17 + 17, ]; final List barChartGroupData = []; @@ -75,7 +75,7 @@ class BarChartPlaceHolderData { } static List getData( - Color dark, Color normal, Color light) { + Color dark, Color normal, Color light,) { const double barSpace = 16; return [ diff --git a/lib/pangea/pages/analytics/base_analytics_page.dart b/lib/pangea/pages/analytics/base_analytics_page.dart index c96ccd19f..5f49b822c 100644 --- a/lib/pangea/pages/analytics/base_analytics_page.dart +++ b/lib/pangea/pages/analytics/base_analytics_page.dart @@ -27,14 +27,14 @@ class BaseAnalyticsPage extends StatefulWidget { final AnalyticsSelected? alwaysSelected; const BaseAnalyticsPage({ - Key? key, + super.key, required this.pageTitle, required this.tabData1, required this.tabData2, required this.defaultAnalyticsSelected, required this.refreshData, required this.alwaysSelected, - }) : super(key: key); + }); @override State createState() => BaseAnalyticsController(); @@ -53,7 +53,7 @@ class BaseAnalyticsController extends State { bool isSelected(String chatOrStudentId) => chatOrStudentId == selected?.id; ChartAnalyticsModel? chartData( - BuildContext context, AnalyticsSelected? selectedParam) { + BuildContext context, AnalyticsSelected? selectedParam,) { final AnalyticsSelected analyticsSelected = selectedParam ?? widget.defaultAnalyticsSelected; @@ -124,9 +124,9 @@ class BaseAnalyticsController extends State { class BaseAnalyticsView extends StatelessWidget { const BaseAnalyticsView({ - Key? key, + super.key, required this.controller, - }) : super(key: key); + }); final BaseAnalyticsController controller; @@ -163,7 +163,7 @@ class BaseAnalyticsView extends StatelessWidget { style: TextStyle( color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, - fontWeight: FontWeight.w700), + fontWeight: FontWeight.w700,), overflow: TextOverflow.clip, textAlign: TextAlign.center, ), @@ -231,7 +231,7 @@ class BaseAnalyticsView extends StatelessWidget { child: SizedBox( height: max( controller.widget.tabData1.items.length + 1, - controller.widget.tabData2.items.length) * + controller.widget.tabData2.items.length,) * 72, child: TabBarView( children: [ @@ -262,7 +262,7 @@ class BaseAnalyticsView extends StatelessWidget { .allowNavigateOnSelect, ), ) - .toList(), + , if (controller.widget.defaultAnalyticsSelected .type == AnalyticsEntryType.space) @@ -283,7 +283,7 @@ class BaseAnalyticsView extends StatelessWidget { .widget.defaultAnalyticsSelected.id, type: AnalyticsEntryType.privateChats, selected: controller.isSelected(controller - .widget.defaultAnalyticsSelected.id), + .widget.defaultAnalyticsSelected.id,), onTap: controller.toggleSelection, allowNavigateOnSelect: false, ), @@ -314,7 +314,7 @@ class BaseAnalyticsView extends StatelessWidget { ), ) .toList(), - ) + ), ], ), ), @@ -323,7 +323,7 @@ class BaseAnalyticsView extends StatelessWidget { ], ), ), - ) + ), ], ), ), @@ -341,7 +341,7 @@ class TabData { {required this.type, required this.items, required this.icon, - this.allowNavigateOnSelect = true}); + this.allowNavigateOnSelect = true,}); } class TabItem { diff --git a/lib/pangea/pages/analytics/chart_view_picker_button.dart b/lib/pangea/pages/analytics/chart_view_picker_button.dart index a3c4b93d0..01375ed6d 100644 --- a/lib/pangea/pages/analytics/chart_view_picker_button.dart +++ b/lib/pangea/pages/analytics/chart_view_picker_button.dart @@ -8,8 +8,7 @@ class ChartViewPickerButton extends StatelessWidget { final BarChartViewSelection selected; final void Function(BarChartViewSelection) onChange; const ChartViewPickerButton( - {Key? key, required this.selected, required this.onChange}) - : super(key: key); + {super.key, required this.selected, required this.onChange,}); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/analytics/class_analytics/class_analytics.dart b/lib/pangea/pages/analytics/class_analytics/class_analytics.dart index cea564d18..39acca938 100644 --- a/lib/pangea/pages/analytics/class_analytics/class_analytics.dart +++ b/lib/pangea/pages/analytics/class_analytics/class_analytics.dart @@ -22,7 +22,7 @@ enum AnalyticsPageType { classList, student, classDetails } class ClassAnalyticsPage extends StatefulWidget { // final AnalyticsPageType type; - const ClassAnalyticsPage({Key? key}) : super(key: key); + const ClassAnalyticsPage({super.key}); @override State createState() => ClassAnalyticsV2Controller(); diff --git a/lib/pangea/pages/analytics/class_analytics/class_analytics_view.dart b/lib/pangea/pages/analytics/class_analytics/class_analytics_view.dart index beb871571..014cac2d6 100644 --- a/lib/pangea/pages/analytics/class_analytics/class_analytics_view.dart +++ b/lib/pangea/pages/analytics/class_analytics/class_analytics_view.dart @@ -8,7 +8,7 @@ import 'class_analytics.dart'; class ClassAnalyticsView extends StatelessWidget { final ClassAnalyticsV2Controller controller; - const ClassAnalyticsView(this.controller, {Key? key}) : super(key: key); + const ClassAnalyticsView(this.controller, {super.key}); @override Widget build(BuildContext context) { @@ -37,7 +37,7 @@ class ClassAnalyticsView extends StatelessWidget { avatar: s.avatarUrl, displayName: s.displayName ?? "unknown", id: s.id, - )) + ),) .toList(), ); diff --git a/lib/pangea/pages/analytics/class_list/class_list.dart b/lib/pangea/pages/analytics/class_list/class_list.dart index 24c54d38b..7eb70ced3 100644 --- a/lib/pangea/pages/analytics/class_list/class_list.dart +++ b/lib/pangea/pages/analytics/class_list/class_list.dart @@ -14,7 +14,7 @@ import '../../../utils/sync_status_util_v2.dart'; import '../../../widgets/common/list_placeholder.dart'; class AnalyticsClassList extends StatefulWidget { - const AnalyticsClassList({Key? key}) : super(key: key); + const AnalyticsClassList({super.key}); @override State createState() => AnalyticsClassListController(); @@ -32,7 +32,7 @@ class AnalyticsClassListController extends State { Future.delayed(Duration.zero, () async { stateSub = pangeaController.matrixState.client.onRoomState.stream .where( - (event) => event.type == PangeaEventTypes.studentAnalyticsSummary) + (event) => event.type == PangeaEventTypes.studentAnalyticsSummary,) .listen(onStateUpdate); }); } diff --git a/lib/pangea/pages/analytics/class_list/class_list_view.dart b/lib/pangea/pages/analytics/class_list/class_list_view.dart index 99c6b0f26..ff9ae7d94 100644 --- a/lib/pangea/pages/analytics/class_list/class_list_view.dart +++ b/lib/pangea/pages/analytics/class_list/class_list_view.dart @@ -14,7 +14,7 @@ import 'class_list.dart'; class AnalyticsClassListView extends StatelessWidget { final AnalyticsClassListController controller; - const AnalyticsClassListView(this.controller, {Key? key}) : super(key: key); + const AnalyticsClassListView(this.controller, {super.key}); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/analytics/construct_cloud.dart b/lib/pangea/pages/analytics/construct_cloud.dart index 5ca2656e7..67bdb02c9 100644 --- a/lib/pangea/pages/analytics/construct_cloud.dart +++ b/lib/pangea/pages/analytics/construct_cloud.dart @@ -12,10 +12,10 @@ class ConstructCloud extends StatefulWidget { final AnalyticsSelected defaultSelected; const ConstructCloud({ - Key? key, + super.key, required this.selected, required this.defaultSelected, - }) : super(key: key); + }); @override State createState() => ConstructCloudState(); @@ -28,7 +28,7 @@ class ConstructCloudState extends State { {"word": "loading", 'value': 1}, {"word": "loading", 'value': 1}, {"word": "loading", 'value': 1}, - {"word": "loading", 'value': 1} + {"word": "loading", 'value': 1}, ]; @override @@ -77,7 +77,7 @@ class ConstructCloudState extends State { colorlist: const [ Colors.black, Colors.redAccent, - Colors.indigoAccent + Colors.indigoAccent, ], ), const SizedBox( @@ -93,7 +93,7 @@ class ConstructCloudState extends State { colorlist: const [ Colors.black, Colors.redAccent, - Colors.indigoAccent + Colors.indigoAccent, ], ), ], diff --git a/lib/pangea/pages/analytics/construct_list.dart b/lib/pangea/pages/analytics/construct_list.dart index 8cda4b4b2..2128c827f 100644 --- a/lib/pangea/pages/analytics/construct_list.dart +++ b/lib/pangea/pages/analytics/construct_list.dart @@ -20,12 +20,12 @@ class ConstructList extends StatefulWidget { final String title; const ConstructList({ - Key? key, + super.key, required this.selected, required this.defaultSelected, required this.constructType, required this.title, - }) : super(key: key); + }); @override State createState() => ConstructListState(); @@ -147,10 +147,10 @@ class ConstructListView extends StatelessWidget { final bool init; const ConstructListView({ - Key? key, + super.key, required this.constructs, required this.init, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/analytics/list_summary_analytics.dart b/lib/pangea/pages/analytics/list_summary_analytics.dart index f98eac68e..0f43a028d 100644 --- a/lib/pangea/pages/analytics/list_summary_analytics.dart +++ b/lib/pangea/pages/analytics/list_summary_analytics.dart @@ -10,7 +10,7 @@ import '../../enum/use_type.dart'; class ListSummaryAnalytics extends StatelessWidget { final ChartAnalyticsModel? chartAnalytics; - const ListSummaryAnalytics({Key? key, this.chartAnalytics}) : super(key: key); + const ListSummaryAnalytics({super.key, this.chartAnalytics}); TimeSeriesTotals? get totals => chartAnalytics?.totals; @@ -63,7 +63,7 @@ class ListSummaryAnalytics extends StatelessWidget { Icons.chat_bubble, totals!.all, Theme.of(context).textTheme.bodyLarge!.color, - false), + false,), if (totals!.all != 0) ...[ spacerIconText( l10n != null ? l10n.taTooltip : "With translation assistance", @@ -93,7 +93,7 @@ class ListSummaryAnalytics extends StatelessWidget { totals!.unPercent, UseType.un.color(context), ), - ] + ], ], ), ); diff --git a/lib/pangea/pages/analytics/messages_bar_chart.dart b/lib/pangea/pages/analytics/messages_bar_chart.dart index 9f0c280ea..b51ecc72a 100644 --- a/lib/pangea/pages/analytics/messages_bar_chart.dart +++ b/lib/pangea/pages/analytics/messages_bar_chart.dart @@ -19,8 +19,7 @@ class MessagesBarChart extends StatefulWidget { final String barChartTitle; const MessagesBarChart( - {Key? key, required this.chartAnalytics, required this.barChartTitle}) - : super(key: key); + {super.key, required this.chartAnalytics, required this.barChartTitle,}); @override State createState() => MessagesBarChartState(); @@ -182,7 +181,7 @@ class MessagesBarChartState extends State { } bool isInSameGroup( - TimeSeriesInterval? t1, TimeSeriesInterval t2, TimeSpan timeSpan) { + TimeSeriesInterval? t1, TimeSeriesInterval t2, TimeSpan timeSpan,) { final DateTime? date1 = t1?.end; final DateTime date2 = t2.end; if (timeSpan == TimeSpan.sixmonths || timeSpan == TimeSpan.year) { @@ -236,7 +235,7 @@ class MessagesBarChartState extends State { barsSpace: barSpace, // barRods: intervalGroup.map(constructBarChartRodData).toList(), barRods: constructBarChartRodData(intervalGroup), - )); + ),); }); return chartData; } @@ -259,7 +258,7 @@ class MessagesBarChartState extends State { // } List constructBarChartRodData( - List timeSeriesIntervalGroup) { + List timeSeriesIntervalGroup,) { int y1 = 0; int y2 = 0; int y3 = 0; @@ -277,14 +276,14 @@ class MessagesBarChartState extends State { rodStackItems: [ BarChartRodStackItem(0, y1.toDouble(), UseType.ta.color(context)), BarChartRodStackItem( - y1.toDouble(), y2.toDouble(), UseType.ga.color(context)), + y1.toDouble(), y2.toDouble(), UseType.ga.color(context),), BarChartRodStackItem( - y2.toDouble(), y3.toDouble(), UseType.wa.color(context)), + y2.toDouble(), y3.toDouble(), UseType.wa.color(context),), BarChartRodStackItem( - y3.toDouble(), y4.toDouble(), UseType.un.color(context)), + y3.toDouble(), y4.toDouble(), UseType.un.color(context),), ], borderRadius: BorderRadius.zero, - ) + ), ]; } diff --git a/lib/pangea/pages/analytics/messages_legend_widget.dart b/lib/pangea/pages/analytics/messages_legend_widget.dart index 1ee63a3c3..ce1337519 100644 --- a/lib/pangea/pages/analytics/messages_legend_widget.dart +++ b/lib/pangea/pages/analytics/messages_legend_widget.dart @@ -4,8 +4,8 @@ import 'package:fluffychat/pangea/enum/use_type.dart'; class MessagesLegendsListWidget extends StatelessWidget { const MessagesLegendsListWidget({ - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { @@ -26,7 +26,7 @@ class MessagesLegendsListWidget extends StatelessWidget { ), ), const SizedBox(width: 4), - e.iconView(context, e.color(context), 20) + e.iconView(context, e.color(context), 20), ], ), ) diff --git a/lib/pangea/pages/analytics/student_analytics/student_analytics.dart b/lib/pangea/pages/analytics/student_analytics/student_analytics.dart index 229a505d9..f27cea5d1 100644 --- a/lib/pangea/pages/analytics/student_analytics/student_analytics.dart +++ b/lib/pangea/pages/analytics/student_analytics/student_analytics.dart @@ -16,7 +16,7 @@ import '../base_analytics_page.dart'; import 'student_analytics_view.dart'; class StudentAnalyticsPage extends StatefulWidget { - const StudentAnalyticsPage({Key? key}) : super(key: key); + const StudentAnalyticsPage({super.key}); @override State createState() => StudentAnalyticsController(); @@ -31,7 +31,7 @@ class StudentAnalyticsController extends State { void initState() { _pangeaController.matrixState.client .updateMyLearningAnalyticsForAllClassesImIn( - _pangeaController.pStoreService); + _pangeaController.pStoreService,); super.initState(); } diff --git a/lib/pangea/pages/analytics/student_analytics/student_analytics_view.dart b/lib/pangea/pages/analytics/student_analytics/student_analytics_view.dart index 30572deb6..91539c5bb 100644 --- a/lib/pangea/pages/analytics/student_analytics/student_analytics_view.dart +++ b/lib/pangea/pages/analytics/student_analytics/student_analytics_view.dart @@ -9,7 +9,7 @@ import 'student_analytics.dart'; class StudentAnalyticsView extends StatelessWidget { final StudentAnalyticsController controller; - const StudentAnalyticsView(this.controller, {Key? key}) : super(key: key); + const StudentAnalyticsView(this.controller, {super.key}); @override Widget build(BuildContext context) { @@ -26,7 +26,7 @@ class StudentAnalyticsView extends StatelessWidget { displayName: c.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)), id: c.id, - )) + ),) .toList(), allowNavigateOnSelect: false, ); @@ -39,9 +39,9 @@ class StudentAnalyticsView extends StatelessWidget { displayName: c .getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)), id: c.id, - )) + ),) .toList(), - allowNavigateOnSelect: false); + allowNavigateOnSelect: false,); return controller.userId != null ? BaseAnalyticsPage( @@ -51,12 +51,12 @@ class StudentAnalyticsView extends StatelessWidget { defaultAnalyticsSelected: AnalyticsSelected( controller.userId!, AnalyticsEntryType.student, - L10n.of(context)!.allChatsAndClasses), + L10n.of(context)!.allChatsAndClasses,), refreshData: controller.getClassAndChatAnalytics, alwaysSelected: AnalyticsSelected( controller.userId!, AnalyticsEntryType.student, - L10n.of(context)!.allChatsAndClasses), + L10n.of(context)!.allChatsAndClasses,), ) : const SizedBox(); } diff --git a/lib/pangea/pages/analytics/time_span_menu_button.dart b/lib/pangea/pages/analytics/time_span_menu_button.dart index 1ac5fe96a..895cef1f7 100644 --- a/lib/pangea/pages/analytics/time_span_menu_button.dart +++ b/lib/pangea/pages/analytics/time_span_menu_button.dart @@ -8,8 +8,7 @@ class TimeSpanMenuButton extends StatelessWidget { final TimeSpan value; final void Function(TimeSpan) onChange; const TimeSpanMenuButton( - {Key? key, required this.value, required this.onChange}) - : super(key: key); + {super.key, required this.value, required this.onChange,}); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/analytics/vocab_bar_chart.dart b/lib/pangea/pages/analytics/vocab_bar_chart.dart index 2a5f216c1..9bc0efc69 100644 --- a/lib/pangea/pages/analytics/vocab_bar_chart.dart +++ b/lib/pangea/pages/analytics/vocab_bar_chart.dart @@ -14,10 +14,10 @@ class VocabBarChart extends StatefulWidget { final AnalyticsSelected defaultSelected; const VocabBarChart({ - Key? key, + super.key, required this.selected, required this.defaultSelected, - }) : super(key: key); + }); @override State createState() => VocabBarChartState(); @@ -145,7 +145,7 @@ class VocabBarChartState extends State { barsSpace: barSpace, // barRods: intervalGroup.map(constructBarChartRodData).toList(), barRods: constructBarChartRodData(intervalGroup), - )); + ),); }); return chartData; } @@ -166,7 +166,7 @@ class VocabBarChartState extends State { BarChartRodStackItem(y2.toDouble(), y3.toDouble(), Colors.green), ], borderRadius: BorderRadius.zero, - ) + ), ]; } } diff --git a/lib/pangea/pages/analytics/vocab_legend_widget.dart b/lib/pangea/pages/analytics/vocab_legend_widget.dart index 433d4727b..da6413c3e 100644 --- a/lib/pangea/pages/analytics/vocab_legend_widget.dart +++ b/lib/pangea/pages/analytics/vocab_legend_widget.dart @@ -4,8 +4,8 @@ import 'package:fluffychat/pangea/enum/use_type.dart'; class VocabLegendsListWidget extends StatelessWidget { const VocabLegendsListWidget({ - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { @@ -26,7 +26,7 @@ class VocabLegendsListWidget extends StatelessWidget { ), ), const SizedBox(width: 4), - e.iconView(context, e.color(context), 20) + e.iconView(context, e.color(context), 20), ], ), ) diff --git a/lib/pangea/pages/class_analytics/measure_able.dart b/lib/pangea/pages/class_analytics/measure_able.dart index 8e689b628..444997995 100644 --- a/lib/pangea/pages/class_analytics/measure_able.dart +++ b/lib/pangea/pages/class_analytics/measure_able.dart @@ -7,8 +7,7 @@ class MeasurableWidget extends StatefulWidget { Function? triggerMeasure; final Function(Size? size, Offset? position) onChange; - MeasurableWidget({Key? key, required this.onChange, required this.child}) - : super(key: key); + MeasurableWidget({super.key, required this.onChange, required this.child}); @override _WidgetSizeState createState() => _WidgetSizeState(); diff --git a/lib/pangea/pages/class_invitation_selection/class_invitation_selection.dart b/lib/pangea/pages/class_invitation_selection/class_invitation_selection.dart index 0c2ff63c5..fad4e6b53 100644 --- a/lib/pangea/pages/class_invitation_selection/class_invitation_selection.dart +++ b/lib/pangea/pages/class_invitation_selection/class_invitation_selection.dart @@ -12,7 +12,7 @@ import 'package:matrix/matrix.dart'; import 'package:fluffychat/widgets/matrix.dart'; class ClassInvitationSelection extends StatefulWidget { - const ClassInvitationSelection({Key? key}) : super(key: key); + const ClassInvitationSelection({super.key}); @override ClassInvitationSelectionController createState() => diff --git a/lib/pangea/pages/class_settings/class_name_header.dart b/lib/pangea/pages/class_settings/class_name_header.dart index 792cac565..59add8b59 100644 --- a/lib/pangea/pages/class_settings/class_name_header.dart +++ b/lib/pangea/pages/class_settings/class_name_header.dart @@ -10,10 +10,10 @@ class ClassNameHeader extends StatelessWidget { final Room room; final ChatDetailsController controller; const ClassNameHeader({ - Key? key, + super.key, required this.room, required this.controller, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -34,7 +34,7 @@ class ClassNameHeader extends StatelessWidget { icon: room.nameAndRoomTypeIcon(TextStyle( fontSize: 20, color: Theme.of(context).textTheme.bodyLarge!.color, - )), + ),), // icon: Text( // room.getLocalizedDisplayname( // MatrixLocals(L10n.of(context)!), diff --git a/lib/pangea/pages/class_settings/class_settings_page.dart b/lib/pangea/pages/class_settings/class_settings_page.dart index 4d8db9cde..d0c2d385d 100644 --- a/lib/pangea/pages/class_settings/class_settings_page.dart +++ b/lib/pangea/pages/class_settings/class_settings_page.dart @@ -18,7 +18,7 @@ import 'class_settings_view.dart'; import 'p_class_widgets/room_rules_editor.dart'; class ClassSettingsPage extends StatefulWidget { - const ClassSettingsPage({Key? key}) : super(key: key); + const ClassSettingsPage({super.key}); @override State createState() => ClassSettingsController(); diff --git a/lib/pangea/pages/class_settings/class_settings_view.dart b/lib/pangea/pages/class_settings/class_settings_view.dart index f4fca0e18..f6fa434e9 100644 --- a/lib/pangea/pages/class_settings/class_settings_view.dart +++ b/lib/pangea/pages/class_settings/class_settings_view.dart @@ -11,8 +11,7 @@ import '../../../widgets/layouts/max_width_body.dart'; class ClassSettingsPageView extends StatelessWidget { final ClassSettingsController controller; - const ClassSettingsPageView({Key? key, required this.controller}) - : super(key: key); + const ClassSettingsPageView({super.key, required this.controller}); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/class_settings/p_class_widgets/class_analytics_button.dart b/lib/pangea/pages/class_settings/p_class_widgets/class_analytics_button.dart index bcb11d030..1ac293494 100644 --- a/lib/pangea/pages/class_settings/p_class_widgets/class_analytics_button.dart +++ b/lib/pangea/pages/class_settings/p_class_widgets/class_analytics_button.dart @@ -4,7 +4,7 @@ import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:go_router/go_router.dart'; class ClassAnalyticsButton extends StatelessWidget { - const ClassAnalyticsButton({Key? key}) : super(key: key); + const ClassAnalyticsButton({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/class_settings/p_class_widgets/class_description_button.dart b/lib/pangea/pages/class_settings/p_class_widgets/class_description_button.dart index dba874cfc..0d6779e82 100644 --- a/lib/pangea/pages/class_settings/p_class_widgets/class_description_button.dart +++ b/lib/pangea/pages/class_settings/p_class_widgets/class_description_button.dart @@ -9,10 +9,10 @@ class ClassDescriptionButton extends StatelessWidget { final Room room; final ChatDetailsController controller; const ClassDescriptionButton({ - Key? key, + super.key, required this.room, required this.controller, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/class_settings/p_class_widgets/class_details_toggle_add_students_tile.dart b/lib/pangea/pages/class_settings/p_class_widgets/class_details_toggle_add_students_tile.dart index 134f86256..2dda34532 100644 --- a/lib/pangea/pages/class_settings/p_class_widgets/class_details_toggle_add_students_tile.dart +++ b/lib/pangea/pages/class_settings/p_class_widgets/class_details_toggle_add_students_tile.dart @@ -6,9 +6,9 @@ import '../../../../pages/chat_details/chat_details.dart'; class SpaceDetailsToggleAddStudentsTile extends StatelessWidget { const SpaceDetailsToggleAddStudentsTile({ - Key? key, + super.key, required this.controller, - }) : super(key: key); + }); final ChatDetailsController controller; @@ -31,7 +31,7 @@ class SpaceDetailsToggleAddStudentsTile extends StatelessWidget { ), trailing: Icon(controller.displayAddStudentOptions ? Icons.keyboard_arrow_down_outlined - : Icons.keyboard_arrow_right_outlined), + : Icons.keyboard_arrow_right_outlined,), onTap: controller.toggleAddStudentOptions, ); } diff --git a/lib/pangea/pages/class_settings/p_class_widgets/class_invitation_buttons.dart b/lib/pangea/pages/class_settings/p_class_widgets/class_invitation_buttons.dart index e4741ac45..8c1cb0a6c 100644 --- a/lib/pangea/pages/class_settings/p_class_widgets/class_invitation_buttons.dart +++ b/lib/pangea/pages/class_settings/p_class_widgets/class_invitation_buttons.dart @@ -16,8 +16,7 @@ import '../../../../widgets/avatar.dart'; class ClassInvitationButtons extends StatelessWidget { final String roomId; - const ClassInvitationButtons({Key? key, required this.roomId}) - : super(key: key); + const ClassInvitationButtons({super.key, required this.roomId}); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/class_settings/p_class_widgets/class_name_button.dart b/lib/pangea/pages/class_settings/p_class_widgets/class_name_button.dart index 189462303..7d4229e90 100644 --- a/lib/pangea/pages/class_settings/p_class_widgets/class_name_button.dart +++ b/lib/pangea/pages/class_settings/p_class_widgets/class_name_button.dart @@ -10,10 +10,10 @@ class ClassNameButton extends StatelessWidget { final Room room; final ChatDetailsController controller; const ClassNameButton({ - Key? key, + super.key, required this.room, required this.controller, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/class_settings/p_class_widgets/class_settings_button.dart b/lib/pangea/pages/class_settings/p_class_widgets/class_settings_button.dart index 3d144766d..3915d0ca0 100644 --- a/lib/pangea/pages/class_settings/p_class_widgets/class_settings_button.dart +++ b/lib/pangea/pages/class_settings/p_class_widgets/class_settings_button.dart @@ -4,7 +4,7 @@ import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:go_router/go_router.dart'; class ClassSettingsButton extends StatelessWidget { - const ClassSettingsButton({Key? key}) : super(key: key); + const ClassSettingsButton({super.key}); // final PangeaController _pangeaController = MatrixState.pangeaController; diff --git a/lib/pangea/pages/class_settings/p_class_widgets/class_show_edit_dialog.dart b/lib/pangea/pages/class_settings/p_class_widgets/class_show_edit_dialog.dart index 07dbb6a03..ed224647b 100644 --- a/lib/pangea/pages/class_settings/p_class_widgets/class_show_edit_dialog.dart +++ b/lib/pangea/pages/class_settings/p_class_widgets/class_show_edit_dialog.dart @@ -18,7 +18,7 @@ void showEditFieldDialog(BuildContext context, String title) async { // initialText: room.topic, minLines: 1, maxLines: 4, - ) + ), ], ); if (input == null) return; @@ -29,6 +29,6 @@ void showEditFieldDialog(BuildContext context, String title) async { ); if (success.error == null) { ScaffoldMessenger.of(context).showSnackBar(SnackBar( - content: Text(L10n.of(context)!.groupDescriptionHasBeenChanged))); + content: Text(L10n.of(context)!.groupDescriptionHasBeenChanged),),); } } diff --git a/lib/pangea/pages/class_settings/p_class_widgets/room_rules_editor.dart b/lib/pangea/pages/class_settings/p_class_widgets/room_rules_editor.dart index afe696658..cdef3f047 100644 --- a/lib/pangea/pages/class_settings/p_class_widgets/room_rules_editor.dart +++ b/lib/pangea/pages/class_settings/p_class_widgets/room_rules_editor.dart @@ -16,8 +16,7 @@ class RoomRulesEditor extends StatefulWidget { final bool showAdd; const RoomRulesEditor( - {Key? key, this.roomId, this.startOpen = true, this.showAdd = false}) - : super(key: key); + {super.key, this.roomId, this.startOpen = true, this.showAdd = false,}); @override RoomRulesState createState() => RoomRulesState(); @@ -158,14 +157,14 @@ class RoomRulesState extends State { onChanged: (value) { updatePermission(() { rules.setLanguageToolSetting( - setting, value.toInt()); + setting, value.toInt(),); }); }, divisions: 2, max: 2, min: 0, label: rules.languageToolPermissionsText( - context, setting), + context, setting,), ), ), ], diff --git a/lib/pangea/pages/connect/p_sso_button.dart b/lib/pangea/pages/connect/p_sso_button.dart index b784013bf..835d0454e 100644 --- a/lib/pangea/pages/connect/p_sso_button.dart +++ b/lib/pangea/pages/connect/p_sso_button.dart @@ -19,10 +19,10 @@ class PangeaSsoButton extends StatelessWidget { final IdentityProvider identityProvider; final void Function()? onPressed; const PangeaSsoButton({ - Key? key, + super.key, required this.identityProvider, this.onPressed, - }) : super(key: key); + }); ButtonInfo getButtonInfo(BuildContext context) { switch (identityProvider.id) { diff --git a/lib/pangea/pages/exchange/add_exchange_to_class.dart b/lib/pangea/pages/exchange/add_exchange_to_class.dart index 87f00e1c5..eb5e7d59a 100644 --- a/lib/pangea/pages/exchange/add_exchange_to_class.dart +++ b/lib/pangea/pages/exchange/add_exchange_to_class.dart @@ -8,7 +8,7 @@ import 'package:fluffychat/pangea/widgets/class/add_space_toggles.dart'; import 'package:fluffychat/widgets/matrix.dart'; class AddExchangeToClass extends StatefulWidget { - const AddExchangeToClass({Key? key}) : super(key: key); + const AddExchangeToClass({super.key}); @override AddExchangeToClassState createState() => AddExchangeToClassState(); diff --git a/lib/pangea/pages/find_partner/find_partner.dart b/lib/pangea/pages/find_partner/find_partner.dart index 3882eece0..18fc71307 100644 --- a/lib/pangea/pages/find_partner/find_partner.dart +++ b/lib/pangea/pages/find_partner/find_partner.dart @@ -11,7 +11,7 @@ import '../../repo/user_repo.dart'; import 'find_partner_view.dart'; class FindPartner extends StatefulWidget { - const FindPartner({Key? key}) : super(key: key); + const FindPartner({super.key}); @override State createState() => FindPartnerController(); diff --git a/lib/pangea/pages/find_partner/find_partner_view.dart b/lib/pangea/pages/find_partner/find_partner_view.dart index ff2e8ed59..bbb163a69 100644 --- a/lib/pangea/pages/find_partner/find_partner_view.dart +++ b/lib/pangea/pages/find_partner/find_partner_view.dart @@ -17,7 +17,7 @@ import 'find_partner.dart'; class FindPartnerView extends StatelessWidget { final FindPartnerController controller; - const FindPartnerView(this.controller, {Key? key}) : super(key: key); + const FindPartnerView(this.controller, {super.key}); @override Widget build(BuildContext context) { @@ -124,9 +124,9 @@ class FindPartnerView extends StatelessWidget { class ExpandedContainer extends StatelessWidget { const ExpandedContainer({ - Key? key, + super.key, required this.body, - }) : super(key: key); + }); final Widget body; @@ -143,9 +143,9 @@ class ExpandedContainer extends StatelessWidget { class ProfileSearchTextField extends StatelessWidget { const ProfileSearchTextField({ - Key? key, + super.key, required this.controller, - }) : super(key: key); + }); final FindPartnerController controller; @@ -172,8 +172,8 @@ class ProfileSearchTextField extends StatelessWidget { class PageTitleText extends StatelessWidget { const PageTitleText({ - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { @@ -194,10 +194,10 @@ class PageTitleText extends StatelessWidget { class LanguageSelectionRow extends StatelessWidget { const LanguageSelectionRow({ - Key? key, + super.key, required this.controller, required this.isSource, - }) : super(key: key); + }); final FindPartnerController controller; final bool isSource; @@ -245,10 +245,10 @@ class UserProfileEntry extends StatelessWidget { final FindPartnerController controller; const UserProfileEntry({ - Key? key, + super.key, required this.pangeaProfile, required this.controller, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/new_class/new_class.dart b/lib/pangea/pages/new_class/new_class.dart index 5d05c990c..55b7d083d 100644 --- a/lib/pangea/pages/new_class/new_class.dart +++ b/lib/pangea/pages/new_class/new_class.dart @@ -18,7 +18,7 @@ import '../../widgets/space/class_settings.dart'; import '../class_settings/p_class_widgets/room_rules_editor.dart'; class NewClass extends StatefulWidget { - const NewClass({Key? key}) : super(key: key); + const NewClass({super.key}); @override NewClassController createState() => NewClassController(); diff --git a/lib/pangea/pages/new_class/new_class_view.dart b/lib/pangea/pages/new_class/new_class_view.dart index fa3e5391d..13796e2d8 100644 --- a/lib/pangea/pages/new_class/new_class_view.dart +++ b/lib/pangea/pages/new_class/new_class_view.dart @@ -15,7 +15,7 @@ class NewSpaceView extends StatelessWidget { final NewClassController controller; // Pangea# - const NewSpaceView(this.controller, {Key? key}) : super(key: key); + const NewSpaceView(this.controller, {super.key}); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/p_user_age/p_user_age.dart b/lib/pangea/pages/p_user_age/p_user_age.dart index c28a0a1a3..415379309 100644 --- a/lib/pangea/pages/p_user_age/p_user_age.dart +++ b/lib/pangea/pages/p_user_age/p_user_age.dart @@ -16,7 +16,7 @@ import '../../utils/bot_name.dart'; import '../../utils/error_handler.dart'; class PUserAge extends StatefulWidget { - const PUserAge({Key? key}) : super(key: key); + const PUserAge({super.key}); @override PUserAgeController createState() => PUserAgeController(); diff --git a/lib/pangea/pages/p_user_age/p_user_age_view.dart b/lib/pangea/pages/p_user_age/p_user_age_view.dart index 3b4472971..dd0b16a95 100644 --- a/lib/pangea/pages/p_user_age/p_user_age_view.dart +++ b/lib/pangea/pages/p_user_age/p_user_age_view.dart @@ -8,7 +8,7 @@ import '../../../widgets/layouts/login_scaffold.dart'; class PUserAgeView extends StatelessWidget { final PUserAgeController controller; - const PUserAgeView(this.controller, {Key? key}) : super(key: key); + const PUserAgeView(this.controller, {super.key}); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/settings_learning/settings_learning.dart b/lib/pangea/pages/settings_learning/settings_learning.dart index f0c648d58..f699fc7b5 100644 --- a/lib/pangea/pages/settings_learning/settings_learning.dart +++ b/lib/pangea/pages/settings_learning/settings_learning.dart @@ -7,7 +7,7 @@ import 'package:fluffychat/pangea/pages/settings_learning/settings_learning_view import 'package:fluffychat/widgets/matrix.dart'; class SettingsLearning extends StatefulWidget { - const SettingsLearning({Key? key}) : super(key: key); + const SettingsLearning({super.key}); @override SettingsLearningController createState() => SettingsLearningController(); diff --git a/lib/pangea/pages/settings_learning/settings_learning_view.dart b/lib/pangea/pages/settings_learning/settings_learning_view.dart index fa9df6264..657ee0770 100644 --- a/lib/pangea/pages/settings_learning/settings_learning_view.dart +++ b/lib/pangea/pages/settings_learning/settings_learning_view.dart @@ -14,7 +14,7 @@ import '../../../config/app_config.dart'; class SettingsLearningView extends StatelessWidget { final SettingsLearningController controller; - const SettingsLearningView(this.controller, {Key? key}) : super(key: key); + const SettingsLearningView(this.controller, {super.key}); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/settings_subscription/settings_subscription.dart b/lib/pangea/pages/settings_subscription/settings_subscription.dart index bec0098ff..349e3eade 100644 --- a/lib/pangea/pages/settings_subscription/settings_subscription.dart +++ b/lib/pangea/pages/settings_subscription/settings_subscription.dart @@ -13,7 +13,7 @@ import 'package:fluffychat/pangea/utils/subscription_app_id.dart'; import 'package:fluffychat/widgets/matrix.dart'; class SubscriptionManagement extends StatefulWidget { - const SubscriptionManagement({Key? key}) : super(key: key); + const SubscriptionManagement({super.key}); @override SubscriptionManagementController createState() => diff --git a/lib/pangea/pages/settings_subscription/settings_subscription_view.dart b/lib/pangea/pages/settings_subscription/settings_subscription_view.dart index dd9c62ddc..708bd8d66 100644 --- a/lib/pangea/pages/settings_subscription/settings_subscription_view.dart +++ b/lib/pangea/pages/settings_subscription/settings_subscription_view.dart @@ -13,7 +13,7 @@ import 'package:fluffychat/widgets/matrix.dart'; class SettingsSubscriptionView extends StatelessWidget { final SubscriptionManagementController controller; final PangeaController pangeaController = MatrixState.pangeaController; - SettingsSubscriptionView(this.controller, {Key? key}) : super(key: key); + SettingsSubscriptionView(this.controller, {super.key}); @override Widget build(BuildContext context) { @@ -84,7 +84,7 @@ class SettingsSubscriptionView extends StatelessWidget { controller: controller, subscriptionController: pangeaController.subscriptionController, - ) + ), ], ), ), @@ -100,8 +100,8 @@ class ManagementNotAvailableWarning extends StatelessWidget { const ManagementNotAvailableWarning({ required this.controller, required this.subscriptionController, - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { diff --git a/lib/pangea/pages/sign_up/signup.dart b/lib/pangea/pages/sign_up/signup.dart index 16e8c2bdf..33c4b1788 100644 --- a/lib/pangea/pages/sign_up/signup.dart +++ b/lib/pangea/pages/sign_up/signup.dart @@ -10,7 +10,7 @@ import 'package:fluffychat/utils/platform_infos.dart'; import 'package:fluffychat/widgets/matrix.dart'; class SignupPage extends StatefulWidget { - const SignupPage({Key? key}) : super(key: key); + const SignupPage({super.key}); @override SignupPageController createState() => SignupPageController(); diff --git a/lib/pangea/repo/class_analytics_repo.dart b/lib/pangea/repo/class_analytics_repo.dart index 20152df7f..081be29f6 100644 --- a/lib/pangea/repo/class_analytics_repo.dart +++ b/lib/pangea/repo/class_analytics_repo.dart @@ -16,7 +16,7 @@ class PClassAnalyticsRepo { String accessToken, String timeSpan, {List? classIds, List? userIds, - List? chatIds}) async { + List? chatIds,}) async { // if (!AnalyticsUtil.isValidSpan(timeSpan)) throw "Invalid span"; // final Requests req = Requests( diff --git a/lib/pangea/repo/class_repo.dart b/lib/pangea/repo/class_repo.dart index 295d4389b..139a1323e 100644 --- a/lib/pangea/repo/class_repo.dart +++ b/lib/pangea/repo/class_repo.dart @@ -31,7 +31,7 @@ class PClassRepo { //Question for Lala: In this widget, controller, repo framework, where are // errors handled? How are they passed? static Future getClassByCode( - String classCode, String accessToken) async { + String classCode, String accessToken,) async { final Requests req = Requests(baseUrl: PApiUrls.baseAPI, accessToken: accessToken); final Response res = @@ -50,7 +50,7 @@ class PClassRepo { static searchClass(String text) async {} static sendEmailToJoinClass(List data, String roomId, - String teacherName) async {} + String teacherName,) async {} static inviteAction(BuildContext context, String id, String roomId) async {} diff --git a/lib/pangea/repo/contextualized_translation_repo.dart b/lib/pangea/repo/contextualized_translation_repo.dart index 8561cde5a..377fac802 100644 --- a/lib/pangea/repo/contextualized_translation_repo.dart +++ b/lib/pangea/repo/contextualized_translation_repo.dart @@ -96,7 +96,7 @@ class ContextTranslationResponseModel { Sentry.addBreadcrumb( Breadcrumb( message: "ContextTranslationResponseModel with empty translations", - data: {"response": json}), + data: {"response": json},), ); } diff --git a/lib/pangea/repo/exchange_repo.dart b/lib/pangea/repo/exchange_repo.dart index 97bd9ed74..a4476e773 100644 --- a/lib/pangea/repo/exchange_repo.dart +++ b/lib/pangea/repo/exchange_repo.dart @@ -8,7 +8,7 @@ class PExchangeRepo { String requestToClass, String requestTeacher, String requestToClassAuthor, - String exchangePangeaId) async {} + String exchangePangeaId,) async {} static exchangeRejectRequest(String roomId, String teacherName) async {} @@ -26,5 +26,5 @@ class PExchangeRepo { }) async {} static isExchange( - BuildContext context, String accessToken, String exchangeId) async {} + BuildContext context, String accessToken, String exchangeId,) async {} } diff --git a/lib/pangea/repo/full_text_translation_repo.dart b/lib/pangea/repo/full_text_translation_repo.dart index 4be05da57..a781b4b0d 100644 --- a/lib/pangea/repo/full_text_translation_repo.dart +++ b/lib/pangea/repo/full_text_translation_repo.dart @@ -55,7 +55,7 @@ class FullTextTranslationRequestModel { ModelKey.tgtLang: tgtLang, ModelKey.userL2: userL2, ModelKey.userL1: userL1, - ModelKey.deepL: deepL + ModelKey.deepL: deepL, }; } diff --git a/lib/pangea/repo/igc_repo.dart b/lib/pangea/repo/igc_repo.dart index 9c1948466..00e7ac64a 100644 --- a/lib/pangea/repo/igc_repo.dart +++ b/lib/pangea/repo/igc_repo.dart @@ -15,7 +15,7 @@ import '../network/urls.dart'; class IgcRepo { static Future getIGC(String? accessToken, - {required IGCRequestBody igcRequest}) async { + {required IGCRequestBody igcRequest,}) async { final Requests req = Requests( accessToken: accessToken, choreoApiKey: Environment.choreoApiKey, @@ -52,19 +52,19 @@ class IgcRepo { PangeaToken( text: PangeaTokenText(content: "a", offset: 8, length: 1), hasInfo: false, - lemmas: []), + lemmas: [],), PangeaToken( text: PangeaTokenText(content: "sample", offset: 10, length: 6), hasInfo: false, - lemmas: []), + lemmas: [],), PangeaToken( text: PangeaTokenText(content: "text", offset: 17, length: 4), hasInfo: false, - lemmas: []), + lemmas: [],), ], matches: [ PangeaMatch( - match: spanDataRepomockSpan, status: PangeaMatchStatus.open), + match: spanDataRepomockSpan, status: PangeaMatchStatus.open,), ], originalInput: "This be a sample text", fullTextCorrection: "This is a sample text", diff --git a/lib/pangea/repo/interactive_translation_repo.dart b/lib/pangea/repo/interactive_translation_repo.dart index bbc556bdc..7efbdf7b5 100644 --- a/lib/pangea/repo/interactive_translation_repo.dart +++ b/lib/pangea/repo/interactive_translation_repo.dart @@ -11,10 +11,10 @@ import '../network/urls.dart'; class ITRepo { static Future customInputTranslate( - CustomInputRequestModel initalText) async { + CustomInputRequestModel initalText,) async { final Requests req = Requests( baseUrl: PApiUrls.choreoBaseApi, - choreoApiKey: Environment.choreoApiKey); + choreoApiKey: Environment.choreoApiKey,); final Response res = await req.post(url: PApiUrls.firstStep, body: initalText.toJson()); @@ -24,10 +24,10 @@ class ITRepo { } static Future systemChoiceTranslate( - SystemChoiceRequestModel subseqText) async { + SystemChoiceRequestModel subseqText,) async { final Requests req = Requests( baseUrl: PApiUrls.choreoBaseApi, - choreoApiKey: Environment.choreoApiKey); + choreoApiKey: Environment.choreoApiKey,); final Response res = await req.post(url: PApiUrls.subseqStep, body: subseqText.toJson()); diff --git a/lib/pangea/repo/message_service.repo.dart b/lib/pangea/repo/message_service.repo.dart index 49288de5e..2d96c71a0 100644 --- a/lib/pangea/repo/message_service.repo.dart +++ b/lib/pangea/repo/message_service.repo.dart @@ -4,10 +4,10 @@ import '../network/urls.dart'; class MessageServiceRepo { static Future sendPayloads( - MessageServiceModel serviceModel, String messageId) async { + MessageServiceModel serviceModel, String messageId,) async { final Requests req = Requests( baseUrl: PApiUrls.choreoBaseApi, - choreoApiKey: Environment.choreoApiKey); + choreoApiKey: Environment.choreoApiKey,); final json = serviceModel.toJson(); json["msg_id"] = messageId; diff --git a/lib/pangea/repo/span_data_repo.dart b/lib/pangea/repo/span_data_repo.dart index 36a43a4a4..b3ed87fac 100644 --- a/lib/pangea/repo/span_data_repo.dart +++ b/lib/pangea/repo/span_data_repo.dart @@ -12,7 +12,7 @@ import '../network/urls.dart'; class SpanDataRepo { static Future getSpanDetails(String? accessToken, - {required SpanDetailsRepoReqAndRes request}) async { + {required SpanDetailsRepoReqAndRes request,}) async { final Requests req = Requests( accessToken: accessToken, choreoApiKey: Environment.choreoApiKey, diff --git a/lib/pangea/repo/subscription_repo.dart b/lib/pangea/repo/subscription_repo.dart index 20dd45b93..eda3b5070 100644 --- a/lib/pangea/repo/subscription_repo.dart +++ b/lib/pangea/repo/subscription_repo.dart @@ -15,7 +15,7 @@ class SubscriptionRepo { static final Map requestHeaders = { 'Content-type': 'application/json', 'Accept': 'application/json', - 'Authorization': 'Bearer ${Environment.rcKey}' + 'Authorization': 'Bearer ${Environment.rcKey}', }; static Future getAppIds() async { @@ -61,7 +61,7 @@ class SubscriptionRepo { final Map stripeHeaders = { 'Content-type': 'application/json', 'Accept': 'application/json', - 'Authorization': 'Bearer ${Environment.rcStripeKey}' + 'Authorization': 'Bearer ${Environment.rcStripeKey}', }; final String url = "${PApiUrls.rcSubscribers}/$userId"; final http.Response res = await http.get( @@ -122,7 +122,7 @@ class RCProductsResponseModel { duration: metadata['$packageId.duration'], id: productDetails['product']['store_identifier'], appId: productDetails['product']['app_id'], - )) + ),) .toList() .cast(); } diff --git a/lib/pangea/repo/tokens_repo.dart b/lib/pangea/repo/tokens_repo.dart index 456b8396c..385407eb8 100644 --- a/lib/pangea/repo/tokens_repo.dart +++ b/lib/pangea/repo/tokens_repo.dart @@ -56,7 +56,7 @@ class TokensRequestModel { Map toJson() => { ModelKey.fullText: fullText, ModelKey.userL1: userL1, - ModelKey.userL2: userL2 + ModelKey.userL2: userL2, }; } @@ -76,5 +76,5 @@ class TokensResponseModel { ) .toList() .cast(), - lang: json[ModelKey.lang]); + lang: json[ModelKey.lang],); } diff --git a/lib/pangea/repo/topic_data_repo.dart b/lib/pangea/repo/topic_data_repo.dart index f53514835..3b5f775dd 100644 --- a/lib/pangea/repo/topic_data_repo.dart +++ b/lib/pangea/repo/topic_data_repo.dart @@ -6,14 +6,13 @@ import 'package:http/http.dart'; import '../config/environment.dart'; import '../models/chat_topic_model.dart'; -import '../models/lemma.dart'; import '../network/requests.dart'; import '../network/urls.dart'; /// accepts ChatTopic and calls an API for a list of Lemma class TopicDataRepo { static Future generate(String? accessToken, - {required TopicDataRequest request}) async { + {required TopicDataRequest request,}) async { final Requests req = Requests( accessToken: accessToken, choreoApiKey: Environment.choreoApiKey, diff --git a/lib/pangea/repo/user_repo.dart b/lib/pangea/repo/user_repo.dart index 59fc1850e..452120962 100644 --- a/lib/pangea/repo/user_repo.dart +++ b/lib/pangea/repo/user_repo.dart @@ -25,7 +25,7 @@ class PUserRepo { final Map body = { ModelKey.userFullName: fullName, ModelKey.userPangeaUserId: userID, - ModelKey.userDateOfBirth: dateOfBirth + ModelKey.userDateOfBirth: dateOfBirth, }; final Response res = await req.post( url: PApiUrls.createUser, diff --git a/lib/pangea/repo/word_repo.dart b/lib/pangea/repo/word_repo.dart index c592eba37..c46233acc 100644 --- a/lib/pangea/repo/word_repo.dart +++ b/lib/pangea/repo/word_repo.dart @@ -17,13 +17,13 @@ class WordRepo { required String userL2, }) async { final Requests req = Requests( - choreoApiKey: Environment.choreoApiKey, accessToken: accessToken); + choreoApiKey: Environment.choreoApiKey, accessToken: accessToken,); final Response res = await req.post(url: PApiUrls.wordNet, body: { ModelKey.word: word, ModelKey.fullText: fullText, ModelKey.userL1: userL1, ModelKey.userL2: userL2, - }); + },); final json = jsonDecode(utf8.decode(res.bodyBytes)); diff --git a/lib/pangea/utils/any_state_holder.dart b/lib/pangea/utils/any_state_holder.dart index c71b77311..2284eb3aa 100644 --- a/lib/pangea/utils/any_state_holder.dart +++ b/lib/pangea/utils/any_state_holder.dart @@ -18,7 +18,7 @@ class PangeaAnyState { } LayerLinkAndKey layerLinkAndKey(String transformTargetId, - [throwErrorIfNotThere = false]) { + [throwErrorIfNotThere = false,]) { if (_layerLinkAndKeys[transformTargetId] == null) { if (throwErrorIfNotThere) { Sentry.addBreadcrumb(Breadcrumb.fromJson(_layerLinkAndKeys)); diff --git a/lib/pangea/utils/class_chat_power_levels.dart b/lib/pangea/utils/class_chat_power_levels.dart index 660d7a70d..638f70dba 100644 --- a/lib/pangea/utils/class_chat_power_levels.dart +++ b/lib/pangea/utils/class_chat_power_levels.dart @@ -9,7 +9,7 @@ import '../extensions/pangea_room_extension.dart'; class ClassChatPowerLevels { static Future> powerLevelOverrideForClassChat( - BuildContext context, List spaceParents) async { + BuildContext context, List spaceParents,) async { final Client client = Matrix.of(context).client; final Map powerLevelOverride = {}; powerLevelOverride['events'] = { diff --git a/lib/pangea/utils/download_chat.dart b/lib/pangea/utils/download_chat.dart index 76f51ac96..da6060246 100644 --- a/lib/pangea/utils/download_chat.dart +++ b/lib/pangea/utils/download_chat.dart @@ -23,7 +23,7 @@ import '../models/choreo_record.dart'; enum DownloadType { txt, csv, xlsx } Future downloadChat(Room room, ClassSettingsModel classSettings, - DownloadType type, Client client, BuildContext context) async { + DownloadType type, Client client, BuildContext context,) async { List allPangeaMessages; try { @@ -43,7 +43,7 @@ Future downloadChat(Room room, ClassSettingsModel classSettings, } catch (err) { ErrorHandler.logError( e: Exception( - "Failed to fetch messages for chat ${room.id} in while downloading chat"), + "Failed to fetch messages for chat ${room.id} in while downloading chat",), s: StackTrace.current, ); ScaffoldMessenger.of(context).showSnackBar( @@ -114,7 +114,7 @@ Future> getAllEvents(Room room, Client client) async { } List getPangeaMessageEvents( - List events, Timeline timeline, Room room, String? targetLang) { + List events, Timeline timeline, Room room, String? targetLang,) { final List allPangeaMessages = events .where( (Event event) => @@ -186,7 +186,7 @@ String mimetype(DownloadType fileType) { } Future downloadFile( - contents, String filename, DownloadType fileType) async { + contents, String filename, DownloadType fileType,) async { if (kIsWeb) { final blob = webFile.Blob([contents], mimetype(fileType), 'native'); webFile.AnchorElement( @@ -228,7 +228,7 @@ Future downloadFile( } String getTxtContent(List messages, BuildContext context, - String filename, Room room) { + String filename, Room room,) { String formattedInfo = ""; for (final PangeaMessageEvent message in messages) { final String timestamp = @@ -265,7 +265,7 @@ String getTxtContent(List messages, BuildContext context, } String getCSVContent( - List messages, BuildContext context, String fileName) { + List messages, BuildContext context, String fileName,) { final List> csvData = [ [ L10n.of(context)!.sender, @@ -291,7 +291,7 @@ String getCSVContent( originalMsg, sentMsg, L10n.of(context)!.notAvailable, - L10n.of(context)!.notAvailable + L10n.of(context)!.notAvailable, ]); continue; } @@ -305,7 +305,7 @@ String getCSVContent( originalMsg, sentMsg, includedIT.toString(), - includedIGC.toString() + includedIGC.toString(), ]); } final String fileString = const ListToCsvConverter().convert(csvData); @@ -313,7 +313,7 @@ String getCSVContent( } List getExcelContent( - List messages, BuildContext context, String filename) { + List messages, BuildContext context, String filename,) { final Workbook workbook = Workbook(); final Worksheet sheet = workbook.worksheets[0]; diff --git a/lib/pangea/utils/error_handler.dart b/lib/pangea/utils/error_handler.dart index ac125f3c0..c0bd00d41 100644 --- a/lib/pangea/utils/error_handler.dart +++ b/lib/pangea/utils/error_handler.dart @@ -14,7 +14,7 @@ class ErrorHandler { static Future initialize() async { FutureOr Function(Scope)? withScope( - Scope scope, FlutterErrorDetails details) { + Scope scope, FlutterErrorDetails details,) { // if (details.exception is http.Response) { // final res = details.exception as http.Response; // scope.addBreadcrumb( @@ -61,7 +61,7 @@ class ErrorHandler { } static logError( - {Object? e, StackTrace? s, String? m, Map? data}) async { + {Object? e, StackTrace? s, String? m, Map? data,}) async { if ((e ?? m) != null) debugPrint("error: ${e?.toString() ?? m}"); if (data != null) { Sentry.addBreadcrumb(Breadcrumb.fromJson(data)); @@ -77,7 +77,7 @@ class ErrorHandler { e.contains("microtask") || e.contains("async_patch")), ), - )); + ),); } } diff --git a/lib/pangea/utils/firebase_analytics.dart b/lib/pangea/utils/firebase_analytics.dart index 57dcdd7fd..af451580b 100644 --- a/lib/pangea/utils/firebase_analytics.dart +++ b/lib/pangea/utils/firebase_analytics.dart @@ -64,12 +64,12 @@ class GoogleAnalytics { static createClass(String className, String classCode) { logEvent('create_class', - parameters: {'name': className, 'group_id': classCode}); + parameters: {'name': className, 'group_id': classCode},); } static createExchange(String exchangeName, String classCode) { logEvent('create_exchange', - parameters: {'name': exchangeName, 'group_id': classCode}); + parameters: {'name': exchangeName, 'group_id': classCode},); } static createChat(String newChatRoomId) { @@ -78,27 +78,27 @@ class GoogleAnalytics { static addParent(String chatRoomId, String classCode) { logEvent('add_room_to_class', - parameters: {"chat_id": chatRoomId, 'group_id': classCode}); + parameters: {"chat_id": chatRoomId, 'group_id': classCode},); } static removeChatFromClass(String chatRoomId, String classCode) { logEvent('remove_room_from_class', - parameters: {"chat_id": chatRoomId, 'group_id': classCode}); + parameters: {"chat_id": chatRoomId, 'group_id': classCode},); } static addChatToExchange(String chatRoomId, String classCode) { logEvent('add_chat_to_exchange', - parameters: {"chat_id": chatRoomId, 'group_id': classCode}); + parameters: {"chat_id": chatRoomId, 'group_id': classCode},); } static inviteClassToExchange(String classId, String exchangeId) { logEvent('invite_class_to_exchange', - parameters: {'group_id': classId, 'exchange_id': exchangeId}); + parameters: {'group_id': classId, 'exchange_id': exchangeId},); } static kickClassFromExchange(String classId, String exchangeId) { logEvent('kick_class_from_exchange', - parameters: {'group_id': classId, 'exchange_id': exchangeId}); + parameters: {'group_id': classId, 'exchange_id': exchangeId},); } static joinClass(String classCode) { @@ -109,8 +109,8 @@ class GoogleAnalytics { logEvent('sent_message', parameters: { "chat_id": chatRoomId, 'group_id': classCode, - "message_type": useType.toString() - }); + "message_type": useType.toString(), + },); } static contextualRequest() { @@ -122,7 +122,7 @@ class GoogleAnalytics { } static beginPurchaseSubscription( - SubscriptionDetails details, BuildContext context) { + SubscriptionDetails details, BuildContext context,) { logEvent('begin_checkout', parameters: { "currency": "USD", 'value': details.price, @@ -133,10 +133,10 @@ class GoogleAnalytics { 'item_name': details.displayName(context), 'price': details.price, 'item_category': "subscription", - 'quantity': 1 + 'quantity': 1, } - ] - }); + ], + },); } static FirebaseAnalyticsObserver getAnalyticsObserver() => @@ -155,5 +155,5 @@ class GoogleAnalytics { final String? name = route.settings.name; debugPrint("navigating to route: $name"); return true; - }); + },); } diff --git a/lib/pangea/utils/overlay.dart b/lib/pangea/utils/overlay.dart index 5f45251f8..ac373efb0 100644 --- a/lib/pangea/utils/overlay.dart +++ b/lib/pangea/utils/overlay.dart @@ -47,7 +47,7 @@ class OverlayUtil { color: Colors.transparent, clipBehavior: Clip.antiAlias, child: OverlayContainer( - cardToShow: cardToShow, borderColor: borderColor), + cardToShow: cardToShow, borderColor: borderColor,), ), ), ), @@ -134,8 +134,8 @@ class OverlayUtil { class TransparentBackdrop extends StatelessWidget { const TransparentBackdrop({ - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { @@ -192,7 +192,7 @@ class ChatViewConstraints implements OverlayConstraints { max(mediaQueryData.viewPadding.right, mediaQueryData.viewInsets.right); y1 = mediaQueryData.size.height - max(mediaQueryData.viewPadding.bottom, - mediaQueryData.viewInsets.bottom); + mediaQueryData.viewInsets.bottom,); // https://medium.com/flutter-community/a-flutter-guide-to-visual-overlap-padding-viewpadding-and-viewinsets-a63e214be6e8 // debugPrint( diff --git a/lib/pangea/utils/p_store.dart b/lib/pangea/utils/p_store.dart index 3f74583d8..eda591932 100644 --- a/lib/pangea/utils/p_store.dart +++ b/lib/pangea/utils/p_store.dart @@ -10,7 +10,7 @@ class PLocalStore { /// save data in local Future save(String key, dynamic data, - {bool addClientIdToKey = true}) async { + {bool addClientIdToKey = true,}) async { await _box.write(_key(key, addClientIdToKey: addClientIdToKey), data); } diff --git a/lib/pangea/utils/password_forgotten.dart b/lib/pangea/utils/password_forgotten.dart index 67c5fdaec..186d76ce8 100644 --- a/lib/pangea/utils/password_forgotten.dart +++ b/lib/pangea/utils/password_forgotten.dart @@ -29,7 +29,7 @@ extension PangeaPasswordForgotten on LoginController { decoration: InputDecoration( hintText: L10n.of(context)!.enterAnEmailAddress, ), - ) + ), ], ), actions: [ diff --git a/lib/pangea/utils/report_message.dart b/lib/pangea/utils/report_message.dart index bf1558410..84330e1d0 100644 --- a/lib/pangea/utils/report_message.dart +++ b/lib/pangea/utils/report_message.dart @@ -84,7 +84,7 @@ Future> getReportTeachers( final List reportRoomParentSpaces = room.spaceParents .where((parentSpace) => parentSpace.roomId != null) .map((parentSpace) => - Matrix.of(context).client.getRoomById(parentSpace.roomId!)) + Matrix.of(context).client.getRoomById(parentSpace.roomId!),) .where((parentSpace) => parentSpace != null) .cast() .toList(); @@ -119,8 +119,7 @@ Future> getReportTeachers( class TeacherSelectDialog extends StatefulWidget { final List teachers; - const TeacherSelectDialog({Key? key, required this.teachers}) - : super(key: key); + const TeacherSelectDialog({super.key, required this.teachers}); @override State createState() => _TeacherSelectDialogState(); diff --git a/lib/pangea/utils/set_class_name.dart b/lib/pangea/utils/set_class_name.dart index ae899a430..919e2da15 100644 --- a/lib/pangea/utils/set_class_name.dart +++ b/lib/pangea/utils/set_class_name.dart @@ -13,7 +13,7 @@ void setClassDisplayname(BuildContext context, String? roomId) async { MatrixLocals( L10n.of(context)!, ), - )); + ),); showDialog( context: context, @@ -44,7 +44,7 @@ void setClassDisplayname(BuildContext context, String? roomId) async { ); if (success.error == null) { ScaffoldMessenger.of(context).showSnackBar(SnackBar( - content: Text(L10n.of(context)!.displaynameHasBeenChanged))); + content: Text(L10n.of(context)!.displaynameHasBeenChanged),),); Navigator.of(context).pop(); } }, diff --git a/lib/pangea/utils/shared_prefs.dart b/lib/pangea/utils/shared_prefs.dart index bb9efd9cc..3d22a9971 100644 --- a/lib/pangea/utils/shared_prefs.dart +++ b/lib/pangea/utils/shared_prefs.dart @@ -4,30 +4,30 @@ import 'package:shared_preferences/shared_preferences.dart'; class MyShared { static saveString(String key, String value) async { - final SharedPreferences _prefs = await SharedPreferences.getInstance(); - _prefs.setString(key, value); + final SharedPreferences prefs = await SharedPreferences.getInstance(); + prefs.setString(key, value); } static Future? readString(String key) async { - final SharedPreferences _prefs = await SharedPreferences.getInstance(); - String? source = _prefs.getString(key); + final SharedPreferences prefs = await SharedPreferences.getInstance(); + final String? source = prefs.getString(key); return source; } static saveJson(String key, Map value) async { - final SharedPreferences _prefs = await SharedPreferences.getInstance(); - _prefs.setString(key, json.encode(value)); + final SharedPreferences prefs = await SharedPreferences.getInstance(); + prefs.setString(key, json.encode(value)); } static Future? readJson(String key) async { try { - final SharedPreferences _prefs = await SharedPreferences.getInstance(); - String? source = _prefs.getString(key); + final SharedPreferences prefs = await SharedPreferences.getInstance(); + final String? source = prefs.getString(key); if (source == null) { return null; } - var decodedJson = json.decoder.convert(source); + final decodedJson = json.decoder.convert(source); //var decodedJson = json.decode(source); return decodedJson; } catch (err) { diff --git a/lib/pangea/utils/sync_status_util.dart b/lib/pangea/utils/sync_status_util.dart index 80041a311..5b5bb4129 100644 --- a/lib/pangea/utils/sync_status_util.dart +++ b/lib/pangea/utils/sync_status_util.dart @@ -14,8 +14,7 @@ class PLoadingStatus extends StatefulWidget { final Widget child; final Widget? shimmerChild; const PLoadingStatus( - {Key? key, required this.child, this.onFinish, this.shimmerChild}) - : super(key: key); + {super.key, required this.child, this.onFinish, this.shimmerChild,}); @override PLoadingStatusState createState() => PLoadingStatusState(); @@ -65,10 +64,10 @@ class PLoadingStatusState extends State { class PangeaDefaultShimmer extends StatelessWidget { const PangeaDefaultShimmer({ - Key? key, + super.key, required this.hide, required this.status, - }) : super(key: key); + }); final bool hide; final SyncStatusUpdate status; diff --git a/lib/pangea/utils/sync_status_util_v2.dart b/lib/pangea/utils/sync_status_util_v2.dart index 51062afa1..146f271e7 100644 --- a/lib/pangea/utils/sync_status_util_v2.dart +++ b/lib/pangea/utils/sync_status_util_v2.dart @@ -13,8 +13,7 @@ class PLoadingStatusV2 extends StatefulWidget { final Widget child; final Widget? shimmerChild; const PLoadingStatusV2( - {Key? key, required this.child, this.onFinish, this.shimmerChild}) - : super(key: key); + {super.key, required this.child, this.onFinish, this.shimmerChild,}); @override PLoadingStatusStateV2 createState() => PLoadingStatusStateV2(); @@ -65,10 +64,10 @@ class PLoadingStatusStateV2 extends State { class PangeaDefaultShimmer extends StatelessWidget { const PangeaDefaultShimmer({ - Key? key, + super.key, required this.hide, required this.status, - }) : super(key: key); + }); final bool hide; final SyncStatusUpdate status; diff --git a/lib/pangea/widgets/chat/locked_chat_message.dart b/lib/pangea/widgets/chat/locked_chat_message.dart index 2ce4dbd74..7c890c7c5 100644 --- a/lib/pangea/widgets/chat/locked_chat_message.dart +++ b/lib/pangea/widgets/chat/locked_chat_message.dart @@ -5,7 +5,7 @@ import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:fluffychat/config/app_config.dart'; class LockedChatMessage extends StatelessWidget { - const LockedChatMessage({Key? key}) : super(key: key); + const LockedChatMessage({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/pangea/widgets/class/add_class_and_invite.dart b/lib/pangea/widgets/class/add_class_and_invite.dart index 498cb61ac..e33118c73 100644 --- a/lib/pangea/widgets/class/add_class_and_invite.dart +++ b/lib/pangea/widgets/class/add_class_and_invite.dart @@ -23,12 +23,12 @@ class AddToClassAndInviteToggles extends StatefulWidget { final AddToClassMode mode; const AddToClassAndInviteToggles({ - Key? key, + super.key, this.roomId, this.startOpen = false, this.setParentState, required this.mode, - }) : super(key: key); + }); @override AddToClassAndInviteState createState() => AddToClassAndInviteState(); diff --git a/lib/pangea/widgets/class/join_with_link.dart b/lib/pangea/widgets/class/join_with_link.dart index c513c7b3f..8011d718b 100644 --- a/lib/pangea/widgets/class/join_with_link.dart +++ b/lib/pangea/widgets/class/join_with_link.dart @@ -14,7 +14,7 @@ import '../../utils/error_handler.dart'; //if on home with classcode in url and not logged in, then save it soemhow and after llogin, join class automatically //if on home with classcode in url and logged in, then join class automatically class JoinClassWithLink extends StatefulWidget { - const JoinClassWithLink({Key? key}) : super(key: key); + const JoinClassWithLink({super.key}); @override State createState() => _JoinClassWithLinkState(); diff --git a/lib/pangea/widgets/common/aligned_dialog.dart b/lib/pangea/widgets/common/aligned_dialog.dart index c08513300..9256e5c16 100644 --- a/lib/pangea/widgets/common/aligned_dialog.dart +++ b/lib/pangea/widgets/common/aligned_dialog.dart @@ -53,7 +53,7 @@ Future showAlignedDialog({ duration: duration, avoidOverflow: avoidOverflow, offset: offset, - )); + ),); } class AlignedDialogRoute extends RawDialogRoute { @@ -66,18 +66,18 @@ class AlignedDialogRoute extends RawDialogRoute { required Alignment followerAlignment, required Offset position, CapturedThemes? themes, - Color? barrierColor = Colors.transparent, - bool barrierDismissible = true, + super.barrierColor = Colors.transparent, + super.barrierDismissible, String? barrierLabel, bool useSafeArea = false, - RouteSettings? settings, + super.settings, RouteTransitionsBuilder? transitionsBuilder, Duration? duration, bool avoidOverflow = false, Offset offset = Offset.zero, }) : super( pageBuilder: (BuildContext buildContext, Animation animation, - Animation secondaryAnimation) { + Animation secondaryAnimation,) { final Widget pageChild = Builder(builder: builder); Widget dialog = Builder( builder: (BuildContext context) { @@ -102,14 +102,11 @@ class AlignedDialogRoute extends RawDialogRoute { } return dialog; }, - barrierDismissible: barrierDismissible, - barrierColor: barrierColor, barrierLabel: barrierLabel ?? MaterialLocalizations.of(context).modalBarrierDismissLabel, transitionDuration: duration ?? const Duration(milliseconds: 200), transitionBuilder: transitionsBuilder ?? _buildMaterialDialogTransitions, - settings: settings, ); } @@ -180,7 +177,7 @@ Widget _buildMaterialDialogTransitions( BuildContext context, Animation animation, Animation secondaryAnimation, - Widget child) { + Widget child,) { return FadeTransition( opacity: CurvedAnimation( parent: animation, @@ -191,9 +188,9 @@ Widget _buildMaterialDialogTransitions( } Offset _buildOffSet(BuildContext context, - {required Size refChildSize, required Offset offset}) { + {required Size refChildSize, required Offset offset,}) { final Size screenSize = MediaQuery.of(context).size; final Size maxAvilableArea = Size(screenSize.width - refChildSize.width, - screenSize.height - refChildSize.height); + screenSize.height - refChildSize.height,); return const Offset(0, 0); } diff --git a/lib/pangea/widgets/common/bot_face_svg.dart b/lib/pangea/widgets/common/bot_face_svg.dart index 54143626e..718f10c90 100644 --- a/lib/pangea/widgets/common/bot_face_svg.dart +++ b/lib/pangea/widgets/common/bot_face_svg.dart @@ -4,11 +4,11 @@ enum BotExpression { surprised, right, addled, left, down, shocked } class BotFace extends StatelessWidget { const BotFace({ - Key? key, + super.key, required this.width, required this.expression, this.forceColor, - }) : super(key: key); + }); final double width; final Color? forceColor; diff --git a/lib/pangea/widgets/common/list_placeholder.dart b/lib/pangea/widgets/common/list_placeholder.dart index 0886967a5..4b37c08d6 100644 --- a/lib/pangea/widgets/common/list_placeholder.dart +++ b/lib/pangea/widgets/common/list_placeholder.dart @@ -3,14 +3,14 @@ import 'package:flutter/material.dart'; class ListPlaceholder extends StatelessWidget { static const dummyChatCount = 5; - const ListPlaceholder({Key? key}) : super(key: key); + const ListPlaceholder({super.key}); @override Widget build(BuildContext context) { final titleColor = - Theme.of(context).textTheme.bodyText1!.color!.withAlpha(100); + Theme.of(context).textTheme.bodyLarge!.color!.withAlpha(100); final subtitleColor = - Theme.of(context).textTheme.bodyText1!.color!.withAlpha(50); + Theme.of(context).textTheme.bodyLarge!.color!.withAlpha(50); return ListView.builder( itemCount: dummyChatCount, @@ -22,7 +22,7 @@ class ListPlaceholder extends StatelessWidget { backgroundColor: titleColor, child: CircularProgressIndicator( strokeWidth: 1, - color: Theme.of(context).textTheme.bodyText1!.color, + color: Theme.of(context).textTheme.bodyLarge!.color, ), ), title: Row( diff --git a/lib/pangea/widgets/common/p_circular_loader.dart b/lib/pangea/widgets/common/p_circular_loader.dart index f292d9b23..1902f2ffc 100644 --- a/lib/pangea/widgets/common/p_circular_loader.dart +++ b/lib/pangea/widgets/common/p_circular_loader.dart @@ -13,7 +13,7 @@ class PCircular extends StatelessWidget { SizedBox( height: size ?? 25, width: size ?? 25, - child: const CircularProgressIndicator()), + child: const CircularProgressIndicator(),), ], ); } diff --git a/lib/pangea/widgets/common/pangea_logo_svg.dart b/lib/pangea/widgets/common/pangea_logo_svg.dart index a86a7e6e9..485f08b65 100644 --- a/lib/pangea/widgets/common/pangea_logo_svg.dart +++ b/lib/pangea/widgets/common/pangea_logo_svg.dart @@ -3,8 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; class PangeaLogoSvg extends StatelessWidget { - const PangeaLogoSvg({Key? key, required this.width, this.forceColor}) - : super(key: key); + const PangeaLogoSvg({super.key, required this.width, this.forceColor}); final double width; final Color? forceColor; diff --git a/lib/pangea/widgets/common/star_rating.dart b/lib/pangea/widgets/common/star_rating.dart index b2a7d56f5..733edbbf2 100644 --- a/lib/pangea/widgets/common/star_rating.dart +++ b/lib/pangea/widgets/common/star_rating.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -typedef void RatingChangeCallback(double rating); +typedef RatingChangeCallback = void Function(double rating); class StarRating extends StatelessWidget { final int starCount; @@ -8,13 +8,12 @@ class StarRating extends StatelessWidget { final RatingChangeCallback? onRatingChanged; final Color color; - StarRating( - {Key? key, + const StarRating( + {super.key, this.starCount = 5, this.rating = 0, this.onRatingChanged, - required this.color}) - : super(key: key); + required this.color,}); Widget buildStar(BuildContext context, int index) { Icon icon; @@ -51,6 +50,6 @@ class StarRating extends StatelessWidget { return Row( mainAxisSize: MainAxisSize.min, children: - List.generate(starCount, (index) => buildStar(context, index))); + List.generate(starCount, (index) => buildStar(context, index)),); } } diff --git a/lib/pangea/widgets/common_widgets/edit_list_tile.dart b/lib/pangea/widgets/common_widgets/edit_list_tile.dart index 4b6067371..3d03ed08b 100644 --- a/lib/pangea/widgets/common_widgets/edit_list_tile.dart +++ b/lib/pangea/widgets/common_widgets/edit_list_tile.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; -import '../../../utils/url_launcher.dart'; import '../../../widgets/avatar.dart'; class EditClassListTile extends StatefulWidget { @@ -8,11 +7,10 @@ class EditClassListTile extends StatefulWidget { Function() onTap; String subtitle = ""; EditClassListTile( - {Key? key, + {super.key, required this.title, required this.onTap, - required this.subtitle}) - : super(key: key); + required this.subtitle,}); @override State createState() => _EditClassListTileState(); @@ -32,7 +30,7 @@ class _EditClassListTileState extends State { title: Text('${widget.title}:', style: TextStyle( color: Theme.of(context).colorScheme.secondary, - fontWeight: FontWeight.bold)), + fontWeight: FontWeight.bold,),), subtitle: Text( widget.subtitle, style: TextStyle( diff --git a/lib/pangea/widgets/common_widgets/overlay_container.dart b/lib/pangea/widgets/common_widgets/overlay_container.dart index c836dffdb..4fc64fb3d 100644 --- a/lib/pangea/widgets/common_widgets/overlay_container.dart +++ b/lib/pangea/widgets/common_widgets/overlay_container.dart @@ -6,11 +6,11 @@ class OverlayContainer extends StatelessWidget { final Color? borderColor; const OverlayContainer({ - Key? key, + super.key, required this.cardToShow, this.cardSize = const Size(300.0, 300.0), this.borderColor, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/pangea/widgets/common_widgets/p_input_field.dart b/lib/pangea/widgets/common_widgets/p_input_field.dart index 31bab0e58..f2db7733f 100644 --- a/lib/pangea/widgets/common_widgets/p_input_field.dart +++ b/lib/pangea/widgets/common_widgets/p_input_field.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/l10n.dart'; class PInputTextField extends StatelessWidget { TextEditingController controller; @@ -8,12 +7,11 @@ class PInputTextField extends StatelessWidget { String labelText; String hintText; PInputTextField( - {Key? key, + {super.key, required this.controller, required this.onSubmit, required this.labelText, - required this.hintText}) - : super(key: key); + required this.hintText,}); @override Widget build(BuildContext context) { @@ -28,7 +26,7 @@ class PInputTextField extends StatelessWidget { decoration: InputDecoration( labelText: labelText, prefixIcon: const Icon(Icons.people_outlined), - hintText: hintText), + hintText: hintText,), ), ); } diff --git a/lib/pangea/widgets/flag.dart b/lib/pangea/widgets/flag.dart index 5d1607e0a..08327530d 100644 --- a/lib/pangea/widgets/flag.dart +++ b/lib/pangea/widgets/flag.dart @@ -7,10 +7,10 @@ class LanguageFlag extends StatelessWidget { final LanguageModel? language; final double size; const LanguageFlag({ - Key? key, + super.key, required this.language, this.size = 30, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/pangea/widgets/igc/card_error_widget.dart b/lib/pangea/widgets/igc/card_error_widget.dart index 7826aa8ce..8c546c7f6 100644 --- a/lib/pangea/widgets/igc/card_error_widget.dart +++ b/lib/pangea/widgets/igc/card_error_widget.dart @@ -11,11 +11,11 @@ class CardErrorWidget extends StatelessWidget { final Choreographer? choreographer; final int? offset; const CardErrorWidget({ - Key? key, + super.key, this.error, this.choreographer, this.offset, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/pangea/widgets/igc/card_header.dart b/lib/pangea/widgets/igc/card_header.dart index bfede842c..5ee6b98f2 100644 --- a/lib/pangea/widgets/igc/card_header.dart +++ b/lib/pangea/widgets/igc/card_header.dart @@ -7,11 +7,11 @@ import '../common/bot_face_svg.dart'; class CardHeader extends StatelessWidget { const CardHeader({ - Key? key, + super.key, required this.text, required this.botExpression, this.onClose, - }) : super(key: key); + }); final BotExpression botExpression; final String text; diff --git a/lib/pangea/widgets/igc/pangea_rich_text.dart b/lib/pangea/widgets/igc/pangea_rich_text.dart index d7af1c238..aa9c64ed3 100644 --- a/lib/pangea/widgets/igc/pangea_rich_text.dart +++ b/lib/pangea/widgets/igc/pangea_rich_text.dart @@ -31,7 +31,7 @@ class PangeaRichText extends StatefulWidget { final Choreographer? choreographer; const PangeaRichText({ - Key? key, + super.key, required this.pangeaMessageEvent, required this.selected, required this.selectedDisplayLang, @@ -39,7 +39,7 @@ class PangeaRichText extends StatefulWidget { required this.definitions, this.choreographer, this.existingStyle, - }) : super(key: key); + }); @override PangeaRichTextState createState() => PangeaRichTextState(); @@ -150,7 +150,7 @@ class PangeaRichTextState extends State { if (repEvent.event?.eventId.contains("web") ?? false) { Sentry.addBreadcrumb( - Breadcrumb.fromJson({"repEvent.event": repEvent.event?.toJson()})); + Breadcrumb.fromJson({"repEvent.event": repEvent.event?.toJson()}),); Sentry.addBreadcrumb( Breadcrumb( message: @@ -202,16 +202,16 @@ class PangeaRichTextState extends State { TextSpan( text: text, style: widget.existingStyle, - ) + ), ]; List textWithBotStyle( - RepresentationEvent repEvent, BuildContext context) => + RepresentationEvent repEvent, BuildContext context,) => [ TextSpan( text: repEvent.text, style: textStyle(repEvent, context), - ) + ), ]; TextStyle? textStyle(RepresentationEvent repEvent, BuildContext context) => @@ -219,7 +219,7 @@ class PangeaRichTextState extends State { true ? widget.existingStyle : BotStyle.text(context, - existingStyle: widget.existingStyle, setColor: false); + existingStyle: widget.existingStyle, setColor: false,); bool get areLanguagesSet => userL2LangCode != null && userL2LangCode != LanguageKeys.unknownLanguage; @@ -243,7 +243,7 @@ class PangeaRichTextState extends State { } Future onReplacementSelect( - PangeaMatch pangeaMatch, String replacement) async { + PangeaMatch pangeaMatch, String replacement,) async { debugPrint("PTODO implement onReplacementSelect"); } diff --git a/lib/pangea/widgets/igc/pangea_text_controller.dart b/lib/pangea/widgets/igc/pangea_text_controller.dart index 47e120576..48d765b46 100644 --- a/lib/pangea/widgets/igc/pangea_text_controller.dart +++ b/lib/pangea/widgets/igc/pangea_text_controller.dart @@ -69,7 +69,7 @@ class PangeaTextController extends TextEditingController { debugPrint("onSentenceRewrite $tokenIndex $sentenceRewrite"); }), onIgnore: () => choreographer.onIgnoreMatch( - cursorOffset: selection.baseOffset), + cursorOffset: selection.baseOffset,), onITStart: () { choreographer.onITStart( choreographer.igc.igcTextData!.matches[matchIndex], @@ -144,7 +144,7 @@ class PangeaTextController extends TextEditingController { transformTargetId: choreographer.inputTransformTargetKey, room: choreographer.chatController.room, ), - TextSpan(text: parts[1], style: style) + TextSpan(text: parts[1], style: style), ], ); } diff --git a/lib/pangea/widgets/igc/span_card.dart b/lib/pangea/widgets/igc/span_card.dart index 3213b5296..c2d858c73 100644 --- a/lib/pangea/widgets/igc/span_card.dart +++ b/lib/pangea/widgets/igc/span_card.dart @@ -35,10 +35,10 @@ class SpanCard extends StatefulWidget { final String? roomId; SpanCard({ - Key? key, + super.key, required this.scm, this.roomId, - }) : super(key: key); + }); @override State createState() => SpanCardState(); @@ -95,8 +95,8 @@ class WordMatchContent extends StatelessWidget { WordMatchContent({ required this.controller, - Key? key, - }) : super(key: key); + super.key, + }); Future onChoiceSelect(int index) async { controller.selectedChoiceIndex = index; @@ -187,7 +187,7 @@ class WordMatchContent extends StatelessWidget { ?.map((e) => Choice( text: e.value, color: e.selected ? e.type.color : null, - )) + ),) .toList(), onPressed: onChoiceSelect, uniqueKeyForLayerLink: (int index) => "wordMatch$index", @@ -210,12 +210,12 @@ class WordMatchContent extends StatelessWidget { child: TextButton( style: ButtonStyle( backgroundColor: MaterialStateProperty.all( - AppConfig.primaryColor.withOpacity(0.1)), + AppConfig.primaryColor.withOpacity(0.1),), ), onPressed: () { MatrixState.pAnyState.closeOverlay(); Future.delayed(Duration.zero, - () => controller.widget.scm.onIgnore()); + () => controller.widget.scm.onIgnore(),); }, child: Center( child: Text(L10n.of(context)!.ignoreInThisText), @@ -237,7 +237,7 @@ class WordMatchContent extends StatelessWidget { (controller.selectedChoice != null ? controller.selectedChoice!.color : AppConfig.primaryColor) - .withOpacity(0.2)), + .withOpacity(0.2),), ), child: Text(L10n.of(context)!.replace), ), @@ -250,11 +250,11 @@ class WordMatchContent extends StatelessWidget { onPressed: () { MatrixState.pAnyState.closeOverlay(); Future.delayed(Duration.zero, - () => controller.widget.scm.onITStart()); + () => controller.widget.scm.onITStart(),); }, style: ButtonStyle( backgroundColor: MaterialStateProperty.all( - (AppConfig.primaryColor).withOpacity(0.1)), + (AppConfig.primaryColor).withOpacity(0.1),), ), child: Text(L10n.of(context)!.helpMeTranslate), ), @@ -313,7 +313,7 @@ class PromptAndFeedback extends StatelessWidget { }, style: ButtonStyle( backgroundColor: MaterialStateProperty.all( - AppConfig.primaryColor.withOpacity(0.1)), + AppConfig.primaryColor.withOpacity(0.1),), ), child: SizedBox( width: 150, // set the width of the button contents here @@ -335,7 +335,7 @@ class PromptAndFeedback extends StatelessWidget { ], ), ), - ) + ), ], if (!controller.fetchingData && controller.selectedChoiceIndex == null) @@ -352,8 +352,8 @@ class PromptAndFeedback extends StatelessWidget { class LoadingText extends StatefulWidget { const LoadingText({ - Key? key, - }) : super(key: key); + super.key, + }); @override _LoadingTextState createState() => _LoadingTextState(); @@ -397,9 +397,9 @@ class _LoadingTextState extends State class StartITButton extends StatelessWidget { const StartITButton({ - Key? key, + super.key, required this.onITStart, - }) : super(key: key); + }); final void Function() onITStart; diff --git a/lib/pangea/widgets/igc/span_data.dart b/lib/pangea/widgets/igc/span_data.dart index 892c245a1..c1f033270 100644 --- a/lib/pangea/widgets/igc/span_data.dart +++ b/lib/pangea/widgets/igc/span_data.dart @@ -6,7 +6,6 @@ import 'package:collection/collection.dart'; -import '../../enum/span_choice_type.dart'; import '../../enum/span_data_type.dart'; class SpanData { @@ -40,11 +39,11 @@ class SpanData { shortMessage: json['shortMessage'], choices: json['choices'] != null ? List.from( - json['choices'].map((x) => SpanChoice.fromJson(x))) + json['choices'].map((x) => SpanChoice.fromJson(x)),) : null, replacements: json['replacements'] != null ? List.from( - json['replacements'].map((x) => Replacement.fromJson(x))) + json['replacements'].map((x) => Replacement.fromJson(x)),) : null, offset: json['offset'], length: json['length'], @@ -52,7 +51,7 @@ class SpanData { context: json['context'] != null ? Context.fromJson(json['context']) : null, type: SpanDataTypeEnum.values.firstWhereOrNull( - (e) => e.toString() == 'SpanDataTypeEnum.${json['type']}') ?? + (e) => e.toString() == 'SpanDataTypeEnum.${json['type']}',) ?? SpanDataTypeEnum.correction, rule: json['rule'] != null ? Rule.fromJson(json['rule']) : null, ); diff --git a/lib/pangea/widgets/igc/word_data_card.dart b/lib/pangea/widgets/igc/word_data_card.dart index 94f129f09..ee600a159 100644 --- a/lib/pangea/widgets/igc/word_data_card.dart +++ b/lib/pangea/widgets/igc/word_data_card.dart @@ -32,7 +32,7 @@ class WordDataCard extends StatefulWidget { final Room room; const WordDataCard({ - Key? key, + super.key, required this.word, required this.wordLang, required this.hasInfo, @@ -40,7 +40,7 @@ class WordDataCard extends StatefulWidget { required this.fullTextLang, required this.room, this.choiceFeedback, - }) : super(key: key); + }); @override State createState() => WordDataCardController(); @@ -138,9 +138,9 @@ class WordDataCardController extends State { class WordDataCardView extends StatelessWidget { const WordDataCardView({ - Key? key, + super.key, required this.controller, - }) : super(key: key); + }); final WordDataCardController controller; @@ -167,7 +167,7 @@ class WordDataCardView extends StatelessWidget { children: [ CardHeader( text: controller.widget.word, - botExpression: BotExpression.down), + botExpression: BotExpression.down,), if (controller.widget.choiceFeedback != null) Text( controller.widget.choiceFeedback!, @@ -218,11 +218,11 @@ class WordNetInfo extends StatelessWidget { final LanguageModel activeL2; const WordNetInfo({ - Key? key, + super.key, required this.wordData, required this.activeL1, required this.activeL2, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -250,11 +250,11 @@ enum LanguageType { class SensesForLanguage extends StatelessWidget { const SensesForLanguage({ - Key? key, + super.key, required this.wordData, required this.languageType, required this.language, - }) : super(key: key); + }); final LanguageModel language; final LanguageType languageType; @@ -278,7 +278,7 @@ class SensesForLanguage extends StatelessWidget { wordData: wordData, languageType: languageType, ), - ) + ), ], ), ); @@ -290,10 +290,10 @@ class PartOfSpeechBlock extends StatelessWidget { final LanguageType languageType; const PartOfSpeechBlock({ - Key? key, + super.key, required this.wordData, required this.languageType, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/pangea/widgets/login/home_picker_logo.dart b/lib/pangea/widgets/login/home_picker_logo.dart index 30fc33b24..bbce4e99a 100644 --- a/lib/pangea/widgets/login/home_picker_logo.dart +++ b/lib/pangea/widgets/login/home_picker_logo.dart @@ -1,12 +1,11 @@ import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import '../../../config/app_config.dart'; import '../common/pangea_logo_svg.dart'; class PangeaLogoAndNameWidget extends StatelessWidget { - const PangeaLogoAndNameWidget({Key? key}) : super(key: key); + const PangeaLogoAndNameWidget({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/pangea/widgets/new_group/vocab_list.dart b/lib/pangea/widgets/new_group/vocab_list.dart index 9783be7d0..e6c2675e4 100644 --- a/lib/pangea/widgets/new_group/vocab_list.dart +++ b/lib/pangea/widgets/new_group/vocab_list.dart @@ -27,10 +27,10 @@ import '../common/bot_face_svg.dart'; class ChatVocabularyList extends StatelessWidget { const ChatVocabularyList({ - Key? key, + super.key, required this.topic, required this.onChanged, - }) : super(key: key); + }); final ChatTopic topic; final ValueChanged> onChanged; @@ -168,10 +168,10 @@ class VocabWord { class WordAddTextField extends StatefulWidget { const WordAddTextField({ - Key? key, + super.key, required this.onSubmitted, required this.words, - }) : super(key: key); + }); final ValueChanged onSubmitted; final List words; @@ -244,11 +244,11 @@ class WordAddTextFieldState extends State { /// uses app theme colors, text styles, and icons class GenerateVocabButton extends StatefulWidget { const GenerateVocabButton({ - Key? key, + super.key, required this.onWordsGenerated, required this.onPressed, required this.topic, - }) : super(key: key); + }); final ChatTopic topic; final ValueChanged> onWordsGenerated; @@ -331,11 +331,11 @@ class GenerateVocabButtonState extends State { /// 3) onChanged callback function to pass the updated ChatTopic back to the parent widget class DescriptionField extends StatelessWidget { const DescriptionField({ - Key? key, + super.key, required this.topic, required this.initialValue, required this.onChanged, - }) : super(key: key); + }); final ChatTopic topic; final String initialValue; @@ -365,10 +365,10 @@ class DescriptionField extends StatelessWidget { /// 3) onChanged callback function to pass the updated ChatTopic back to the parent widget class NameField extends StatelessWidget { const NameField({ - Key? key, + super.key, required this.topic, required this.onChanged, - }) : super(key: key); + }); final ChatTopic topic; final ValueChanged onChanged; @@ -395,10 +395,10 @@ class NameField extends StatelessWidget { /// 2) callback function to pass the updated ChatTopic back to the parent widget class PromptsField extends StatefulWidget { const PromptsField({ - Key? key, + super.key, required this.topic, required this.onChanged, - }) : super(key: key); + }); final ChatTopic topic; final ValueChanged onChanged; diff --git a/lib/pangea/widgets/space/class_settings.dart b/lib/pangea/widgets/space/class_settings.dart index 73db3c8ba..68d2aa0f4 100644 --- a/lib/pangea/widgets/space/class_settings.dart +++ b/lib/pangea/widgets/space/class_settings.dart @@ -25,8 +25,7 @@ class ClassSettings extends StatefulWidget { final String? roomId; final bool startOpen; - const ClassSettings({Key? key, this.roomId, this.startOpen = false}) - : super(key: key); + const ClassSettings({super.key, this.roomId, this.startOpen = false}); @override ClassSettingsState createState() => ClassSettingsState(); @@ -136,7 +135,7 @@ class ClassSettingsState extends State { children: [ PQuestionContainer( title: - L10n.of(context)!.selectClassRoomDominantLanguage), + L10n.of(context)!.selectClassRoomDominantLanguage,), PLanguageDropdown( onChange: (p0) => updatePermission(() { classSettings.dominantLanguage = p0.langCode; @@ -149,7 +148,7 @@ class ClassSettingsState extends State { showMultilingual: true, ), PQuestionContainer( - title: L10n.of(context)!.selectTargetLanguage), + title: L10n.of(context)!.selectTargetLanguage,), PLanguageDropdown( onChange: (p0) => updatePermission(() { classSettings.targetLanguage = p0.langCode; @@ -161,7 +160,7 @@ class ClassSettingsState extends State { languages: pangeaController.pLanguageStore.targetOptions, ), PQuestionContainer( - title: L10n.of(context)!.whatIsYourClassLanguageLevel), + title: L10n.of(context)!.whatIsYourClassLanguageLevel,), Padding( padding: const EdgeInsets.all(12.0), child: Container( @@ -206,7 +205,7 @@ class ClassSettingsState extends State { value: levelOption, child: Text( LanguageLevelTextPicker.languageLevelText( - context, levelOption), + context, levelOption,), style: const TextStyle().copyWith( color: Theme.of(context) .textTheme diff --git a/lib/pangea/widgets/subscription/subscription_buttons.dart b/lib/pangea/widgets/subscription/subscription_buttons.dart index ffd415975..7798b5b28 100644 --- a/lib/pangea/widgets/subscription/subscription_buttons.dart +++ b/lib/pangea/widgets/subscription/subscription_buttons.dart @@ -12,8 +12,8 @@ class SubscriptionButtons extends StatelessWidget { final PangeaController pangeaController = MatrixState.pangeaController; SubscriptionButtons({ required this.controller, - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { diff --git a/lib/pangea/widgets/subscription/subscription_options.dart b/lib/pangea/widgets/subscription/subscription_options.dart index dee683b4d..e82123638 100644 --- a/lib/pangea/widgets/subscription/subscription_options.dart +++ b/lib/pangea/widgets/subscription/subscription_options.dart @@ -43,10 +43,10 @@ class SubscriptionCard extends StatelessWidget { final PangeaController pangeaController; const SubscriptionCard({ - Key? key, + super.key, required this.subscription, required this.pangeaController, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -83,7 +83,7 @@ class SubscriptionCard extends StatelessWidget { .submitSubscriptionChange(subscription, context); }, child: Text(L10n.of(context)!.subscribe), - ) + ), ], ), ), diff --git a/lib/pangea/widgets/subscription/subscription_paywall.dart b/lib/pangea/widgets/subscription/subscription_paywall.dart index 949d3238e..0686d38b8 100644 --- a/lib/pangea/widgets/subscription/subscription_paywall.dart +++ b/lib/pangea/widgets/subscription/subscription_paywall.dart @@ -8,9 +8,9 @@ import 'package:fluffychat/pangea/widgets/subscription/subscription_options.dart class SubscriptionPaywall extends StatelessWidget { final PangeaController pangeaController; const SubscriptionPaywall({ - Key? key, + super.key, required this.pangeaController, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/pangea/widgets/user_settings/country_picker_tile.dart b/lib/pangea/widgets/user_settings/country_picker_tile.dart index 455b9cdbb..ec62374e9 100644 --- a/lib/pangea/widgets/user_settings/country_picker_tile.dart +++ b/lib/pangea/widgets/user_settings/country_picker_tile.dart @@ -14,7 +14,7 @@ import '../../models/user_model.dart'; class CountryPickerTile extends StatelessWidget { final PangeaController pangeaController = MatrixState.pangeaController; - CountryPickerTile({Key? key}) : super(key: key); + CountryPickerTile({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/pangea/widgets/user_settings/language_tile.dart b/lib/pangea/widgets/user_settings/language_tile.dart index 331ec90a5..9884b554c 100644 --- a/lib/pangea/widgets/user_settings/language_tile.dart +++ b/lib/pangea/widgets/user_settings/language_tile.dart @@ -13,7 +13,7 @@ import 'p_language_dialog.dart'; class LanguageTile extends StatelessWidget { final PangeaController pangeaController = MatrixState.pangeaController; - LanguageTile({Key? key}) : super(key: key); + LanguageTile({super.key}); @override Widget build(BuildContext context) { @@ -58,7 +58,7 @@ class LanguageTile extends StatelessWidget { width: 10, ), Text(sourceLanguage?.getDisplayName(context) ?? - L10n.of(context)!.sourceLanguage), + L10n.of(context)!.sourceLanguage,), const SizedBox( width: 10, ), @@ -73,8 +73,8 @@ class LanguageTile extends StatelessWidget { width: 10, ), Text(targetLanguage?.getDisplayName(context) ?? - L10n.of(context)!.targetLanguage), - ]), + L10n.of(context)!.targetLanguage,), + ],), trailing: const Icon(Icons.edit_outlined), onTap: () => pLanguageDialog(context, () {}), ); diff --git a/lib/pangea/widgets/user_settings/p_language_dialog.dart b/lib/pangea/widgets/user_settings/p_language_dialog.dart index 94f20f2f3..9f66fbe42 100644 --- a/lib/pangea/widgets/user_settings/p_language_dialog.dart +++ b/lib/pangea/widgets/user_settings/p_language_dialog.dart @@ -40,7 +40,7 @@ pLanguageDialog(BuildContext parentContext, Function callback) { mainAxisSize: MainAxisSize.min, children: [ PQuestionContainer( - title: L10n.of(parentContext)!.whatIsYourBaseLanguage), + title: L10n.of(parentContext)!.whatIsYourBaseLanguage,), PLanguageDropdown( onChange: (p0) => setState(() => selectedSourceLanguage = p0), @@ -49,7 +49,7 @@ pLanguageDialog(BuildContext parentContext, Function callback) { ), PQuestionContainer( title: - L10n.of(parentContext)!.whatLanguageYouWantToLearn), + L10n.of(parentContext)!.whatLanguageYouWantToLearn,), PLanguageDropdown( onChange: (p0) => setState(() => selectedTargetLanguage = p0), @@ -95,7 +95,7 @@ pLanguageDialog(BuildContext parentContext, Function callback) { : ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - L10n.of(parentContext)!.noIdenticalLanguages), + L10n.of(parentContext)!.noIdenticalLanguages,), backgroundColor: Theme.of(context).colorScheme.primary, ), diff --git a/lib/pangea/widgets/user_settings/p_question_container.dart b/lib/pangea/widgets/user_settings/p_question_container.dart index ac6c48409..e68f4f455 100644 --- a/lib/pangea/widgets/user_settings/p_question_container.dart +++ b/lib/pangea/widgets/user_settings/p_question_container.dart @@ -13,7 +13,7 @@ class PQuestionContainer extends StatelessWidget { child: Text( title, style: const TextStyle().copyWith( - color: Theme.of(context).textTheme.bodyText1!.color, fontSize: 14), + color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 14,), overflow: TextOverflow.clip, textAlign: TextAlign.left, ), diff --git a/lib/pangea/widgets/user_settings/p_settings_switch_list_tile.dart b/lib/pangea/widgets/user_settings/p_settings_switch_list_tile.dart index 047782175..1ae2277a0 100644 --- a/lib/pangea/widgets/user_settings/p_settings_switch_list_tile.dart +++ b/lib/pangea/widgets/user_settings/p_settings_switch_list_tile.dart @@ -11,12 +11,12 @@ class PSettingsSwitchListTile extends StatefulWidget { final String? subtitle; const PSettingsSwitchListTile.adaptive({ - Key? key, + super.key, this.defaultValue = false, required this.pStoreKey, required this.title, this.subtitle, - }) : super(key: key); + }); @override PSettingsSwitchListTileState createState() => PSettingsSwitchListTileState(); diff --git a/lib/pangea/word_cloud/word_cloud_tap_view.dart b/lib/pangea/word_cloud/word_cloud_tap_view.dart index 115ca3a84..6f299853b 100644 --- a/lib/pangea/word_cloud/word_cloud_tap_view.dart +++ b/lib/pangea/word_cloud/word_cloud_tap_view.dart @@ -65,7 +65,7 @@ class _WordCloudTapViewState extends State { wordcloudsetting.setMapSize(widget.mapwidth, widget.mapheight); wordcloudsetting.setFont( - widget.fontFamily, widget.fontStyle, widget.fontWeight); + widget.fontFamily, widget.fontStyle, widget.fontWeight,); wordcloudsetting.setColorList(widget.colorlist); wordcloudsetting.setInitial(); wordcloudsetting.drawTextOptimized(); @@ -117,7 +117,7 @@ class WCTpaint extends CustomPainter { wordcloudpaint.getTextPainter()[i].paint( canvas, Offset(wordcloudpaint.getWordPoint()[i][0], - wordcloudpaint.getWordPoint()[i][1])); + wordcloudpaint.getWordPoint()[i][1],),); } } } diff --git a/lib/pangea/word_cloud/word_cloud_view.dart b/lib/pangea/word_cloud/word_cloud_view.dart index 94458d1fb..b86ddf5a5 100644 --- a/lib/pangea/word_cloud/word_cloud_view.dart +++ b/lib/pangea/word_cloud/word_cloud_view.dart @@ -62,7 +62,7 @@ class _WordCloudViewState extends State { wordcloudsetting.setMapSize(widget.mapwidth, widget.mapheight); wordcloudsetting.setFont( - widget.fontFamily, widget.fontStyle, widget.fontWeight); + widget.fontFamily, widget.fontStyle, widget.fontWeight,); wordcloudsetting.setColorList(widget.colorlist); wordcloudsetting.setInitial(); @@ -96,7 +96,7 @@ class WCpaint extends CustomPainter { wordcloudpaint.getTextPainter()[i].paint( canvas, Offset(wordcloudpaint.getWordPoint()[i][0], - wordcloudpaint.getWordPoint()[i][1])); + wordcloudpaint.getWordPoint()[i][1],),); } } } diff --git a/lib/widgets/profile_bottom_sheet.dart b/lib/widgets/profile_bottom_sheet.dart index 1cfee2086..3bfbb2029 100644 --- a/lib/widgets/profile_bottom_sheet.dart +++ b/lib/widgets/profile_bottom_sheet.dart @@ -15,8 +15,8 @@ class ProfileBottomSheet extends StatelessWidget { const ProfileBottomSheet({ required this.userId, required this.outerContext, - Key? key, - }) : super(key: key); + super.key, + }); void _startDirectChat(BuildContext context) async { final client = Matrix.of(context).client;