
class TasksPane extends StatelessWidget with WatchItMixin {
const TasksPane({super.key});
@override
Widget build(BuildContext context) {
final controller = watchIt();
final log = Logger(graphicPrinter);
return Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
IconButton(
onPressed: controller.all,
icon: const FaIcon(Icons.filter_list_off),
tooltip: 'View all tasks',
iconSize: 18.0,
// color: Theme.of(context).highlightColor,
),
IconButton(
onPressed: controller.soon,
icon: const FaIcon(Icons.timer),
tooltip: 'View tasks for this week',
iconSize: 18.0,
),
IconButton(
onPressed: controller.urgent,
icon: const FaIcon(Icons.priority_high),
tooltip: 'View tasks for this week',
iconSize: 18.0,
),
IconButton(
onPressed: controller.today,
icon: const FaIcon(Icons.today),
tooltip: 'View urgent tasks',
iconSize: 18.0,
),
],
),
Expanded(
child: ListView.builder(
itemCount: controller.todos.length,
itemBuilder: (context, index) {
final todo = controller.todos[index];
const child = ListTile();
return Draggable(
data: todo,
feedback: ConstrainedBox(
constraints: BoxConstraints.loose(const Size(500, 60)),
child: const Material(
child: Opacity(
opacity: 0.75,
child: child,
),
),
),
childWhenDragging:
const Opacity(opacity: 0.5, child: child),
onDragEnd: (x) =>
log.i('$todo Drag ended with ${x.wasAccepted}'),
child: child);
}),
),
],
);
}
}
Подробнее здесь: https://stackoverflow.com/questions/786 ... n-listtile
Мобильная версия