diff --git a/filcnaplo/lib/app.dart b/filcnaplo/lib/app.dart index 39d0870..124aa98 100644 --- a/filcnaplo/lib/app.dart +++ b/filcnaplo/lib/app.dart @@ -62,11 +62,10 @@ class App extends StatelessWidget { final DatabaseProvider database; const App( - {Key? key, + {super.key, required this.database, required this.settings, - required this.user}) - : super(key: key); + required this.user}); @override Widget build(BuildContext context) { diff --git a/filcnaplo/lib/main.dart b/filcnaplo/lib/main.dart index f7996e1..8368e77 100644 --- a/filcnaplo/lib/main.dart +++ b/filcnaplo/lib/main.dart @@ -17,7 +17,7 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart'; void main() async { // Initalize WidgetsBinding binding = WidgetsFlutterBinding.ensureInitialized(); - binding.renderView.automaticSystemUiAdjustment = false; + binding.renderViews.first.automaticSystemUiAdjustment = false; SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); // Startup Startup startup = Startup(); diff --git a/filcnaplo/lib/ui/flutter_colorpicker/block_picker.dart b/filcnaplo/lib/ui/flutter_colorpicker/block_picker.dart index dbf27f8..77b7ce3 100644 --- a/filcnaplo/lib/ui/flutter_colorpicker/block_picker.dart +++ b/filcnaplo/lib/ui/flutter_colorpicker/block_picker.dart @@ -87,13 +87,13 @@ Widget _defaultItemBuilder(Color color, bool isCurrentColor, void Function() cha // The blocky color picker you can alter the layout and shape. class BlockPicker extends StatefulWidget { BlockPicker({ - Key? key, + super.key, required this.pickerColor, required this.onColorChanged, this.useInShowDialog = true, this.layoutBuilder = _defaultLayoutBuilder, this.itemBuilder = _defaultItemBuilder, - }) : super(key: key); + }); final Color? pickerColor; final ValueChanged onColorChanged; diff --git a/filcnaplo/lib/ui/flutter_colorpicker/colorpicker.dart b/filcnaplo/lib/ui/flutter_colorpicker/colorpicker.dart index 9b5e837..b727996 100644 --- a/filcnaplo/lib/ui/flutter_colorpicker/colorpicker.dart +++ b/filcnaplo/lib/ui/flutter_colorpicker/colorpicker.dart @@ -7,6 +7,8 @@ /// /// You can create your own layout by importing `picker.dart`. +// ignore_for_file: use_build_context_synchronously + library hsv_picker; import 'package:filcnaplo/models/shared_theme.dart'; @@ -24,7 +26,7 @@ import 'package:provider/provider.dart'; class FilcColorPicker extends StatefulWidget { const FilcColorPicker({ - Key? key, + super.key, required this.colorMode, required this.pickerColor, required this.onColorChanged, @@ -53,7 +55,7 @@ class FilcColorPicker extends StatefulWidget { this.colorHistory, this.onHistoryChanged, required this.onThemeIdProvided, - }) : super(key: key); + }); final CustomColorMode colorMode; final Color pickerColor; @@ -78,10 +80,10 @@ class FilcColorPicker extends StatefulWidget { final void Function(SharedTheme theme) onThemeIdProvided; @override - _FilcColorPickerState createState() => _FilcColorPickerState(); + FilcColorPickerState createState() => FilcColorPickerState(); } -class _FilcColorPickerState extends State { +class FilcColorPickerState extends State { final idController = TextEditingController(); late final ShareProvider shareProvider; diff --git a/filcnaplo/lib/ui/flutter_colorpicker/palette.dart b/filcnaplo/lib/ui/flutter_colorpicker/palette.dart index fb33f69..ffbf1b5 100644 --- a/filcnaplo/lib/ui/flutter_colorpicker/palette.dart +++ b/filcnaplo/lib/ui/flutter_colorpicker/palette.dart @@ -3,6 +3,7 @@ // FROM: https://pub.dev/packages/flutter_colorpicker // FROM: https://pub.dev/packages/flutter_colorpicker +// ignore: dangling_library_doc_comments /// The components of HSV Color Picker /// /// Try to create a Color Picker with other layout on your own :) @@ -317,11 +318,11 @@ class ColorPickerInput extends StatefulWidget { const ColorPickerInput( this.color, this.onColorChanged, { - Key? key, + super.key, this.enableAlpha = true, this.embeddedText = false, this.disable = false, - }) : super(key: key); + }); final Color color; final ValueChanged onColorChanged; @@ -330,10 +331,10 @@ class ColorPickerInput extends StatefulWidget { final bool disable; @override - _ColorPickerInputState createState() => _ColorPickerInputState(); + ColorPickerInputState createState() => ColorPickerInputState(); } -class _ColorPickerInputState extends State { +class ColorPickerInputState extends State { TextEditingController textEditingController = TextEditingController(); int inputColor = 0; @@ -346,11 +347,7 @@ class _ColorPickerInputState extends State { @override Widget build(BuildContext context) { if (inputColor != widget.color.value) { - textEditingController.text = '#' + - widget.color.red.toRadixString(16).toUpperCase().padLeft(2, '0') + - widget.color.green.toRadixString(16).toUpperCase().padLeft(2, '0') + - widget.color.blue.toRadixString(16).toUpperCase().padLeft(2, '0') + - (widget.enableAlpha ? widget.color.alpha.toRadixString(16).toUpperCase().padLeft(2, '0') : ''); + textEditingController.text = '#${widget.color.red.toRadixString(16).toUpperCase().padLeft(2, '0')}${widget.color.green.toRadixString(16).toUpperCase().padLeft(2, '0')}${widget.color.blue.toRadixString(16).toUpperCase().padLeft(2, '0')}${widget.enableAlpha ? widget.color.alpha.toRadixString(16).toUpperCase().padLeft(2, '0') : ''}'; } return Padding( padding: const EdgeInsets.only(top: 6.0, left: 12.0, right: 12.0), @@ -516,10 +513,10 @@ class ColorPickerSlider extends StatelessWidget { this.onColorChanged, this.onColorChangeEnd, this.onProblem, { - Key? key, + super.key, this.displayThumbColor = false, this.fullThumbColor = false, - }) : super(key: key); + }); final TrackType trackType; final HSVColor hsvColor; @@ -657,13 +654,13 @@ class ColorPickerSlider extends StatelessWidget { class ColorIndicator extends StatelessWidget { const ColorIndicator( this.hsvColor, { - Key? key, + super.key, this.currentHsvColor, this.icon, this.width = 50.0, this.height = 50.0, this.adaptive = false, - }) : super(key: key); + }); final HSVColor hsvColor; final HSVColor? currentHsvColor; @@ -711,8 +708,8 @@ class ColorPickerArea extends StatelessWidget { this.onColorChanged, this.onChangeEnd, this.paletteType, { - Key? key, - }) : super(key: key); + super.key, + }); final HSVColor hsvColor; final ValueChanged onColorChanged; diff --git a/filcnaplo/lib/ui/flutter_colorpicker/utils.dart b/filcnaplo/lib/ui/flutter_colorpicker/utils.dart index 5e413a7..92e422e 100644 --- a/filcnaplo/lib/ui/flutter_colorpicker/utils.dart +++ b/filcnaplo/lib/ui/flutter_colorpicker/utils.dart @@ -3,6 +3,7 @@ // FROM: https://pub.dev/packages/flutter_colorpicker // FROM: https://pub.dev/packages/flutter_colorpicker +// ignore: dangling_library_doc_comments /// Common function lib import 'dart:math'; diff --git a/filcnaplo/lib/ui/widgets/grade/grade_tile.dart b/filcnaplo/lib/ui/widgets/grade/grade_tile.dart index a42a404..d31a2d4 100644 --- a/filcnaplo/lib/ui/widgets/grade/grade_tile.dart +++ b/filcnaplo/lib/ui/widgets/grade/grade_tile.dart @@ -12,12 +12,12 @@ import 'package:provider/provider.dart'; class GradeTile extends StatelessWidget { const GradeTile( this.grade, { - Key? key, + super.key, this.onTap, this.padding, this.censored = false, this.viewOverride = false, - }) : super(key: key); + }); final Grade grade; final void Function()? onTap; @@ -194,7 +194,7 @@ class GradeTile extends StatelessWidget { class GradeValueWidget extends StatelessWidget { const GradeValueWidget( this.value, { - Key? key, + super.key, this.size = 38.0, this.fill = false, this.contrast = false, @@ -203,7 +203,7 @@ class GradeValueWidget extends StatelessWidget { this.complemented = false, this.nocolor = false, this.color, - }) : super(key: key); + }); final GradeValue value; final double size; diff --git a/filcnaplo/lib/ui/widgets/lesson/lesson_tile.dart b/filcnaplo/lib/ui/widgets/lesson/lesson_tile.dart index 1aeb3ef..59e7547 100644 --- a/filcnaplo/lib/ui/widgets/lesson/lesson_tile.dart +++ b/filcnaplo/lib/ui/widgets/lesson/lesson_tile.dart @@ -16,8 +16,7 @@ import 'package:provider/provider.dart'; import 'lesson_tile.i18n.dart'; class LessonTile extends StatelessWidget { - const LessonTile(this.lesson, {Key? key, this.onTap, this.swapDesc = false}) - : super(key: key); + const LessonTile(this.lesson, {super.key, this.onTap, this.swapDesc = false}); final Lesson lesson; final bool swapDesc; @@ -287,8 +286,7 @@ enum LessonSubtileType { homework, exam, absence } class LessonSubtile extends StatelessWidget { const LessonSubtile( - {Key? key, this.onPressed, required this.title, required this.type}) - : super(key: key); + {super.key, this.onPressed, required this.title, required this.type}); final Function()? onPressed; final String title; diff --git a/filcnaplo/lib/ui/widgets/message/message_tile.dart b/filcnaplo/lib/ui/widgets/message/message_tile.dart index f866a34..4247fc9 100644 --- a/filcnaplo/lib/ui/widgets/message/message_tile.dart +++ b/filcnaplo/lib/ui/widgets/message/message_tile.dart @@ -11,12 +11,12 @@ import 'package:provider/provider.dart'; class MessageTile extends StatelessWidget { const MessageTile( this.message, { - Key? key, + super.key, this.messages, this.padding, this.onTap, this.censored = false, - }) : super(key: key); + }); final Message message; final List? messages; diff --git a/filcnaplo_kreta_api/lib/controllers/timetable_controller.dart b/filcnaplo_kreta_api/lib/controllers/timetable_controller.dart index 208f080..acd8da4 100644 --- a/filcnaplo_kreta_api/lib/controllers/timetable_controller.dart +++ b/filcnaplo_kreta_api/lib/controllers/timetable_controller.dart @@ -1,4 +1,4 @@ -// ignore_for_file: avoid_print +// ignore_for_file: avoid_print, use_build_context_synchronously import 'dart:async'; import 'dart:developer'; diff --git a/filcnaplo_kreta_api/lib/models/grade.dart b/filcnaplo_kreta_api/lib/models/grade.dart index 35d6709..16877b8 100644 --- a/filcnaplo_kreta_api/lib/models/grade.dart +++ b/filcnaplo_kreta_api/lib/models/grade.dart @@ -1,3 +1,5 @@ +// ignore_for_file: no_leading_underscores_for_local_identifiers + import 'package:filcnaplo/utils/format.dart'; import 'category.dart'; import 'subject.dart'; diff --git a/filcnaplo_kreta_api/lib/models/week.dart b/filcnaplo_kreta_api/lib/models/week.dart index 03cc048..2a162bd 100644 --- a/filcnaplo_kreta_api/lib/models/week.dart +++ b/filcnaplo_kreta_api/lib/models/week.dart @@ -1,3 +1,5 @@ +// ignore_for_file: no_leading_underscores_for_local_identifiers + import 'package:filcnaplo_kreta_api/controllers/timetable_controller.dart'; class Week { diff --git a/filcnaplo_kreta_api/lib/providers/absence_provider.dart b/filcnaplo_kreta_api/lib/providers/absence_provider.dart index 6450953..1688550 100644 --- a/filcnaplo_kreta_api/lib/providers/absence_provider.dart +++ b/filcnaplo_kreta_api/lib/providers/absence_provider.dart @@ -1,3 +1,5 @@ +// ignore_for_file: no_leading_underscores_for_local_identifiers + import 'package:filcnaplo/api/providers/user_provider.dart'; import 'package:filcnaplo/api/providers/database_provider.dart'; import 'package:filcnaplo/models/user.dart'; @@ -49,6 +51,7 @@ class AbsenceProvider with ChangeNotifier { (await _database.query.getSettings(_database)).renamedTeachersEnabled ? await _database.userQuery.renamedTeachers( userId: + // ignore: use_build_context_synchronously Provider.of(_context, listen: false).user!.id) : {}; diff --git a/filcnaplo_kreta_api/lib/providers/exam_provider.dart b/filcnaplo_kreta_api/lib/providers/exam_provider.dart index e74de29..8690ca1 100644 --- a/filcnaplo_kreta_api/lib/providers/exam_provider.dart +++ b/filcnaplo_kreta_api/lib/providers/exam_provider.dart @@ -49,6 +49,7 @@ class ExamProvider with ChangeNotifier { (await database.query.getSettings(database)).renamedTeachersEnabled ? await database.userQuery.renamedTeachers( userId: + // ignore: use_build_context_synchronously Provider.of(_context, listen: false).user!.id) : {}; diff --git a/filcnaplo_mobile_ui/lib/common/action_button.dart b/filcnaplo_mobile_ui/lib/common/action_button.dart index fc316a1..6515941 100755 --- a/filcnaplo_mobile_ui/lib/common/action_button.dart +++ b/filcnaplo_mobile_ui/lib/common/action_button.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; class ActionButton extends StatelessWidget { - const ActionButton({Key? key, required this.label, this.activeColor, this.onTap}) : super(key: key); + const ActionButton({super.key, required this.label, this.activeColor, this.onTap}); final Color? activeColor; final void Function()? onTap; diff --git a/filcnaplo_mobile_ui/lib/common/average_display.dart b/filcnaplo_mobile_ui/lib/common/average_display.dart index 735497e..15d60c7 100755 --- a/filcnaplo_mobile_ui/lib/common/average_display.dart +++ b/filcnaplo_mobile_ui/lib/common/average_display.dart @@ -4,8 +4,7 @@ import 'package:flutter/material.dart'; import 'package:i18n_extension/i18n_widget.dart'; class AverageDisplay extends StatelessWidget { - const AverageDisplay({Key? key, this.average = 0.0, this.border = false}) - : super(key: key); + const AverageDisplay({super.key, this.average = 0.0, this.border = false}); final double average; final bool border; diff --git a/filcnaplo_mobile_ui/lib/common/beta_chip.dart b/filcnaplo_mobile_ui/lib/common/beta_chip.dart index 9b4c0e8..1d35da6 100644 --- a/filcnaplo_mobile_ui/lib/common/beta_chip.dart +++ b/filcnaplo_mobile_ui/lib/common/beta_chip.dart @@ -2,7 +2,7 @@ import 'package:filcnaplo/theme/colors/colors.dart'; import 'package:flutter/material.dart'; class BetaChip extends StatelessWidget { - const BetaChip({Key? key, this.disabled = false}) : super(key: key); + const BetaChip({super.key, this.disabled = false}); final bool disabled; @@ -12,6 +12,12 @@ class BetaChip extends StatelessWidget { height: 25, child: AnimatedContainer( duration: const Duration(milliseconds: 200), + decoration: BoxDecoration( + color: !disabled + ? Theme.of(context).colorScheme.secondary + : AppColors.of(context).text.withOpacity(.25), + borderRadius: BorderRadius.circular(40), + ), child: Padding( padding: const EdgeInsets.only(left: 8, right: 8), child: Center( @@ -29,12 +35,6 @@ class BetaChip extends StatelessWidget { ), ), ), - decoration: BoxDecoration( - color: !disabled - ? Theme.of(context).colorScheme.secondary - : AppColors.of(context).text.withOpacity(.25), - borderRadius: BorderRadius.circular(40), - ), ), ); } diff --git a/filcnaplo_mobile_ui/lib/common/bottom_card.dart b/filcnaplo_mobile_ui/lib/common/bottom_card.dart index 82c4c86..9c01341 100755 --- a/filcnaplo_mobile_ui/lib/common/bottom_card.dart +++ b/filcnaplo_mobile_ui/lib/common/bottom_card.dart @@ -2,7 +2,7 @@ import 'package:filcnaplo/theme/colors/colors.dart'; import 'package:flutter/material.dart'; class BottomCard extends StatelessWidget { - const BottomCard({Key? key, this.child}) : super(key: key); + const BottomCard({super.key, this.child}); final Widget? child; diff --git a/filcnaplo_mobile_ui/lib/common/bottom_sheet_menu/bottom_sheet_menu.dart b/filcnaplo_mobile_ui/lib/common/bottom_sheet_menu/bottom_sheet_menu.dart index c447ee7..8b4ca2e 100755 --- a/filcnaplo_mobile_ui/lib/common/bottom_sheet_menu/bottom_sheet_menu.dart +++ b/filcnaplo_mobile_ui/lib/common/bottom_sheet_menu/bottom_sheet_menu.dart @@ -2,7 +2,7 @@ import 'package:filcnaplo_mobile_ui/common/bottom_sheet_menu/rounded_bottom_shee import 'package:flutter/material.dart'; class BottomSheetMenu extends StatelessWidget { - const BottomSheetMenu({Key? key, this.items = const []}) : super(key: key); + const BottomSheetMenu({super.key, this.items = const []}); final List items; diff --git a/filcnaplo_mobile_ui/lib/common/bottom_sheet_menu/bottom_sheet_menu_item.dart b/filcnaplo_mobile_ui/lib/common/bottom_sheet_menu/bottom_sheet_menu_item.dart index 525feea..2f8f21c 100755 --- a/filcnaplo_mobile_ui/lib/common/bottom_sheet_menu/bottom_sheet_menu_item.dart +++ b/filcnaplo_mobile_ui/lib/common/bottom_sheet_menu/bottom_sheet_menu_item.dart @@ -2,7 +2,7 @@ import 'package:filcnaplo_mobile_ui/common/panel/panel_button.dart'; import 'package:flutter/material.dart'; class BottomSheetMenuItem extends StatelessWidget { - const BottomSheetMenuItem({Key? key, required this.onPressed, required this.title, this.icon}) : super(key: key); + const BottomSheetMenuItem({super.key, required this.onPressed, required this.title, this.icon}); final void Function()? onPressed; final Widget? title; diff --git a/filcnaplo_mobile_ui/lib/common/custom_snack_bar.dart b/filcnaplo_mobile_ui/lib/common/custom_snack_bar.dart index 2f56809..b7c4349 100755 --- a/filcnaplo_mobile_ui/lib/common/custom_snack_bar.dart +++ b/filcnaplo_mobile_ui/lib/common/custom_snack_bar.dart @@ -10,6 +10,7 @@ SnackBar CustomSnackBar({ Duration? duration, }) { // backgroundColor > Brightness > Theme Background + // ignore: no_leading_underscores_for_local_identifiers Color _backgroundColor = backgroundColor ?? (AppColors.fromBrightness(brightness ?? Theme.of(context).brightness).highlight); Color textColor = AppColors.fromBrightness(brightness ?? Theme.of(context).brightness).text; diff --git a/filcnaplo_mobile_ui/lib/common/widgets/grade/new_grades.dart b/filcnaplo_mobile_ui/lib/common/widgets/grade/new_grades.dart index 84b319e..07f7fd7 100755 --- a/filcnaplo_mobile_ui/lib/common/widgets/grade/new_grades.dart +++ b/filcnaplo_mobile_ui/lib/common/widgets/grade/new_grades.dart @@ -1,3 +1,5 @@ +// ignore_for_file: use_build_context_synchronously + import 'package:filcnaplo/models/settings.dart'; import 'package:filcnaplo/theme/colors/colors.dart'; import 'package:filcnaplo_kreta_api/models/grade.dart'; diff --git a/filcnaplo_mobile_ui/lib/common/widgets/note/note_view.dart b/filcnaplo_mobile_ui/lib/common/widgets/note/note_view.dart index 64680af..2f02f6c 100755 --- a/filcnaplo_mobile_ui/lib/common/widgets/note/note_view.dart +++ b/filcnaplo_mobile_ui/lib/common/widgets/note/note_view.dart @@ -8,7 +8,7 @@ import 'package:flutter_custom_tabs/flutter_custom_tabs.dart'; import 'package:flutter_linkify/flutter_linkify.dart'; class NoteView extends StatelessWidget { - const NoteView(this.note, {Key? key}) : super(key: key); + const NoteView(this.note, {super.key}); final Note note; diff --git a/filcnaplo_mobile_ui/lib/common/widgets/note/note_viewable.dart b/filcnaplo_mobile_ui/lib/common/widgets/note/note_viewable.dart index 8208845..9d2e886 100755 --- a/filcnaplo_mobile_ui/lib/common/widgets/note/note_viewable.dart +++ b/filcnaplo_mobile_ui/lib/common/widgets/note/note_viewable.dart @@ -4,7 +4,7 @@ import 'package:filcnaplo_mobile_ui/common/widgets/note/note_view.dart'; import 'package:flutter/material.dart'; class NoteViewable extends StatelessWidget { - const NoteViewable(this.note, {Key? key}) : super(key: key); + const NoteViewable(this.note, {super.key}); final Note note;