-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow multi deleting of plans - 1.0.70 🚀
- Loading branch information
1 parent
e21a8fb
commit 1063c7f
Showing
23 changed files
with
242 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- Allow multi deleting of plans | ||
- Rename "Enter weight" as "Weight" on graphs page | ||
- Add edit button to graphs page dropdown | ||
- Focus distance after submitting duration | ||
- Fix crashes with inconsistent cardio types | ||
- Remove history suffix from graph_history |
Binary file modified
BIN
+537 Bytes
(100%)
fastlane/metadata/android/en-US/images/phoneScreenshots/1_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.39 KB
(100%)
fastlane/metadata/android/en-US/images/phoneScreenshots/2_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.16 KB
(99%)
fastlane/metadata/android/en-US/images/phoneScreenshots/3_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-682 Bytes
(99%)
fastlane/metadata/android/en-US/images/phoneScreenshots/5_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.95 KB
(98%)
fastlane/metadata/android/en-US/images/phoneScreenshots/6_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-9 Bytes
(100%)
fastlane/metadata/android/en-US/images/phoneScreenshots/8_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-468 Bytes
(100%)
fastlane/metadata/android/en-US/images/sevenInchScreenshots/1_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.35 KB
(99%)
fastlane/metadata/android/en-US/images/sevenInchScreenshots/2_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-329 Bytes
(100%)
fastlane/metadata/android/en-US/images/sevenInchScreenshots/3_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.29 KB
(96%)
fastlane/metadata/android/en-US/images/sevenInchScreenshots/6_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-18 Bytes
(100%)
fastlane/metadata/android/en-US/images/sevenInchScreenshots/8_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+656 Bytes
(100%)
fastlane/metadata/android/en-US/images/tenInchScreenshots/1_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.58 KB
(100%)
fastlane/metadata/android/en-US/images/tenInchScreenshots/2_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-371 Bytes
(100%)
fastlane/metadata/android/en-US/images/tenInchScreenshots/3_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+806 Bytes
(100%)
fastlane/metadata/android/en-US/images/tenInchScreenshots/5_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.06 KB
(97%)
fastlane/metadata/android/en-US/images/tenInchScreenshots/6_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1 Byte
(100%)
fastlane/metadata/android/en-US/images/tenInchScreenshots/8_en-US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import 'dart:async'; | ||
import 'package:drift/drift.dart' as drift; | ||
import 'package:flexify/constants.dart'; | ||
import 'package:flexify/database.dart'; | ||
import 'package:flexify/main.dart'; | ||
import 'package:flexify/plan_tile.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class PlansList extends StatelessWidget { | ||
final String searchText; | ||
final List<Plan> plans; | ||
final Future<void> Function({List<Plan>? plans}) updatePlans; | ||
final GlobalKey<NavigatorState> navigatorKey; | ||
final Set<int> selected; | ||
final Function(int) onSelect; | ||
|
||
const PlansList({ | ||
super.key, | ||
required this.plans, | ||
required this.searchText, | ||
required this.updatePlans, | ||
required this.navigatorKey, | ||
required this.selected, | ||
required this.onSelect, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final weekday = weekdays[DateTime.now().weekday - 1]; | ||
|
||
if (plans.isEmpty) | ||
return const ListTile( | ||
title: Text("No plans yet."), | ||
subtitle: Text("Tap the plus button in the bottom right to add plans."), | ||
); | ||
|
||
return ReorderableListView.builder( | ||
itemCount: plans.length, | ||
itemBuilder: (context, index) { | ||
final plan = plans[index]; | ||
return PlanTile( | ||
key: Key(plan.id.toString()), | ||
plan: plan, | ||
weekday: weekday, | ||
index: index, | ||
navigatorKey: navigatorKey, | ||
refresh: updatePlans, | ||
selected: selected, | ||
onSelect: (id) => onSelect(id), | ||
); | ||
}, | ||
onReorder: (int oldIndex, int newIndex) async { | ||
if (oldIndex < newIndex) { | ||
newIndex--; | ||
} | ||
|
||
final temp = plans[oldIndex]; | ||
plans.removeAt(oldIndex); | ||
plans.insert(newIndex, temp); | ||
|
||
await updatePlans(plans: plans); | ||
await db.transaction(() async { | ||
for (int i = 0; i < plans.length; i++) { | ||
final plan = plans[i]; | ||
final updatedPlan = | ||
plan.toCompanion(false).copyWith(sequence: drift.Value(i)); | ||
await db.update(db.plans).replace(updatedPlan); | ||
} | ||
}); | ||
}, | ||
); | ||
} | ||
} |
Oops, something went wrong.