Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wjbladek committed Mar 25, 2024
1 parent e6ee25d commit 96848e3
Show file tree
Hide file tree
Showing 42 changed files with 64 additions and 76 deletions.
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ analyzer:
- lib/injectable.config.dart
- lib/generated_plugin_registrant.dart
- lib/**/*.g.dart
- lib/consts/ootm_icons.dart
- scripts.dart


Expand Down
12 changes: 0 additions & 12 deletions lib/data/api/api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:odyssey_mobile/data/api/models/info.dart';
import 'package:odyssey_mobile/data/api/models/info_category.dart';
import 'package:odyssey_mobile/data/api/models/performance.dart';
import 'package:odyssey_mobile/data/api/models/problem.dart';
import 'package:odyssey_mobile/data/api/models/sponsor.dart';
import 'package:odyssey_mobile/data/api/models/stage.dart';
import 'package:retrofit/retrofit.dart';
import 'package:dio/dio.dart';
Expand Down Expand Up @@ -32,17 +31,6 @@ abstract class ApiService {
@GET('/info/category')
Future<List<InfoCategoryModelApi>> getInfoCategories();

/// Not used.
// @GET('/age')
// Future<List<AgeGroup>> getAgeGroups();

/// Not used this year.
// @GET('/sponsor')
// Future<List<Sponsor>> getSponsors();

// @GET('/sponsor/{imageId}')
// Future<List<String>> getSponsorImage(@Path('imageId') int imageId);

@GET('/city')
Future<List<CityModelApi>> getCities();

Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'package:odyssey_mobile/presentation/initial_screens/bloc/update_bloc.dar
import 'package:odyssey_mobile/presentation/router.dart';

class OdysseyMobile extends StatelessWidget {
OdysseyMobile({Key? key}) : super(key: key);
OdysseyMobile({super.key});
final _appRouter = AppRouter();

@override
Expand Down
3 changes: 1 addition & 2 deletions lib/presentation/components/basic_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ class BasicBox extends StatelessWidget {
required this.label,
this.splashGradientPair,
this.centerLabel = false,
Key? key})
: super(key: key);
super.key});

final VoidCallback onTap;
final String label;
Expand Down
5 changes: 2 additions & 3 deletions lib/presentation/components/box_with_badge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import 'package:odyssey_mobile/consts/themes.dart';
// Add disabled variant
class BoxWithBadge extends StatelessWidget {
const BoxWithBadge(
{Key? key,
{super.key,
this.splashGradientPair,
required this.onTap,
required this.label,
required this.badgeLabel})
: super(key: key);
required this.badgeLabel});
final VoidCallback onTap;
final String label;
final SplashGradientPair? splashGradientPair;
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/components/city_data_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:odyssey_mobile/presentation/components/loader.dart';
import 'package:odyssey_mobile/presentation/main_view/bloc/city_data_bloc.dart';

class CityDataBuilder extends StatelessWidget {
const CityDataBuilder({required this.onData, this.onFailure, Key? key}) : super(key: key);
const CityDataBuilder({required this.onData, this.onFailure, super.key});
final Widget Function(CityData cityData, List<ScheduleCategoryEntity> problems) onData;
final Widget Function(Failure failure)? onFailure;

Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/components/empty_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';

// Temp widget
class EmptyData extends StatelessWidget {
const EmptyData({Key? key}) : super(key: key);
const EmptyData({super.key});

@override
Widget build(BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/components/error_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:odyssey_mobile/presentation/components/loader.dart';
import 'package:odyssey_mobile/presentation/initial_screens/bloc/update_bloc.dart';

class ErrorBody extends StatelessWidget {
const ErrorBody(this.failure, {Key? key}) : super(key: key);
const ErrorBody(this.failure, {super.key});
final Failure failure;

@override
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/components/fav_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class FavWidget extends StatefulWidget {
this.isFavourite, {
required this.controller,
required this.secretWidth,
Key? key,
}) : super(key: key);
super.key,
});

final bool isFavourite;
final AnimationController controller;
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/components/favourites_group_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class FavouritesGroupWidget extends StatefulWidget {
required this.performanceGroup,
required this.secretWidth,
this.categoryEntity,
Key? key,
}) : super(key: key);
super.key,
});

final PerformanceGroup performanceGroup;
final ScheduleCategoryEntity? categoryEntity;
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/components/favourites_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:odyssey_mobile/presentation/favourites_screen/bloc/favourites_bl
import 'package:odyssey_mobile/presentation/main_view/bloc/city_data_bloc.dart';

class FavouritesList extends StatefulWidget {
const FavouritesList({Key? key, required this.secretWidth, this.day}) : super(key: key);
const FavouritesList({super.key, required this.secretWidth, this.day});
final String? day;
final double secretWidth;

Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/components/function_presentation_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import 'package:odyssey_mobile/consts/themes.dart';

class FunctionPresentationTile extends StatelessWidget {
const FunctionPresentationTile({
Key? key,
super.key,
required this.icon,
required this.title,
required this.subtitle,
required this.iconColor,
required this.iconBackgroundColor,
}) : super(key: key);
});

final IconData icon;
final String title;
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/components/heading.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:odyssey_mobile/consts/themes.dart';

class Heading extends StatelessWidget {
const Heading(this.text, {this.leftPadding = 0, Key? key}) : super(key: key);
const Heading(this.text, {this.leftPadding = 0, super.key});
final String text;
final double leftPadding;

Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/components/highlighted_performance_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import 'package:odyssey_mobile/presentation/components/performance_card.dart';

class HighlightedPerformanceCard extends StatefulWidget {
const HighlightedPerformanceCard({
Key? key,
super.key,
required this.performance,
required this.secretWidth,
}) : super(key: key);
});
final Performance performance;
final double secretWidth;

Expand Down
7 changes: 5 additions & 2 deletions lib/presentation/components/image_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:odyssey_mobile/consts/themes.dart';

class ImageTile extends StatelessWidget {
const ImageTile(this.id, {this.color = AppColors.pureWhite, Key? key}) : super(key: key);
const ImageTile(this.id, {this.color = AppColors.pureWhite, super.key});
final String id;
final Color color;

Expand All @@ -12,7 +12,10 @@ class ImageTile extends StatelessWidget {
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(AppValues.bigBrRadius),
image: DecorationImage(image: NetworkImage('https://grzybek.snet.ovh/sponsor/' + id), fit: BoxFit.scaleDown)),
image: DecorationImage(
image: NetworkImage('https://grzybek.snet.ovh/sponsor/$id'),
fit: BoxFit.scaleDown,
)),
);
}
}
2 changes: 1 addition & 1 deletion lib/presentation/components/loader.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';

class Loader extends StatelessWidget {
const Loader({Key? key}) : super(key: key);
const Loader({super.key});

@override
Widget build(BuildContext context) {
Expand Down
3 changes: 1 addition & 2 deletions lib/presentation/components/performance_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import 'package:odyssey_mobile/presentation/main_view/bloc/update_favourites_blo
import 'package:swipeable_tile/swipeable_tile.dart';

class PerformanceCard extends StatefulWidget {
const PerformanceCard({required this.performance, required this.secretWidth, Key? key})
: super(key: key);
const PerformanceCard({required this.performance, required this.secretWidth, super.key});
final Performance performance;
final double secretWidth;

Expand Down
3 changes: 1 addition & 2 deletions lib/presentation/components/performance_category_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import 'package:odyssey_mobile/presentation/router.dart';
import '../helpers/string_helpers.dart';

class PerformanceCategoryList extends StatelessWidget {
const PerformanceCategoryList({required this.parameters, this.splashGradientPair, Key? key})
: super(key: key);
const PerformanceCategoryList({required this.parameters, this.splashGradientPair, super.key});
final List<ScheduleCategoryEntity> parameters;
final SplashGradientPair? splashGradientPair;
@override
Expand Down
15 changes: 9 additions & 6 deletions lib/presentation/components/performance_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:odyssey_mobile/presentation/helpers/string_helpers.dart';
import 'package:odyssey_mobile/presentation/main_view/bloc/update_favourites_bloc.dart';

class PerformanceDialog extends StatefulWidget {
const PerformanceDialog(this.performance, {required this.bloc, Key? key}) : super(key: key);
const PerformanceDialog(this.performance, {required this.bloc, super.key});
final Performance performance;
final UpdateFavouritesBloc bloc;
@override
Expand Down Expand Up @@ -77,7 +77,7 @@ class _PerformanceDialogState extends State<PerformanceDialog> {
),
const SizedBox(height: 8.0),
ElevatedButton(
onPressed: context.router.pop,
onPressed: context.router.maybePop,
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.lightGrey, foregroundColor: AppColors.darkestGrey),
child: const Text(AppStrings.close),
Expand All @@ -92,7 +92,7 @@ class _PerformanceDialogState extends State<PerformanceDialog> {
}

class _PerformanceDialogStaticInfo extends StatelessWidget {
const _PerformanceDialogStaticInfo(this.pf, {Key? key}) : super(key: key);
const _PerformanceDialogStaticInfo(this.pf);
final Performance pf;
@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -128,9 +128,12 @@ class _PerformanceDialogStaticInfo extends StatelessWidget {
}

class _DayWidget extends StatelessWidget {
const _DayWidget(
{Key? key, required this.day, required this.hour, required this.type, required this.toolTip})
: super(key: key);
const _DayWidget({
required this.day,
required this.hour,
required this.type,
required this.toolTip,
});

final String day;
final String hour;
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/components/performance_group_heading.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:odyssey_mobile/presentation/components/heading.dart';
import 'package:odyssey_mobile/consts/strings.dart';

class PerformanceGroupHeading extends StatelessWidget {
const PerformanceGroupHeading(this.pfGroup, {this.categoryEntity, Key? key}) : super(key: key);
const PerformanceGroupHeading(this.pfGroup, {this.categoryEntity, super.key});
final ScheduleCategoryEntity? categoryEntity;
final PerformanceGroup pfGroup;

Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/components/performance_group_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class PerformanceGroupWidget extends StatefulWidget {
required this.performanceGroup,
required this.secretWidth,
this.categoryEntity,
Key? key,
}) : super(key: key);
super.key,
});

final pfg_entity.PerformanceGroup performanceGroup;
final ScheduleCategoryEntity? categoryEntity;
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/components/position_indicator_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:odyssey_mobile/consts/themes.dart';

class PositionIndicatorItem extends StatelessWidget {
const PositionIndicatorItem(this.active, {Key? key}) : super(key: key);
const PositionIndicatorItem(this.active, {super.key});
final bool active;
@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/components/schedule_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:odyssey_mobile/presentation/components/schedule_list.dart';

class ScheduleLayout extends StatelessWidget {
const ScheduleLayout({
Key? key,
super.key,
required this.days,
required this.performanceGroups,
required this.title,
Expand All @@ -19,7 +19,7 @@ class ScheduleLayout extends StatelessWidget {
this.actions = const [],
this.inFavourites = false,
this.emptyWidget = const EmptyData(),
}) : super(key: key);
});

final bool centerTitle;
final String title;
Expand Down
3 changes: 1 addition & 2 deletions lib/presentation/components/schedule_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import 'package:odyssey_mobile/presentation/components/performance_group_widget.

class ScheduleList extends StatefulWidget {
const ScheduleList(
{Key? key, required this.groups, required this.categoryEntity, required this.secretWidth})
: super(key: key);
{super.key, required this.groups, required this.categoryEntity, required this.secretWidth});

final List<PerformanceGroup> groups;
final ScheduleCategoryEntity? categoryEntity;
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/components/search_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import 'package:odyssey_mobile/consts/themes.dart';

class SearchField extends StatefulWidget {
const SearchField({
Key? key,
super.key,
this.onChange,
this.onSubmitted,
this.onEditingComplete,
this.initialValue,
this.onClearCallback,
}) : super(key: key);
});

final Function(String)? onChange;
final Function(String)? onSubmitted;
Expand Down
3 changes: 1 addition & 2 deletions lib/presentation/components/search_result_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import 'package:odyssey_mobile/presentation/helpers/string_helpers.dart';

class SearchResultListTile extends StatelessWidget {
const SearchResultListTile(
{Key? key, required this.onTap, required this.performance, required this.searchPhrase})
: super(key: key);
{super.key, required this.onTap, required this.performance, required this.searchPhrase});
final VoidCallback onTap;
final Performance performance;
final String searchPhrase;
Expand Down
3 changes: 1 addition & 2 deletions lib/presentation/components/show_more_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import 'package:odyssey_mobile/consts/strings.dart';
import 'package:odyssey_mobile/consts/themes.dart';

class ShowMoreButton extends StatefulWidget {
const ShowMoreButton({required this.expanded, required this.initialExpanded, Key? key})
: super(key: key);
const ShowMoreButton({required this.expanded, required this.initialExpanded, super.key});
final ValueChanged<bool> expanded;
final bool initialExpanded;

Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/components/spontaneous_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ class SpontaneousWidget extends StatelessWidget {
const SpontaneousWidget({
required this.performance,
required this.secretWidth,
Key? key,
}) : super(key: key);
super.key,
});

final Performance performance;
final double secretWidth;
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/favourites_screen/favourites_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'package:odyssey_mobile/presentation/main_view/bloc/update_favourites_blo

@RoutePage()
class FavouritesScreen extends StatelessWidget {
const FavouritesScreen({Key? key}) : super(key: key);
const FavouritesScreen({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -46,7 +46,7 @@ class FavouritesScreen extends StatelessWidget {
}

class FavouritesEmpty extends StatelessWidget {
const FavouritesEmpty({Key? key}) : super(key: key);
const FavouritesEmpty({super.key});

@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/home_screen/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:odyssey_mobile/consts/strings.dart';

@RoutePage()
class HomeScreen extends StatelessWidget {
const HomeScreen({Key? key}) : super(key: key);
const HomeScreen({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -66,7 +66,7 @@ class HomeScreen extends StatelessWidget {
),
),
);
}).toList(),
}),
],
// SliverToBoxAdapter(
// child: Container(
Expand Down
Loading

0 comments on commit 96848e3

Please sign in to comment.