CONVERT KEY TO SUPER PARAMETER KYS

This commit is contained in:
Kima
2023-12-09 15:42:02 +01:00
parent e243b5c186
commit 51a6492477
71 changed files with 235 additions and 219 deletions

View File

@@ -2,7 +2,7 @@ import 'package:filcnaplo/theme/colors/colors.dart';
import 'package:flutter/material.dart';
class RoundedBottomSheet extends StatelessWidget {
const RoundedBottomSheet({Key? key, this.child, this.borderRadius = 12.0, this.shrink = true, this.showHandle = true}) : super(key: key);
const RoundedBottomSheet({super.key, this.child, this.borderRadius = 12.0, this.shrink = true, this.showHandle = true});
final Widget? child;
final double borderRadius;

View File

@@ -2,7 +2,7 @@ import 'package:filcnaplo/theme/colors/colors.dart';
import 'package:flutter/material.dart';
class Detail extends StatelessWidget {
const Detail({Key? key, required this.title, required this.description, this.maxLines = 3}) : super(key: key);
const Detail({super.key, required this.title, required this.description, this.maxLines = 3});
final String title;
final String description;

View File

@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
class DialogButton extends StatelessWidget {
const DialogButton({Key? key, required this.label, this.onTap}) : super(key: key);
const DialogButton({super.key, required this.label, this.onTap});
final String label;
final Function()? onTap;

View File

@@ -4,7 +4,7 @@ class Dot extends StatelessWidget {
final Color color;
final double size;
const Dot({Key? key, this.color = Colors.grey, this.size = 16.0}) : super(key: key);
const Dot({super.key, this.color = Colors.grey, this.size = 16.0});
@override
Widget build(BuildContext context) {

View File

@@ -17,7 +17,7 @@ List<String> faces = [
];
class Empty extends StatelessWidget {
const Empty({Key? key, this.subtitle}) : super(key: key);
const Empty({super.key, this.subtitle});
final String? subtitle;
@@ -38,7 +38,7 @@ class Empty extends StatelessWidget {
children: subtitle != null
? [
TextSpan(
text: "\n" + subtitle!,
text: "\n${subtitle!}",
style: TextStyle(
fontSize: 18.0,
height: 2.0,

View File

@@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
class FilterBar extends StatefulWidget implements PreferredSizeWidget {
const FilterBar({
Key? key,
super.key,
required this.items,
required this.controller,
this.onTap,
@@ -13,8 +13,7 @@ class FilterBar extends StatefulWidget implements PreferredSizeWidget {
this.disableFading = false,
this.scrollable = true,
this.censored = false,
}) : assert(items.length == controller.length),
super(key: key);
}) : assert(items.length == controller.length);
final List<Widget> items;
final TabController controller;

View File

@@ -4,7 +4,7 @@ import 'package:filcnaplo/utils/format.dart';
class HeroScrollView extends StatefulWidget {
const HeroScrollView(
{Key? key,
{super.key,
required this.child,
required this.title,
required this.icon,
@@ -12,8 +12,7 @@ class HeroScrollView extends StatefulWidget {
this.navBarItems = const [],
this.onClose,
this.iconSize = 64.0,
this.scrollController})
: super(key: key);
this.scrollController});
final Widget child;
final String title;
@@ -25,10 +24,10 @@ class HeroScrollView extends StatefulWidget {
final bool italic;
@override
_HeroScrollViewState createState() => _HeroScrollViewState();
HeroScrollViewState createState() => HeroScrollViewState();
}
class _HeroScrollViewState extends State<HeroScrollView> {
class HeroScrollViewState extends State<HeroScrollView> {
late ScrollController _scrollController;
bool showBarTitle = false;
@@ -69,6 +68,7 @@ class _HeroScrollViewState extends State<HeroScrollView> {
surfaceTintColor: Theme.of(context).scaffoldBackgroundColor,
title: AnimatedOpacity(
opacity: showBarTitle ? 1.0 : 0.0,
duration: const Duration(milliseconds: 200),
child: Row(
children: [
Icon(widget.icon,
@@ -86,8 +86,7 @@ class _HeroScrollViewState extends State<HeroScrollView> {
),
),
],
),
duration: const Duration(milliseconds: 200)),
)),
leading: BackButton(
color: AppColors.of(context).text,
onPressed: () {

View File

@@ -4,11 +4,11 @@ import 'package:flutter/material.dart';
class MaterialActionButton extends StatelessWidget {
const MaterialActionButton({
Key? key,
super.key,
required this.child,
this.onPressed,
this.backgroundColor,
}) : super(key: key);
});
final Widget child;
final Function()? onPressed;
@@ -19,17 +19,17 @@ class MaterialActionButton extends StatelessWidget {
return RawMaterialButton(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
shape: const StadiumBorder(),
child: DefaultTextStyle(
child: child,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontWeight: FontWeight.w600,
color: backgroundColor != null ? ColorUtils.foregroundColor(backgroundColor!) : null,
),
),
fillColor: backgroundColor ?? AppColors.of(context).text.withOpacity(.15),
elevation: 0,
highlightElevation: 0,
onPressed: onPressed,
child: DefaultTextStyle(
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontWeight: FontWeight.w600,
color: backgroundColor != null ? ColorUtils.foregroundColor(backgroundColor!) : null,
),
child: child,
),
);
}
}

View File

@@ -2,7 +2,7 @@ import 'package:filcnaplo/theme/colors/colors.dart';
import 'package:flutter/material.dart';
class NewContentIndicator extends StatelessWidget {
const NewContentIndicator({Key? key, this.size = 64.0}) : super(key: key);
const NewContentIndicator({super.key, this.size = 64.0});
final double size;

View File

@@ -5,8 +5,7 @@ import 'package:provider/provider.dart';
class Panel extends StatelessWidget {
const Panel(
{Key? key, this.child, this.title, this.padding, this.hasShadow = true})
: super(key: key);
{super.key, this.child, this.title, this.padding, this.hasShadow = true});
final Widget? child;
final Widget? title;
@@ -48,7 +47,7 @@ class Panel extends StatelessWidget {
}
class PanelTitle extends StatelessWidget {
const PanelTitle({Key? key, required this.title}) : super(key: key);
const PanelTitle({super.key, required this.title});
final Widget title;
@@ -67,7 +66,7 @@ class PanelTitle extends StatelessWidget {
}
class PanelHeader extends StatelessWidget {
const PanelHeader({Key? key, required this.padding}) : super(key: key);
const PanelHeader({super.key, required this.padding});
final EdgeInsetsGeometry padding;
@@ -95,7 +94,7 @@ class PanelHeader extends StatelessWidget {
}
class PanelBody extends StatelessWidget {
const PanelBody({Key? key, this.child, this.padding}) : super(key: key);
const PanelBody({super.key, this.child, this.padding});
final Widget? child;
final EdgeInsetsGeometry? padding;
@@ -123,7 +122,7 @@ class PanelBody extends StatelessWidget {
}
class PanelFooter extends StatelessWidget {
const PanelFooter({Key? key, required this.padding}) : super(key: key);
const PanelFooter({super.key, required this.padding});
final EdgeInsetsGeometry padding;

View File

@@ -2,13 +2,13 @@ import 'package:flutter/material.dart';
class PanelActionButton extends StatelessWidget {
const PanelActionButton({
Key? key,
super.key,
this.onPressed,
this.padding = const EdgeInsets.symmetric(horizontal: 14.0),
this.leading,
this.title,
this.trailing,
}) : super(key: key);
});
final void Function()? onPressed;
final EdgeInsetsGeometry padding;

View File

@@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
class PanelButton extends StatelessWidget {
const PanelButton({
Key? key,
super.key,
this.onPressed,
this.padding = const EdgeInsets.symmetric(horizontal: 14.0),
this.leading,
@@ -13,7 +13,7 @@ class PanelButton extends StatelessWidget {
this.trailing,
this.background = false,
this.trailingDivider = false,
}) : super(key: key);
});
final void Function()? onPressed;
final EdgeInsetsGeometry padding;

View File

@@ -5,9 +5,9 @@ import 'package:provider/provider.dart';
class EmptyCard extends StatefulWidget {
const EmptyCard({
Key? key,
super.key,
required this.text,
}) : super(key: key);
});
final String text;

View File

@@ -18,9 +18,9 @@ import 'personality_card.i18n.dart';
class PersonalityCard extends StatefulWidget {
const PersonalityCard({
Key? key,
super.key,
required this.user,
}) : super(key: key);
});
final UserProvider user;

View File

@@ -17,7 +17,7 @@ import 'package:provider/provider.dart';
import 'package:wtf_sliding_sheet/wtf_sliding_sheet.dart';
class ProfileButton extends StatelessWidget {
const ProfileButton({Key? key, required this.child}) : super(key: key);
const ProfileButton({super.key, required this.child});
final ProfileImage child;

View File

@@ -8,7 +8,7 @@ import 'package:filcnaplo/utils/color.dart';
class ProfileImage extends StatefulWidget {
const ProfileImage({
Key? key,
super.key,
this.onTap,
this.onDoubleTap,
this.onLongPress,
@@ -20,7 +20,7 @@ class ProfileImage extends StatefulWidget {
this.role = Role.student,
this.censored = false,
this.profilePictureString = "",
}) : super(key: key);
});
final void Function()? onTap;
final void Function()? onDoubleTap;
@@ -176,7 +176,7 @@ class _ProfileImageState extends State<ProfileImage> {
children: [
if (widget.name != null && (widget.name?.trim().length ?? 0) > 0)
Hero(
tag: widget.heroTag! + "background",
tag: "${widget.heroTag!}background",
transitionOnUserGestures: true,
child: Material(
clipBehavior: Clip.hardEdge,
@@ -197,27 +197,27 @@ class _ProfileImageState extends State<ProfileImage> {
),
),
Hero(
tag: widget.heroTag! + "child",
tag: "${widget.heroTag!}child",
transitionOnUserGestures: true,
child: Material(
clipBehavior: Clip.hardEdge,
shape: profilePicture != null ? const CircleBorder() : null,
child: profilePicture ?? child,
type: MaterialType.transparency,
child: profilePicture ?? child,
),
),
// Badge
if (widget.badge)
Hero(
tag: widget.heroTag! + "new_content_indicator",
tag: "${widget.heroTag!}new_content_indicator",
child: NewContentIndicator(size: widget.radius * 2),
),
// Role indicator
if (widget.role == Role.parent)
Hero(
tag: widget.heroTag! + "role_indicator",
tag: "${widget.heroTag!}role_indicator",
child: FittedBox(
fit: BoxFit.fitHeight,
child: SizedBox(

View File

@@ -2,8 +2,7 @@ import 'package:flutter/material.dart';
class ProgressBar extends StatelessWidget {
const ProgressBar(
{Key? key, required this.value, this.backgroundColor, this.height = 8.0})
: super(key: key);
{super.key, required this.value, this.backgroundColor, this.height = 8.0});
final double value;
final Color? backgroundColor;

View File

@@ -7,12 +7,11 @@ class RoundBorderIcon extends StatelessWidget {
final Widget icon;
const RoundBorderIcon(
{Key? key,
{super.key,
this.color = Colors.black,
this.width = 1.5,
this.padding = 5.0,
required this.icon})
: super(key: key);
required this.icon});
@override
Widget build(BuildContext context) {

View File

@@ -3,7 +3,7 @@ import 'package:filcnaplo_mobile_ui/common/soon_alert/soon_alert.i18n.dart';
import 'package:flutter/material.dart';
class SoonAlert extends StatelessWidget {
const SoonAlert({Key? key}) : super(key: key);
const SoonAlert({super.key});
static show({required BuildContext context}) =>
showDialog(context: context, builder: (context) => const SoonAlert());

View File

@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:i18n_extension/i18n_widget.dart';
class TrendDisplay<T extends num> extends StatelessWidget {
const TrendDisplay({Key? key, required this.current, required this.previous, this.padding}) : super(key: key);
const TrendDisplay({super.key, required this.current, required this.previous, this.padding});
final T current;
final T previous;

View File

@@ -59,12 +59,12 @@ enum _ViewableLocation {
class Viewable extends StatefulWidget {
const Viewable({
Key? key,
super.key,
required this.view,
required this.tile,
this.actions = const [],
this.previewBuilder,
}) : super(key: key);
});
final Widget tile;
final Widget view;
@@ -255,12 +255,11 @@ class _ViewableState extends State<Viewable> with TickerProviderStateMixin {
class _DecoyChild extends StatefulWidget {
const _DecoyChild({
Key? key,
this.beginRect,
required this.controller,
this.endRect,
this.child,
}) : super(key: key);
});
final Rect? beginRect;
final AnimationController controller;
@@ -364,17 +363,13 @@ class _ViewableRoute<T> extends PopupRoute<T> {
required _ViewableLocation contextMenuLocation,
this.barrierLabel,
_ViewablePreviewBuilderChildless? builder,
ui.ImageFilter? filter,
super.filter,
required Rect previousChildRect,
RouteSettings? settings,
super.settings,
}) : _actions = actions,
_builder = builder,
_contextMenuLocation = contextMenuLocation,
_previousChildRect = previousChildRect,
super(
filter: filter,
settings: settings,
);
_previousChildRect = previousChildRect;
static const Color _kModalBarrierColor = Color(0x6604040F);
@@ -607,7 +602,6 @@ class _ViewableRoute<T> extends PopupRoute<T> {
class _ContextMenuRouteStatic extends StatefulWidget {
const _ContextMenuRouteStatic({
Key? key,
this.actions,
required this.child,
this.childGlobalKey,
@@ -615,7 +609,7 @@ class _ContextMenuRouteStatic extends StatefulWidget {
this.onDismiss,
required this.orientation,
this.sheetGlobalKey,
}) : super(key: key);
});
final List<Widget>? actions;
final Widget child;
@@ -899,9 +893,9 @@ class _ContextMenuRouteStaticState extends State<_ContextMenuRouteStatic> with T
class _ViewableSheet extends StatelessWidget {
const _ViewableSheet({
Key? key,
super.key,
required this.actions,
}) : super(key: key);
});
final List<Widget> actions;

View File

@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
class AbsenceDisplay extends StatelessWidget {
const AbsenceDisplay(this.excused, this.unexcused, this.pending, {Key? key}) : super(key: key);
const AbsenceDisplay(this.excused, this.unexcused, this.pending, {super.key});
final int excused;
final int unexcused;

View File

@@ -9,13 +9,12 @@ import 'package:provider/provider.dart';
class AbsenceSubjectTile extends StatelessWidget {
const AbsenceSubjectTile(this.subject,
{Key? key,
{super.key,
this.percentage = 0.0,
this.excused = 0,
this.unexcused = 0,
this.pending = 0,
this.onTap})
: super(key: key);
this.onTap});
final GradeSubject subject;
final void Function()? onTap;
@@ -62,11 +61,11 @@ class AbsenceSubjectTile extends StatelessWidget {
alignment: Alignment.centerRight,
children: [
const Opacity(
opacity: 0,
child: Text("100%",
style: TextStyle(fontFamily: "monospace")),
opacity: 0),
style: TextStyle(fontFamily: "monospace"))),
Text(
percentage.round().toString() + "%",
"${percentage.round()}%",
style: TextStyle(
// fontFamily: "monospace",
color: getColorByPercentage(percentage, context: context),

View File

@@ -10,8 +10,7 @@ import 'absence_tile.i18n.dart';
class AbsenceTile extends StatelessWidget {
const AbsenceTile(this.absence,
{Key? key, this.onTap, this.elevation = 0.0, this.padding})
: super(key: key);
{super.key, this.onTap, this.elevation = 0.0, this.padding});
final Absence absence;
final void Function()? onTap;

View File

@@ -18,8 +18,7 @@ import 'absence_view.i18n.dart';
class AbsenceView extends StatelessWidget {
const AbsenceView(this.absence,
{Key? key, this.outsideContext, this.viewable = false})
: super(key: key);
{super.key, this.outsideContext, this.viewable = false});
final Absence absence;
final BuildContext? outsideContext;
@@ -90,9 +89,7 @@ class AbsenceView extends StatelessWidget {
if (absence.delay > 0)
Detail(
title: "delay".i18n,
description: absence.delay.toString() +
" " +
"minutes".i18n.plural(absence.delay),
description: "${absence.delay} ${"minutes".i18n.plural(absence.delay)}",
),
if (absence.lessonIndex != null)
Detail(

View File

@@ -15,7 +15,7 @@ import 'package:filcnaplo/utils/reverse_search.dart';
import 'absence_view.i18n.dart';
class AbsenceViewable extends StatelessWidget {
const AbsenceViewable(this.absence, {Key? key, this.padding}) : super(key: key);
const AbsenceViewable(this.absence, {super.key, this.padding});
final Absence absence;
final EdgeInsetsGeometry? padding;

View File

@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
class AbsenceGroupContainer extends InheritedWidget {
const AbsenceGroupContainer({Key? key, required Widget child}) : super(key: key, child: child);
const AbsenceGroupContainer({super.key, required super.child});
static AbsenceGroupContainer? of(BuildContext context) => context.dependOnInheritedWidgetOfExactType<AbsenceGroupContainer>();

View File

@@ -11,8 +11,7 @@ import 'absence_group_tile.i18n.dart';
class AbsenceGroupTile extends StatelessWidget {
const AbsenceGroupTile(this.absences,
{Key? key, this.showDate = false, this.padding})
: super(key: key);
{super.key, this.showDate = false, this.padding});
final List<AbsenceViewable> absences;
final bool showDate;

View File

@@ -5,7 +5,7 @@ import 'package:filcnaplo_mobile_ui/common/panel/panel_button.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
class AdTile extends StatelessWidget {
const AdTile(this.ad, {Key? key, this.onTap, this.padding}) : super(key: key);
const AdTile(this.ad, {super.key, this.onTap, this.padding});
final Ad ad;
final Function()? onTap;

View File

@@ -5,7 +5,7 @@ import 'package:url_launcher/url_launcher.dart';
import 'ad_tile.dart';
class AdViewable extends StatelessWidget {
const AdViewable(this.ad, {Key? key}) : super(key: key);
const AdViewable(this.ad, {super.key});
final Ad ad;

View File

@@ -2,7 +2,7 @@ import 'package:filcnaplo/theme/colors/colors.dart';
import 'package:flutter/material.dart';
class CardHandle extends StatelessWidget {
const CardHandle({Key? key, this.child}) : super(key: key);
const CardHandle({super.key, this.child});
final Widget? child;

View File

@@ -8,7 +8,7 @@ import 'package:flutter_feather_icons/flutter_feather_icons.dart';
import 'certification_card.i18n.dart';
class CertificationCard extends StatelessWidget {
const CertificationCard(this.grades, {Key? key, required this.gradeType, this.padding}) : super(key: key);
const CertificationCard(this.grades, {super.key, required this.gradeType, this.padding});
final List<Grade> grades;
final GradeType gradeType;

View File

@@ -11,7 +11,7 @@ import 'package:provider/provider.dart';
import 'certification_tile.i18n.dart';
class CertificationTile extends StatelessWidget {
const CertificationTile(this.grade, {Key? key, this.onTap, this.padding}) : super(key: key);
const CertificationTile(this.grade, {super.key, this.onTap, this.padding});
final Function()? onTap;
final Grade grade;

View File

@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
class CertificationView extends StatelessWidget {
const CertificationView(this.grades, {Key? key, required this.gradeType}) : super(key: key);
const CertificationView(this.grades, {super.key, required this.gradeType});
final List<Grade> grades;
final GradeType gradeType;
@@ -26,6 +26,9 @@ class CertificationView extends StatelessWidget {
icon: FeatherIcons.award,
iconSize: 50,
child: ListView(
shrinkWrap: true,
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
physics: const BouncingScrollPhysics(),
children: [
SafeArea(
child: Panel(
@@ -35,9 +38,6 @@ class CertificationView extends StatelessWidget {
),
)
],
shrinkWrap: true,
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
physics: const BouncingScrollPhysics(),
)));
}
}

View File

@@ -5,10 +5,10 @@ class CustomSwitch extends StatelessWidget {
final bool value;
const CustomSwitch({
Key? key,
super.key,
required this.onChanged,
required this.value,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View File

@@ -4,7 +4,7 @@ import 'package:filcnaplo_mobile_ui/common/profile_image/profile_image.dart';
import 'package:flutter/material.dart';
class EventTile extends StatelessWidget {
const EventTile(this.event, {Key? key, this.onTap, this.padding}) : super(key: key);
const EventTile(this.event, {super.key, this.onTap, this.padding});
final Event event;
final void Function()? onTap;

View File

@@ -6,7 +6,7 @@ import 'package:flutter_custom_tabs/flutter_custom_tabs.dart';
import 'package:flutter_linkify/flutter_linkify.dart';
class EventView extends StatelessWidget {
const EventView(this.event, {Key? key}) : super(key: key);
const EventView(this.event, {super.key});
final Event event;

View File

@@ -4,7 +4,7 @@ import 'package:filcnaplo_mobile_ui/common/widgets/event/event_view.dart';
import 'package:flutter/material.dart';
class EventViewable extends StatelessWidget {
const EventViewable(this.event, {Key? key}) : super(key: key);
const EventViewable(this.event, {super.key});
final Event event;

View File

@@ -6,8 +6,7 @@ import 'package:filcnaplo/utils/format.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
class ExamTile extends StatelessWidget {
const ExamTile(this.exam, {Key? key, this.onTap, this.padding})
: super(key: key);
const ExamTile(this.exam, {super.key, this.onTap, this.padding});
final Exam exam;
final void Function()? onTap;

View File

@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
import 'exam_view.i18n.dart';
class ExamView extends StatelessWidget {
const ExamView(this.exam, {Key? key}) : super(key: key);
const ExamView(this.exam, {super.key});
final Exam exam;

View File

@@ -6,7 +6,7 @@ import 'package:filcnaplo_mobile_ui/common/widgets/exam/exam_view.dart';
import 'package:flutter/material.dart';
class ExamViewable extends StatelessWidget {
const ExamViewable(this.exam, {Key? key}) : super(key: key);
const ExamViewable(this.exam, {super.key});
final Exam exam;

View File

@@ -9,12 +9,11 @@ import 'package:provider/provider.dart';
class GradeSubjectTile extends StatelessWidget {
const GradeSubjectTile(this.subject,
{Key? key,
{super.key,
this.average = 0.0,
this.groupAverage = 0.0,
this.onTap,
this.averageBefore = 0.0})
: super(key: key);
this.averageBefore = 0.0});
final GradeSubject subject;
final void Function()? onTap;

View File

@@ -9,7 +9,7 @@ import 'package:provider/provider.dart';
import 'grade_view.i18n.dart';
class GradeView extends StatelessWidget {
const GradeView(this.grade, {Key? key}) : super(key: key);
const GradeView(this.grade, {super.key});
static show(Grade grade, {required BuildContext context}) =>
showBottomCard(context: context, child: GradeView(grade));
@@ -59,7 +59,7 @@ class GradeView extends StatelessWidget {
// Grade Details
Detail(
title: "value".i18n,
description: "${grade.value.valueName} " + percentText(),
description: "${grade.value.valueName} ${percentText()}",
),
if (grade.description != "")
Detail(title: "description".i18n, description: grade.description),

View File

@@ -7,7 +7,7 @@ import 'package:filcnaplo_mobile_ui/pages/grades/subject_grades_container.dart';
import 'package:flutter/material.dart';
class GradeViewable extends StatelessWidget {
const GradeViewable(this.grade, {Key? key, this.padding}) : super(key: key);
const GradeViewable(this.grade, {super.key, this.padding});
final Grade grade;
final EdgeInsetsGeometry? padding;

View File

@@ -10,7 +10,7 @@ import 'package:rive/rive.dart';
import 'new_grades.i18n.dart';
class NewGradesSurprise extends StatelessWidget {
const NewGradesSurprise(this.grades, {Key? key, this.censored = false}) : super(key: key);
const NewGradesSurprise(this.grades, {super.key, this.censored = false});
final List<Grade> grades;
final bool censored;

View File

@@ -13,7 +13,7 @@ import 'package:rive/rive.dart' as rive;
import 'new_grades.i18n.dart';
class SurpriseGrade extends StatefulWidget {
const SurpriseGrade(this.grade, {Key? key}) : super(key: key);
const SurpriseGrade(this.grade, {super.key});
final Grade grade;

View File

@@ -11,7 +11,7 @@ import 'package:flutter/material.dart';
import 'homework_attachment_tile.i18n.dart';
class HomeworkAttachmentTile extends StatelessWidget {
const HomeworkAttachmentTile(this.attachment, {Key? key}) : super(key: key);
const HomeworkAttachmentTile(this.attachment, {super.key});
final HomeworkAttachment attachment;
@@ -31,13 +31,13 @@ class HomeworkAttachmentTile extends StatelessWidget {
builder: (context) => ImageView(snapshot.data!),
));
},
borderRadius: BorderRadius.circular(12.0),
child: Ink.image(
image: FileImage(File(snapshot.data ?? "")),
height: 200.0,
width: double.infinity,
fit: BoxFit.cover,
),
borderRadius: BorderRadius.circular(12.0),
),
),
),

View File

@@ -9,8 +9,7 @@ import 'package:provider/provider.dart';
class HomeworkTile extends StatelessWidget {
const HomeworkTile(this.homework,
{Key? key, this.onTap, this.padding, this.censored = false})
: super(key: key);
{super.key, this.onTap, this.padding, this.censored = false});
final Homework homework;
final void Function()? onTap;

View File

@@ -12,7 +12,7 @@ import 'package:provider/provider.dart';
import 'homework_view.i18n.dart';
class HomeworkView extends StatelessWidget {
const HomeworkView(this.homework, {Key? key}) : super(key: key);
const HomeworkView(this.homework, {super.key});
final Homework homework;

View File

@@ -4,7 +4,7 @@ import 'package:filcnaplo_mobile_ui/common/widgets/homework/homework_view.dart';
import 'package:flutter/material.dart';
class HomeworkViewable extends StatelessWidget {
const HomeworkViewable(this.homework, {Key? key}) : super(key: key);
const HomeworkViewable(this.homework, {super.key});
final Homework homework;

View File

@@ -6,8 +6,7 @@ import 'package:flutter_feather_icons/flutter_feather_icons.dart';
import 'changed_lesson_tile.i18n.dart';
class ChangedLessonTile extends StatelessWidget {
const ChangedLessonTile(this.lesson, {Key? key, this.onTap, this.padding})
: super(key: key);
const ChangedLessonTile(this.lesson, {super.key, this.onTap, this.padding});
final Lesson lesson;
final void Function()? onTap;

View File

@@ -4,7 +4,7 @@ import 'package:filcnaplo_mobile_ui/pages/timetable/timetable_page.dart';
import 'package:flutter/material.dart';
class ChangedLessonViewable extends StatelessWidget {
const ChangedLessonViewable(this.lesson, {Key? key}) : super(key: key);
const ChangedLessonViewable(this.lesson, {super.key});
final Lesson lesson;

View File

@@ -9,7 +9,7 @@ import 'package:provider/provider.dart';
import 'lesson_view.i18n.dart';
class LessonView extends StatelessWidget {
const LessonView(this.lesson, {Key? key}) : super(key: key);
const LessonView(this.lesson, {super.key});
final Lesson lesson;

View File

@@ -6,7 +6,7 @@ import 'package:filcnaplo_mobile_ui/common/widgets/lesson/lesson_view.dart';
import 'package:flutter/material.dart';
class LessonViewable extends StatelessWidget {
const LessonViewable(this.lesson, {Key? key, this.swapDesc = false}) : super(key: key);
const LessonViewable(this.lesson, {super.key, this.swapDesc = false});
final Lesson lesson;
final bool swapDesc;

View File

@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
class AttachmentTile extends StatelessWidget {
const AttachmentTile(this.attachment, {Key? key}) : super(key: key);
const AttachmentTile(this.attachment, {super.key});
final Attachment attachment;
@@ -32,13 +32,13 @@ class AttachmentTile extends StatelessWidget {
},
);
},
borderRadius: BorderRadius.circular(12.0),
child: Ink.image(
image: FileImage(File(snapshot.data ?? "")),
height: 200.0,
width: double.infinity,
fit: BoxFit.cover,
),
borderRadius: BorderRadius.circular(12.0),
),
),
),

View File

@@ -7,7 +7,7 @@ import 'package:flutter_feather_icons/flutter_feather_icons.dart';
import 'package:photo_view/photo_view.dart';
class ImageView extends StatelessWidget {
const ImageView(this.path, {Key? key}) : super(key: key);
const ImageView(this.path, {super.key});
final String path;

View File

@@ -5,7 +5,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class MessageView extends StatefulWidget {
const MessageView(this.messages, {Key? key}) : super(key: key);
const MessageView(this.messages, {super.key});
final List<Message> messages;
@@ -13,10 +13,10 @@ class MessageView extends StatefulWidget {
Navigator.of(context, rootNavigator: true).push(CupertinoPageRoute(builder: (context) => MessageView(messages)));
@override
_MessageViewState createState() => _MessageViewState();
MessageViewState createState() => MessageViewState();
}
class _MessageViewState extends State<MessageView> {
class MessageViewState extends State<MessageView> {
@override
Widget build(BuildContext context) {
return Scaffold(

View File

@@ -13,7 +13,7 @@ import 'package:provider/provider.dart';
import 'message_view_tile.i18n.dart';
class MessageViewTile extends StatelessWidget {
const MessageViewTile(this.message, {Key? key}) : super(key: key);
const MessageViewTile(this.message, {super.key});
final Message message;
@@ -76,7 +76,7 @@ class MessageViewTile extends StatelessWidget {
maxLines: 2,
),
subtitle: Text(
"to".i18n + " " + recipientLabel,
"${"to".i18n} $recipientLabel",
style: const TextStyle(fontWeight: FontWeight.w500),
overflow: TextOverflow.ellipsis,
maxLines: 1,

View File

@@ -5,7 +5,7 @@ import 'package:filcnaplo_mobile_ui/common/widgets/message/message_view.dart';
import 'package:flutter/material.dart';
class MessageViewable extends StatelessWidget {
const MessageViewable(this.message, {Key? key}) : super(key: key);
const MessageViewable(this.message, {super.key});
final Message message;

View File

@@ -5,7 +5,7 @@ import 'package:flutter_feather_icons/flutter_feather_icons.dart';
import 'miss_tile.i18n.dart';
class MissTile extends StatelessWidget {
const MissTile(this.note, {Key? key}) : super(key: key);
const MissTile(this.note, {super.key});
final Note note;

View File

@@ -6,7 +6,7 @@ import 'package:flutter_feather_icons/flutter_feather_icons.dart';
import 'missed_exam_tile.i18n.dart';
class MissedExamTile extends StatelessWidget {
const MissedExamTile(this.missedExams, {Key? key, this.onTap, this.padding}) : super(key: key);
const MissedExamTile(this.missedExams, {super.key, this.onTap, this.padding});
final List<Lesson> missedExams;
final Function()? onTap;