2024-05-28 21:59:44 +02:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:sqflite/sqflite.dart';
|
|
|
|
import 'habit.dart';
|
|
|
|
|
|
|
|
abstract class ToDoInterface {
|
|
|
|
|
|
|
|
Future<void> createTable(Database database);
|
|
|
|
|
2024-06-16 17:12:28 +02:00
|
|
|
Future<int> insert({
|
|
|
|
required String title,
|
|
|
|
required String subtitle,
|
|
|
|
required IconData icon});
|
2024-05-28 21:59:44 +02:00
|
|
|
|
|
|
|
Future<List<Habit>> fetchAll();
|
|
|
|
|
|
|
|
Future<Habit?> fetchById(int id);
|
|
|
|
|
2024-06-16 17:12:28 +02:00
|
|
|
Future<int> update({
|
|
|
|
required int id,
|
|
|
|
required String title,
|
|
|
|
required String subtitle,
|
|
|
|
required IconData icon});
|
2024-05-28 21:59:44 +02:00
|
|
|
|
|
|
|
Future<void> delete(int id);
|
|
|
|
|
|
|
|
Future<int?>? updateCompletionStatus(int id, bool isCompleted);
|
|
|
|
}
|