From c06e9bc8071c4f0d89e69d43b4139f2355f53b1f Mon Sep 17 00:00:00 2001 From: Kima Date: Sun, 10 Dec 2023 22:49:55 +0100 Subject: [PATCH] fixed warnings --- filcnaplo_kreta_api/lib/providers/absence_provider.dart | 1 + filcnaplo_kreta_api/lib/providers/exam_provider.dart | 1 + filcnaplo_kreta_api/lib/providers/message_provider.dart | 9 ++++++--- .../lib/common/widgets/statistics_tile.dart | 4 ++-- .../lib/common/widgets/update/update_tile.dart | 2 +- .../lib/common/widgets/update/update_viewable.dart | 2 +- filcnaplo_mobile_ui/pubspec.yaml | 1 + 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/filcnaplo_kreta_api/lib/providers/absence_provider.dart b/filcnaplo_kreta_api/lib/providers/absence_provider.dart index 1688550..f4b0acf 100644 --- a/filcnaplo_kreta_api/lib/providers/absence_provider.dart +++ b/filcnaplo_kreta_api/lib/providers/absence_provider.dart @@ -45,6 +45,7 @@ class AbsenceProvider with ChangeNotifier { (await _database.query.getSettings(_database)).renamedSubjectsEnabled ? await _database.userQuery.renamedSubjects( userId: + // ignore: use_build_context_synchronously Provider.of(_context, listen: false).user!.id) : {}; Map renamedTeachers = diff --git a/filcnaplo_kreta_api/lib/providers/exam_provider.dart b/filcnaplo_kreta_api/lib/providers/exam_provider.dart index 8690ca1..1b6e245 100644 --- a/filcnaplo_kreta_api/lib/providers/exam_provider.dart +++ b/filcnaplo_kreta_api/lib/providers/exam_provider.dart @@ -43,6 +43,7 @@ class ExamProvider with ChangeNotifier { (await database.query.getSettings(database)).renamedSubjectsEnabled ? await database.userQuery.renamedSubjects( userId: + // ignore: use_build_context_synchronously Provider.of(_context, listen: false).user!.id) : {}; Map renamedTeachers = diff --git a/filcnaplo_kreta_api/lib/providers/message_provider.dart b/filcnaplo_kreta_api/lib/providers/message_provider.dart index 8bd1fcd..2d9c64b 100644 --- a/filcnaplo_kreta_api/lib/providers/message_provider.dart +++ b/filcnaplo_kreta_api/lib/providers/message_provider.dart @@ -6,6 +6,7 @@ import 'package:filcnaplo/models/user.dart'; import 'package:filcnaplo_kreta_api/client/api.dart'; import 'package:filcnaplo_kreta_api/client/client.dart'; import 'package:filcnaplo_kreta_api/models/message.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -149,9 +150,11 @@ class MessageProvider with ChangeNotifier { SendRecipient.fromJson(e, addressable[AddresseeType.directorate]!))); } - print(addressable); - print(recipients); - print(recipients.first.json); + if (kDebugMode) { + print(addressable); + print(recipients); + print(recipients.first.json); + } } // send message diff --git a/filcnaplo_mobile_ui/lib/common/widgets/statistics_tile.dart b/filcnaplo_mobile_ui/lib/common/widgets/statistics_tile.dart index 9d01db3..f128168 100755 --- a/filcnaplo_mobile_ui/lib/common/widgets/statistics_tile.dart +++ b/filcnaplo_mobile_ui/lib/common/widgets/statistics_tile.dart @@ -7,7 +7,7 @@ import 'package:provider/provider.dart'; class StatisticsTile extends StatelessWidget { const StatisticsTile({ - Key? key, + super.key, required this.value, this.title, this.decimal = true, @@ -15,7 +15,7 @@ class StatisticsTile extends StatelessWidget { this.valueSuffix = '', this.fill = false, this.outline = false, - }) : super(key: key); + }); final double value; final Widget? title; diff --git a/filcnaplo_mobile_ui/lib/common/widgets/update/update_tile.dart b/filcnaplo_mobile_ui/lib/common/widgets/update/update_tile.dart index 41c66e4..9482ef0 100755 --- a/filcnaplo_mobile_ui/lib/common/widgets/update/update_tile.dart +++ b/filcnaplo_mobile_ui/lib/common/widgets/update/update_tile.dart @@ -5,7 +5,7 @@ import 'package:flutter_feather_icons/flutter_feather_icons.dart'; import 'update_tile.i18n.dart'; class UpdateTile extends StatelessWidget { - const UpdateTile(this.release, {Key? key, this.onTap, this.padding}) : super(key: key); + const UpdateTile(this.release, {super.key, this.onTap, this.padding}); final Release release; final Function()? onTap; diff --git a/filcnaplo_mobile_ui/lib/common/widgets/update/update_viewable.dart b/filcnaplo_mobile_ui/lib/common/widgets/update/update_viewable.dart index 0eb6a1c..119d031 100755 --- a/filcnaplo_mobile_ui/lib/common/widgets/update/update_viewable.dart +++ b/filcnaplo_mobile_ui/lib/common/widgets/update/update_viewable.dart @@ -4,7 +4,7 @@ import 'package:filcnaplo_mobile_ui/common/widgets/update/updates_view.dart'; import 'package:flutter/material.dart'; class UpdateViewable extends StatelessWidget { - const UpdateViewable(this.release, {Key? key}) : super(key: key); + const UpdateViewable(this.release, {super.key}); final Release release; diff --git a/filcnaplo_mobile_ui/pubspec.yaml b/filcnaplo_mobile_ui/pubspec.yaml index bcdf156..7cfe565 100644 --- a/filcnaplo_mobile_ui/pubspec.yaml +++ b/filcnaplo_mobile_ui/pubspec.yaml @@ -50,6 +50,7 @@ dependencies: flutter_expandable_fab: ^2.0.0 intl: ^0.18.1 i18n_extension: ^10.0.1 + auto_size_text: ^3.0.0 dev_dependencies: flutter_lints: ^3.0.1