mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
always_declare_return_types
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class BodyWeightProvider extends WgerBaseProvider with ChangeNotifier {
|
||||
}
|
||||
|
||||
/// Clears all lists
|
||||
clear() {
|
||||
void clear() {
|
||||
_entries = [];
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class GalleryProvider extends WgerBaseProvider with ChangeNotifier {
|
||||
super(auth, client);
|
||||
|
||||
/// Clears all lists
|
||||
clear() {
|
||||
void clear() {
|
||||
images = [];
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ class NutritionPlansProvider extends WgerBaseProvider with ChangeNotifier {
|
||||
}
|
||||
|
||||
/// Clears all lists
|
||||
clear() {
|
||||
void clear() {
|
||||
_plans = [];
|
||||
_ingredients = [];
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class WorkoutPlansProvider extends WgerBaseProvider with ChangeNotifier {
|
||||
}
|
||||
|
||||
/// Clears all lists
|
||||
clear() {
|
||||
void clear() {
|
||||
_currentPlan = null;
|
||||
_workoutPlans = [];
|
||||
_weightUnits = [];
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user