onyx-tasks/apps/flutter/lib/src/rust/api.dart
Tristan Michael be65d0e714 feat(flutter): add move, rename, grouping, file watcher
Rust API: add move_task, rename_list, set/get_group_by_due_date,
watch_workspace_changes (stream-based via StreamSink) with notify
crate. Self-change suppression via mute_watcher().

Dart frontend: moveTask, renameList, setGroupByDueDate in AppState.
Move-to bottom sheet in TaskDetailView. Rename dialog and group-by-
due-date toggle in list context menu. File watcher stream subscription
on workspace load/switch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 13:28:17 -07:00

223 lines
6.4 KiB
Dart

// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.11.1.
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import 'frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
// These functions are ignored because they are not marked as `pub`: `config_to_dto`, `ensure_repo`, `mute_watcher`, `task_to_dto`
// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `AppState`
Future<AppConfigDto> getConfig() => RustLib.instance.api.crateApiGetConfig();
Future<void> initWorkspace({required String path}) =>
RustLib.instance.api.crateApiInitWorkspace(path: path);
Future<void> addWorkspace({required String name, required String path}) =>
RustLib.instance.api.crateApiAddWorkspace(name: name, path: path);
Future<void> setCurrentWorkspace({required String name}) =>
RustLib.instance.api.crateApiSetCurrentWorkspace(name: name);
Future<void> removeWorkspace({required String name}) =>
RustLib.instance.api.crateApiRemoveWorkspace(name: name);
Future<List<TaskListDto>> getLists() => RustLib.instance.api.crateApiGetLists();
Future<TaskListDto> createList({required String name}) =>
RustLib.instance.api.crateApiCreateList(name: name);
Future<void> deleteList({required String listId}) =>
RustLib.instance.api.crateApiDeleteList(listId: listId);
Future<List<TaskDto>> listTasks({required String listId}) =>
RustLib.instance.api.crateApiListTasks(listId: listId);
Future<TaskDto> createTask({
required String listId,
required String title,
required String description,
}) => RustLib.instance.api.crateApiCreateTask(
listId: listId,
title: title,
description: description,
);
Future<void> updateTask({required String listId, required TaskDto task}) =>
RustLib.instance.api.crateApiUpdateTask(listId: listId, task: task);
Future<void> deleteTask({required String listId, required String taskId}) =>
RustLib.instance.api.crateApiDeleteTask(listId: listId, taskId: taskId);
Future<TaskDto> toggleTask({required String listId, required String taskId}) =>
RustLib.instance.api.crateApiToggleTask(listId: listId, taskId: taskId);
Future<void> reorderTask({
required String listId,
required String taskId,
required int newPosition,
}) => RustLib.instance.api.crateApiReorderTask(
listId: listId,
taskId: taskId,
newPosition: newPosition,
);
Future<void> moveTask({
required String fromListId,
required String toListId,
required String taskId,
}) => RustLib.instance.api.crateApiMoveTask(
fromListId: fromListId,
toListId: toListId,
taskId: taskId,
);
Future<void> renameList({required String listId, required String newName}) =>
RustLib.instance.api.crateApiRenameList(listId: listId, newName: newName);
Future<void> setGroupByDueDate({
required String listId,
required bool enabled,
}) => RustLib.instance.api.crateApiSetGroupByDueDate(
listId: listId,
enabled: enabled,
);
Future<bool> getGroupByDueDate({required String listId}) =>
RustLib.instance.api.crateApiGetGroupByDueDate(listId: listId);
Future<Stream<void>> watchWorkspaceChanges({required String path}) =>
RustLib.instance.api.crateApiWatchWorkspaceChanges(path: path);
Future<String> greet({required String name}) =>
RustLib.instance.api.crateApiGreet(name: name);
class AppConfigDto {
final List<WorkspaceEntry> workspaces;
final String? currentWorkspace;
const AppConfigDto({required this.workspaces, this.currentWorkspace});
@override
int get hashCode => workspaces.hashCode ^ currentWorkspace.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is AppConfigDto &&
runtimeType == other.runtimeType &&
workspaces == other.workspaces &&
currentWorkspace == other.currentWorkspace;
}
class TaskDto {
final String id;
final String title;
final String description;
final String status;
final String? dueDate;
final String createdAt;
final String updatedAt;
final String? parentId;
const TaskDto({
required this.id,
required this.title,
required this.description,
required this.status,
this.dueDate,
required this.createdAt,
required this.updatedAt,
this.parentId,
});
@override
int get hashCode =>
id.hashCode ^
title.hashCode ^
description.hashCode ^
status.hashCode ^
dueDate.hashCode ^
createdAt.hashCode ^
updatedAt.hashCode ^
parentId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is TaskDto &&
runtimeType == other.runtimeType &&
id == other.id &&
title == other.title &&
description == other.description &&
status == other.status &&
dueDate == other.dueDate &&
createdAt == other.createdAt &&
updatedAt == other.updatedAt &&
parentId == other.parentId;
}
class TaskListDto {
final String id;
final String title;
final String createdAt;
final String updatedAt;
final bool groupByDueDate;
const TaskListDto({
required this.id,
required this.title,
required this.createdAt,
required this.updatedAt,
required this.groupByDueDate,
});
@override
int get hashCode =>
id.hashCode ^
title.hashCode ^
createdAt.hashCode ^
updatedAt.hashCode ^
groupByDueDate.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is TaskListDto &&
runtimeType == other.runtimeType &&
id == other.id &&
title == other.title &&
createdAt == other.createdAt &&
updatedAt == other.updatedAt &&
groupByDueDate == other.groupByDueDate;
}
class WorkspaceEntry {
final String name;
final String path;
final String? webdavUrl;
final String? lastSync;
const WorkspaceEntry({
required this.name,
required this.path,
this.webdavUrl,
this.lastSync,
});
@override
int get hashCode =>
name.hashCode ^ path.hashCode ^ webdavUrl.hashCode ^ lastSync.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is WorkspaceEntry &&
runtimeType == other.runtimeType &&
name == other.name &&
path == other.path &&
webdavUrl == other.webdavUrl &&
lastSync == other.lastSync;
}