mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
feat(drift-database): Shifted from shared prefs to drift for Exercises
This commit is contained in:
@@ -18,8 +18,10 @@
|
||||
|
||||
import 'package:wger/models/body_weight/weight_entry.dart';
|
||||
|
||||
final weightEntry1 = WeightEntry(id: 1, weight: 80, date: DateTime(2021, 01, 01));
|
||||
final weightEntry2 = WeightEntry(id: 2, weight: 81, date: DateTime(2021, 01, 10));
|
||||
final weightEntry1 =
|
||||
WeightEntry(id: 1, weight: 80, date: DateTime(2021, 01, 01));
|
||||
final weightEntry2 =
|
||||
WeightEntry(id: 2, weight: 81, date: DateTime(2021, 01, 10));
|
||||
|
||||
List<WeightEntry> getWeightEntries() {
|
||||
return [weightEntry1, weightEntry2];
|
||||
|
||||
@@ -28,9 +28,12 @@ const tLanguage2 = Language(id: 2, shortName: 'en', fullName: 'English');
|
||||
const tLanguage3 = Language(id: 3, shortName: 'fr', fullName: 'Français');
|
||||
const testLanguages = [tLanguage1, tLanguage2, tLanguage3];
|
||||
|
||||
const tMuscle1 = Muscle(id: 1, name: 'Flutterus maximus', nameEn: 'Glutes', isFront: true);
|
||||
const tMuscle2 = Muscle(id: 2, name: 'Biceps brachii', nameEn: 'Biceps', isFront: true);
|
||||
const tMuscle3 = Muscle(id: 3, name: 'Gluteus maximus', nameEn: 'Glutes', isFront: false);
|
||||
const tMuscle1 =
|
||||
Muscle(id: 1, name: 'Flutterus maximus', nameEn: 'Glutes', isFront: true);
|
||||
const tMuscle2 =
|
||||
Muscle(id: 2, name: 'Biceps brachii', nameEn: 'Biceps', isFront: true);
|
||||
const tMuscle3 =
|
||||
Muscle(id: 3, name: 'Gluteus maximus', nameEn: 'Glutes', isFront: false);
|
||||
const testMuscles = [tMuscle1, tMuscle2, tMuscle3];
|
||||
|
||||
const tCategory1 = ExerciseCategory(id: 1, name: 'Arms');
|
||||
@@ -38,7 +41,13 @@ const tCategory2 = ExerciseCategory(id: 2, name: 'Legs');
|
||||
const tCategory3 = ExerciseCategory(id: 3, name: 'Abs');
|
||||
const tCategory4 = ExerciseCategory(id: 4, name: 'Shoulders');
|
||||
const tCategory5 = ExerciseCategory(id: 5, name: 'Calves');
|
||||
const testCategories = [tCategory1, tCategory2, tCategory3, tCategory4, tCategory5];
|
||||
const testCategories = [
|
||||
tCategory1,
|
||||
tCategory2,
|
||||
tCategory3,
|
||||
tCategory4,
|
||||
tCategory5
|
||||
];
|
||||
|
||||
const tEquipment1 = Equipment(id: 1, name: 'Bench');
|
||||
const tEquipment2 = Equipment(id: 1, name: 'Dumbbell');
|
||||
@@ -143,7 +152,8 @@ final crunchesFr = Translation(
|
||||
uuid: 'd83f572d-add5-48dc-89cf-75f6770284f1',
|
||||
created: DateTime(2021, 4, 1),
|
||||
name: 'Crunches',
|
||||
description: 'The man in black fled across the desert, and the gunslinger followed',
|
||||
description:
|
||||
'The man in black fled across the desert, and the gunslinger followed',
|
||||
baseId: deadLift.id,
|
||||
language: tLanguage3,
|
||||
);
|
||||
@@ -173,7 +183,8 @@ final curlsEn = Translation(
|
||||
uuid: '259a637e-957f-4fe1-b61b-f56e3793ebcd',
|
||||
created: DateTime(2021, 4, 1),
|
||||
name: 'Curls',
|
||||
description: 'It was a bright cold day in April, and the clocks were striking thirteen',
|
||||
description:
|
||||
'It was a bright cold day in April, and the clocks were striking thirteen',
|
||||
baseId: curls.id,
|
||||
language: tLanguage2,
|
||||
);
|
||||
@@ -183,7 +194,8 @@ final squatsEn = Translation(
|
||||
uuid: '259a637e-957f-4fe1-b61b-f56e3793ebcd',
|
||||
created: DateTime(2021, 4, 1),
|
||||
name: 'Squats',
|
||||
description: 'It was a bright cold day in April, and the clocks were striking thirteen',
|
||||
description:
|
||||
'It was a bright cold day in April, and the clocks were striking thirteen',
|
||||
baseId: curls.id,
|
||||
language: tLanguage2,
|
||||
);
|
||||
@@ -193,7 +205,8 @@ final sideRaisesEn = Translation(
|
||||
uuid: '6bf89ad0-5a43-4e98-91d3-a8c6886c9712',
|
||||
created: DateTime(2022, 11, 1),
|
||||
name: 'Side raises',
|
||||
description: 'It was a bright cold day in April, and the clocks were striking thirteen',
|
||||
description:
|
||||
'It was a bright cold day in April, and the clocks were striking thirteen',
|
||||
baseId: curls.id,
|
||||
language: tLanguage2,
|
||||
);
|
||||
|
||||
@@ -19,16 +19,23 @@
|
||||
import 'package:wger/models/measurements/measurement_category.dart';
|
||||
import 'package:wger/models/measurements/measurement_entry.dart';
|
||||
|
||||
final e1 = MeasurementEntry(id: 1, category: 1, date: DateTime(2022, 9, 10), value: 30, notes: '');
|
||||
final e2 = MeasurementEntry(id: 2, category: 1, date: DateTime(2022, 10, 5), value: 25, notes: '');
|
||||
final e3 = MeasurementEntry(id: 3, category: 1, date: DateTime(2022, 10, 10), value: 17, notes: '');
|
||||
final e4 = MeasurementEntry(id: 4, category: 1, date: DateTime(2022, 11, 1), value: 17, notes: '');
|
||||
final e5 = MeasurementEntry(id: 5, category: 1, date: DateTime(2022, 11, 10), value: 20, notes: '');
|
||||
final e6 = MeasurementEntry(id: 6, category: 1, date: DateTime(2022, 11, 15), value: 23, notes: '');
|
||||
final e1 = MeasurementEntry(
|
||||
id: 1, category: 1, date: DateTime(2022, 9, 10), value: 30, notes: '');
|
||||
final e2 = MeasurementEntry(
|
||||
id: 2, category: 1, date: DateTime(2022, 10, 5), value: 25, notes: '');
|
||||
final e3 = MeasurementEntry(
|
||||
id: 3, category: 1, date: DateTime(2022, 10, 10), value: 17, notes: '');
|
||||
final e4 = MeasurementEntry(
|
||||
id: 4, category: 1, date: DateTime(2022, 11, 1), value: 17, notes: '');
|
||||
final e5 = MeasurementEntry(
|
||||
id: 5, category: 1, date: DateTime(2022, 11, 10), value: 20, notes: '');
|
||||
final e6 = MeasurementEntry(
|
||||
id: 6, category: 1, date: DateTime(2022, 11, 15), value: 23, notes: '');
|
||||
|
||||
List<MeasurementCategory> getMeasurementCategories() {
|
||||
final entries = [e1, e2, e3, e4, e5, e6];
|
||||
final category = MeasurementCategory(id: 1, name: 'Body fat', unit: '%', entries: entries);
|
||||
final category =
|
||||
MeasurementCategory(id: 1, name: 'Body fat', unit: '%', entries: entries);
|
||||
|
||||
return [category];
|
||||
}
|
||||
|
||||
@@ -29,7 +29,8 @@ import './exercises.dart';
|
||||
const weightUnit1 = WeightUnit(id: 1, name: 'kg');
|
||||
const weightUnit2 = WeightUnit(id: 2, name: 'metric tonnes');
|
||||
|
||||
const RepetitionUnit repetitionUnit1 = RepetitionUnit(id: 1, name: 'Repetitions');
|
||||
const RepetitionUnit repetitionUnit1 =
|
||||
RepetitionUnit(id: 1, name: 'Repetitions');
|
||||
const RepetitionUnit repetitionUnit2 = RepetitionUnit(id: 2, name: 'Hours');
|
||||
|
||||
WorkoutPlan getWorkout() {
|
||||
|
||||
Reference in New Issue
Block a user