always_declare_return_types

This commit is contained in:
Marvin M
2021-10-07 20:43:55 +02:00
parent 9d479e89b0
commit 1e8080cc02
9 changed files with 11 additions and 11 deletions

View File

@@ -24,7 +24,7 @@ linter:
# These rules are documented on and in the same order as
# the Dart Lint rules page to make maintenance easier
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
always_declare_return_types: false # definitely to be changed
always_declare_return_types: true
always_put_control_body_on_new_line: true
always_require_non_null_named_parameters: true
always_specify_types: false #to be changed

View File

@@ -55,5 +55,6 @@ class MeasurementCategory extends Equatable {
List<Object?> get props => [id, name, unit, entries];
// Helper function which makes the entries list of the toJson output null, as it isn't needed
//ignore: always_declare_return_types
static _nullValue(_) => null;
}

View File

@@ -46,7 +46,7 @@ class NutritionalValues {
return energy * 4.184;
}
add(NutritionalValues data) {
void add(NutritionalValues data) {
energy += data.energy;
protein += data.protein;
carbohydrates += data.carbohydrates;

View File

@@ -68,7 +68,7 @@ class WorkoutSession {
factory WorkoutSession.fromJson(Map<String, dynamic> json) => _$WorkoutSessionFromJson(json);
Map<String, dynamic> toJson() => _$WorkoutSessionToJson(this);
get impressionAsString {
String? get impressionAsString {
return IMPRESSION_MAP[impression];
}
}

View File

@@ -36,7 +36,7 @@ class BodyWeightProvider extends WgerBaseProvider with ChangeNotifier {
}
/// Clears all lists
clear() {
void clear() {
_entries = [];
}

View File

@@ -37,7 +37,7 @@ class GalleryProvider extends WgerBaseProvider with ChangeNotifier {
super(auth, client);
/// Clears all lists
clear() {
void clear() {
images = [];
}

View File

@@ -54,7 +54,7 @@ class NutritionPlansProvider extends WgerBaseProvider with ChangeNotifier {
}
/// Clears all lists
clear() {
void clear() {
_plans = [];
_ingredients = [];
}

View File

@@ -68,7 +68,7 @@ class WorkoutPlansProvider extends WgerBaseProvider with ChangeNotifier {
}
/// Clears all lists
clear() {
void clear() {
_currentPlan = null;
_workoutPlans = [];
_weightUnits = [];

View File

@@ -46,11 +46,11 @@ class Event {
Event(this._type, this._description);
get description {
String get description {
return _description;
}
get type {
EventType get type {
return _type;
}
}
@@ -267,9 +267,8 @@ class _DashboardCalendarWidgetState extends State<DashboardCalendarWidget>
case EventType.measurement:
return AppLocalizations.of(context).measurement;
}
return event.description.toString();
})()),
subtitle: Text(event.description.toString()),
subtitle: Text(event.description),
//onTap: () => print('$event tapped!'),
))
.toList()