Skip to content

Commit

Permalink
Remove workouts var and then statements
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mabe committed Sep 27, 2024
1 parent 0ee37ef commit 7760232
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions lib/pages/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ class _MyHomePageState extends State<MyHomePage> {
///
List<Workout> reorderableWorkoutList = [];

/// The initial list of workouts to be loaded fresh
/// from the DB.
///
late Future workouts;

late WorkoutProvider workoutProvider;

/// Initialize...
Expand Down Expand Up @@ -104,14 +99,7 @@ class _MyHomePageState extends State<MyHomePage> {
workout: tappedWorkout,
),
),
).then((value) {
/// When we come back to the hompage, refresh the
/// list of workouts by reloading from the DB.
///
setState(() {
workouts = DatabaseManager().lists(DatabaseManager().initDB());
});
});
);
}
// ---

Expand Down Expand Up @@ -226,14 +214,7 @@ class _MyHomePageState extends State<MyHomePage> {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SelectTimer()),
).then((value) {
/// When we come back to the hompage, refresh the
/// list of workouts by reloading from the DB.
///
setState(() {
workouts = DatabaseManager().lists(DatabaseManager().initDB());
});
});
);
}
// ---

Expand All @@ -254,7 +235,7 @@ class _MyHomePageState extends State<MyHomePage> {
exporting = true;
});

List<Workout> loadedWorkouts = await workouts;
List<Workout> loadedWorkouts = workoutProvider.workouts;

LocalFileUtil fileUtil = LocalFileUtil();

Expand Down Expand Up @@ -298,7 +279,7 @@ class _MyHomePageState extends State<MyHomePage> {
setState(() {
exporting = true;
});
List<Workout> loadedWorkouts = await workouts;
List<Workout> loadedWorkouts = workoutProvider.workouts;

LocalFileUtil fileUtil = LocalFileUtil();

Expand Down

0 comments on commit 7760232

Please sign in to comment.