Skip to content

Commit

Permalink
Apply new linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bdmendes committed Oct 13, 2023
1 parent cc5fead commit 94631ea
Show file tree
Hide file tree
Showing 83 changed files with 148 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:workmanager/workmanager.dart';
/// (they must not take any arguments, not checked)
const taskMap = {
'pt.up.fe.ni.uni.notificationworker':
Tuple2(NotificationManager.updateAndTriggerNotifications, true)
Tuple2(NotificationManager.updateAndTriggerNotifications, true),
};

@pragma('vm:entry-point')
Expand Down
2 changes: 1 addition & 1 deletion uni/lib/controller/fetchers/print_fetcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class PrintFetcher implements SessionDependantFetcher {
'p_tipo_id': '3',
'pct_codigo': session.username,
'p_valor': '1',
'p_valor_livre': amount.toStringAsFixed(2).trim().replaceAll('.', ',')
'p_valor_livre': amount.toStringAsFixed(2).trim().replaceAll('.', ','),
};

final headers = <String, String>{};
Expand Down
2 changes: 1 addition & 1 deletion uni/lib/controller/fetchers/restaurant_fetcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class RestaurantFetcher {
}

final List<String> sigarraMenuEndpoints = [
'${NetworkRouter.getBaseUrl('feup')}CANTINA.EMENTASHOW'
'${NetworkRouter.getBaseUrl('feup')}CANTINA.EMENTASHOW',
];

Future<List<Restaurant>> fetchSigarraRestaurants(Session session) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ScheduleFetcherApi extends ScheduleFetcher {
{
'pv_codigo': session.username,
'pv_semana_ini': dates.beginWeek,
'pv_semana_fim': dates.endWeek
'pv_semana_fim': dates.endWeek,
},
session,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ScheduleFetcherHtml extends ScheduleFetcher {
'pv_fest_id': course.festId.toString(),
'pv_ano_lectivo': dates.lectiveYear.toString(),
'p_semana_inicio': dates.beginWeek,
'p_semana_fim': dates.endWeek
'p_semana_fim': dates.endWeek,
},
session,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppBusStopDatabase extends AppDatabase {
AppBusStopDatabase()
: super('busstops.db', [
'CREATE TABLE busstops(stopCode TEXT, busCode TEXT)',
'CREATE TABLE favoritestops(stopCode TEXT, favorited TEXT)'
'CREATE TABLE favoritestops(stopCode TEXT, favorited TEXT)',
]);

/// Returns a map containing all the data stored in this database.
Expand Down
2 changes: 1 addition & 1 deletion uni/lib/controller/local_storage/app_exams_database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AppExamsDatabase extends AppDatabase {
'Setembro': '09',
'Outubro': '10',
'Novembro': '11',
'Dezembro': '12'
'Dezembro': '12',
};

static const _createScript = '''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AppSharedPreferences {
static final List<FavoriteWidgetType> defaultFavoriteCards = [
FavoriteWidgetType.schedule,
FavoriteWidgetType.exams,
FavoriteWidgetType.busStops
FavoriteWidgetType.busStops,
];
static const String hiddenExams = 'hidden_exams';
static const String favoriteRestaurants = 'favorite_restaurants';
Expand Down
2 changes: 1 addition & 1 deletion uni/lib/controller/local_storage/app_user_database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class AppUserDataDatabase extends AppDatabase {
);
await insertInDatabase('userdata', {
'key': 'feesLimit',
'value': feesLimit != null ? feesLimit.toIso8601String() : ''
'value': feesLimit != null ? feesLimit.toIso8601String() : '',
});
}
}
2 changes: 1 addition & 1 deletion uni/lib/model/entities/bug_report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ class BugReport {
'text': text,
'email': email,
'bugLabel': bugLabel!.item2,
'faculties': faculties
'faculties': faculties,
};
}
2 changes: 1 addition & 1 deletion uni/lib/model/entities/bus.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Bus {
return {
'busCode': busCode,
'destination': destination,
'direction': direction
'direction': direction,
};
}
}
4 changes: 2 additions & 2 deletions uni/lib/model/entities/exam.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Exam {
'Recurso': 'ER',
'Especial de Conclusão': 'EC',
'Port.Est.Especiais': 'EE',
'Exames ao abrigo de estatutos especiais': 'EAE'
'Exames ao abrigo de estatutos especiais': 'EAE',
};
static List<String> displayedTypes = types.keys.toList().sublist(0, 4);

Expand All @@ -56,7 +56,7 @@ class Exam {
'end': DateFormat('yyyy-MM-dd HH:mm:ss').format(end),
'rooms': rooms.join(','),
'examType': type,
'faculty': faculty
'faculty': faculty,
};
}

Expand Down
2 changes: 1 addition & 1 deletion uni/lib/model/entities/lecture.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Lecture {
'room': room,
'teacher': teacher,
'classNumber': classNumber,
'occurrId': occurrId
'occurrId': occurrId,
};
}

Expand Down
2 changes: 1 addition & 1 deletion uni/lib/model/entities/locations/coffee_machine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CoffeeMachine implements Location {
Map<String, dynamic> toMap({int? groupId}) {
return {
'floor': floor,
'type': locationTypeToString(LocationType.coffeeMachine)
'type': locationTypeToString(LocationType.coffeeMachine),
};
}
}
2 changes: 1 addition & 1 deletion uni/lib/model/entities/locations/restaurant_location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class RestaurantLocation implements Location {
return {
'floor': floor,
'type': locationTypeToString(LocationType.restaurant),
'name': name
'name': name,
};
}
}
2 changes: 1 addition & 1 deletion uni/lib/model/entities/locations/room_location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RoomLocation implements Location {
return {
'floor': floor,
'type': locationTypeToString(LocationType.room),
'first_room': roomNumber
'first_room': roomNumber,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SpecialRoomLocation implements Location {
'floor': floor,
'type': locationTypeToString(LocationType.printer),
'first_room': roomNumber,
'name': name
'name': name,
};
}
}
2 changes: 1 addition & 1 deletion uni/lib/model/entities/locations/store_location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class StoreLocation implements Location {
return {
'floor': floor,
'type': locationTypeToString(LocationType.store),
'name': name
'name': name,
};
}
}
2 changes: 1 addition & 1 deletion uni/lib/model/entities/locations/vending_machine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class VendingMachine implements Location {
Map<String, dynamic> toMap({int? groupId}) {
return {
'floor': floor,
'type': locationTypeToString(LocationType.vendingMachine)
'type': locationTypeToString(LocationType.vendingMachine),
};
}
}
2 changes: 1 addition & 1 deletion uni/lib/model/entities/meal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Meal {
'type': type,
'name': name,
'date': format.format(date),
'id_restaurant': restaurantId
'id_restaurant': restaurantId,
};
}
}
2 changes: 1 addition & 1 deletion uni/lib/model/entities/trip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Trip {
return {
'line': line,
'destination': destination,
'timeRemaining': timeRemaining
'timeRemaining': timeRemaining,
};
}

Expand Down
2 changes: 1 addition & 1 deletion uni/lib/model/providers/startup/profile_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ProfileProvider extends StateProviderNotifier {
await Future.wait([
fetchUserFees(session),
fetchUserPrintBalance(session),
fetchCourseUnitsAndCourseAverages(session)
fetchCourseUnitsAndCourseAverages(session),
]);
}

Expand Down
8 changes: 4 additions & 4 deletions uni/lib/model/providers/startup/session_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class SessionProvider extends StateProviderNotifier {
List<String> faculties, {
required bool persistentSession,
}) async {
final locale =
Provider.of<LocaleNotifier>(context, listen: false).getLocale();
Session? session;
try {
session = await NetworkRouter.login(
Expand All @@ -80,9 +82,7 @@ class SessionProvider extends StateProviderNotifier {
persistentSession: persistentSession,
);
} catch (e) {
throw InternetStatusException(
Provider.of<LocaleNotifier>(context, listen: false).getLocale(),
);
throw InternetStatusException(locale);
}

if (session == null) {
Expand All @@ -93,7 +93,7 @@ class SessionProvider extends StateProviderNotifier {
throw ExpiredCredentialsException();
} else {
throw WrongCredentialsException(
Provider.of<LocaleNotifier>(context, listen: false).getLocale(),
locale,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion uni/lib/utils/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ const faculties = [
'fmup',
'fmdup',
'fpceup',
'icbas'
'icbas',
];
2 changes: 1 addition & 1 deletion uni/lib/view/about/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AboutPageViewState extends GeneralPageViewState {
padding: EdgeInsets.all(queryData.size.width / 12),
child: const TermsAndConditions(),
),
)
),
],
);
}
Expand Down
4 changes: 2 additions & 2 deletions uni/lib/view/bug_report/widgets/form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ class BugReportFormState extends State<BugReportForm> {
},
isExpanded: true,
),
)
),
],
)
),
],
),
);
Expand Down
4 changes: 2 additions & 2 deletions uni/lib/view/bug_report/widgets/text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ class FormTextField extends StatelessWidget {
return formatValidator?.call(value);
},
),
)
),
],
)
),
],
),
);
Expand Down
10 changes: 5 additions & 5 deletions uni/lib/view/bus_stop_next_arrivals/bus_stop_next_arrivals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class BusStopNextArrivalsPageState
return LazyConsumer<BusStopProvider>(
builder: (context, busProvider) => ListView(
children: [
NextArrivals(busProvider.configuredBusStops, busProvider.status)
NextArrivals(busProvider.configuredBusStops, busProvider.status),
],
),
);
Expand Down Expand Up @@ -180,10 +180,10 @@ class NextArrivalsState extends State<NextArrivals> {
builder: (context) => const BusStopSelectionPage(),
),
),
)
),
],
),
)
),
];
}

Expand Down Expand Up @@ -212,7 +212,7 @@ class NextArrivalsState extends State<NextArrivals> {
children: getEachBusStopInfo(context),
),
),
)
),
];
}

Expand Down Expand Up @@ -250,7 +250,7 @@ class NextArrivalsState extends State<NextArrivals> {
trips: widget.buses[stopCode]?.trips ?? [],
stopCodeShow: false,
),
)
),
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion uni/lib/view/bus_stop_next_arrivals/widgets/trip_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class TripRow extends StatelessWidget {
timeRemaining: trip.timeRemaining.toString(),
),
],
)
),
],
);
}
Expand Down
2 changes: 1 addition & 1 deletion uni/lib/view/bus_stop_selection/bus_stop_selection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class BusStopSelectionPageState
),
],
),
)
),
],
);
},
Expand Down
4 changes: 2 additions & 2 deletions uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class BusStopSearch extends SearchDelegate<String> {
onPressed: () {
query = '';
},
)
),
];
}

Expand Down Expand Up @@ -119,7 +119,7 @@ class BusStopSearch extends SearchDelegate<String> {
Navigator.pop(context);
}
},
)
),
],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ class BusStopSelectionRowState extends State<BusStopSelectionRow> {
onPressed: () {
deleteStop(context);
},
)
),
],
)
),
],
),
),
Expand Down
2 changes: 1 addition & 1 deletion uni/lib/view/calendar/calendar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CalendarPageViewState extends GeneralPageViewState<CalendarPageView> {
style: TextStyle(fontSize: 18),
),
),
)
),
],
),
);
Expand Down
6 changes: 3 additions & 3 deletions uni/lib/view/common_widgets/generic_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class GenericCardState extends State<GenericCard> {
color: Color.fromARGB(0x1c, 0, 0, 0),
blurRadius: 7,
offset: Offset(0, 1),
)
),
],
borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
),
Expand Down Expand Up @@ -145,7 +145,7 @@ class GenericCardState extends State<GenericCard> {
margin: const EdgeInsets.only(top: 8),
child: getMoveIcon(context),
),
if (widget.editingMode) getDeleteIcon(context)
if (widget.editingMode) getDeleteIcon(context),
],
),
Container(
Expand All @@ -155,7 +155,7 @@ class GenericCardState extends State<GenericCard> {
bottom: padding,
),
child: widget.buildCardContent(context),
)
),
],
),
),
Expand Down
Loading

0 comments on commit 94631ea

Please sign in to comment.