first commit

This commit is contained in:
Patryk Hegenberg 2025-06-16 18:56:34 +02:00
commit a2663f415e
144 changed files with 6324 additions and 0 deletions

View file

@ -0,0 +1,51 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
class SettingsState {
final int trainingTimeMinutes;
final double weightLeft;
final double weightRight;
final int repsPerSet;
final int goalSets;
final String notes;
SettingsState({
this.trainingTimeMinutes = 20,
this.weightLeft = 16.0,
this.weightRight = 16.0,
this.repsPerSet = 5,
this.goalSets = 5,
this.notes = "",
});
SettingsState copyWith({
int? trainingTimeMinutes,
double? weightLeft,
double? weightRight,
int? repsPerSet,
int? goalSets,
String? notes,
}) {
return SettingsState(
trainingTimeMinutes: trainingTimeMinutes ?? this.trainingTimeMinutes,
weightLeft: weightLeft ?? this.weightLeft,
weightRight: weightRight ?? this.weightRight,
repsPerSet: repsPerSet ?? this.repsPerSet,
goalSets: goalSets ?? this.goalSets,
notes: notes ?? this.notes,
);
}
}
class SettingsNotifier extends StateNotifier<SettingsState> {
SettingsNotifier() : super(SettingsState());
void updateSettings(SettingsState newSettings) {
state = newSettings;
}
}
final settingsProvider = StateNotifierProvider<SettingsNotifier, SettingsState>(
(ref) {
return SettingsNotifier();
},
);