fixed weird warnings

This commit is contained in:
Kima 2023-12-09 16:52:52 +01:00
parent 646948012d
commit 5079e0cb29
24 changed files with 58 additions and 51 deletions

View File

@ -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) {

View File

@ -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();

View File

@ -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<Color> onColorChanged;

View File

@ -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<FilcColorPicker> {
class FilcColorPickerState extends State<FilcColorPicker> {
final idController = TextEditingController();
late final ShareProvider shareProvider;

View File

@ -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<Color> onColorChanged;
@ -330,10 +331,10 @@ class ColorPickerInput extends StatefulWidget {
final bool disable;
@override
_ColorPickerInputState createState() => _ColorPickerInputState();
ColorPickerInputState createState() => ColorPickerInputState();
}
class _ColorPickerInputState extends State<ColorPickerInput> {
class ColorPickerInputState extends State<ColorPickerInput> {
TextEditingController textEditingController = TextEditingController();
int inputColor = 0;
@ -346,11 +347,7 @@ class _ColorPickerInputState extends State<ColorPickerInput> {
@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<HSVColor> onColorChanged;

View File

@ -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';

View File

@ -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;

View File

@ -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;

View File

@ -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<Message>? messages;

View File

@ -1,4 +1,4 @@
// ignore_for_file: avoid_print
// ignore_for_file: avoid_print, use_build_context_synchronously
import 'dart:async';
import 'dart:developer';

View File

@ -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';

View File

@ -1,3 +1,5 @@
// ignore_for_file: no_leading_underscores_for_local_identifiers
import 'package:filcnaplo_kreta_api/controllers/timetable_controller.dart';
class Week {

View File

@ -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<UserProvider>(_context, listen: false).user!.id)
: {};

View File

@ -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<UserProvider>(_context, listen: false).user!.id)
: {};

View File

@ -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;

View File

@ -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;

View File

@ -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),
),
),
);
}

View File

@ -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;

View File

@ -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<Widget> items;

View File

@ -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;

View File

@ -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;

View File

@ -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';

View File

@ -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;

View File

@ -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;