Skip to content

Conversation

@brokoli18
Copy link
Contributor

@brokoli18 brokoli18 commented Nov 8, 2025

Also fixed a circular dependency bug with background refresh.

Resolves #152

@kolaente kolaente changed the title Add the ability to complete tasks directly from the widget. feat: add the ability to complete tasks directly from the widget. Nov 9, 2025
@brokoli18
Copy link
Contributor Author

@kolaente Just FYI this MR will not resolve #152 as this will just let a user complete tasks (not add them). I am working on a separate change that will also let a user add tasks from the widgets (indirectly). Its almost ready to go

@brokoli18
Copy link
Contributor Author

@leschbenedikt @kolaente The above check is failing because now dart is saying that it wants to format 157 files? I dont think we want to touch so many files on this mr.

@kolaente
Copy link
Member

@brokoli18 it said only one was changed: lib/presentation/manager/task_page_controller.dart.

var title: String,
var dueDate: Date,
var today: Boolean,
var overdue: Boolean,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be unused

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is used when the widget pulls tasks from shared storage. I don't need most of the values from the default Task class for the widget so it was easier to create a new one

}

@Composable
private fun GlanceContent(context: Context, currentState: HomeWidgetGlanceState) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The size and position of the widget changes depending of the number of task.
I think this should always be the same.

Text("Today:")
}
items(todayTasks.sortedBy { it.dueDate }) { task ->
RenderRow(context, task, prefs, "HH:mm")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pattern shouldn't be hardcoded, the should depend on the locale.
You can just pick some of the predefined ones from flutter

Text("OverDue")
}
items(otherTasks.sortedBy { it.dueDate }) { task ->
RenderRow(context, task, prefs, "dd MMM HH:mm")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Future<void> widgetCallback(Uri? uri) async {
if (uri?.host == "completetask") {
String? taskID = uri?.queryParameters['taskID'];
completeTask(taskID!);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If taskID is null just do nothing
Otherwise it will crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quick add widget on homescreen

3 participants