add a shit ton of feature for the custom srs

This commit is contained in:
Rene Kievits
2025-10-30 03:44:04 +01:00
parent b58a4020e1
commit ee4fd7ffc1
13 changed files with 787 additions and 311 deletions

View File

@@ -6,6 +6,8 @@ import 'package:sqflite/sqflite.dart';
import '../models/kanji_item.dart';
import '../api/wk_client.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
class DeckRepository {
Database? _db;
String? _apiKey;
@@ -98,6 +100,12 @@ class DeckRepository {
}
Future<String?> loadApiKey() async {
final envApiKey = dotenv.env['WANIKANI_API_KEY'];
if (envApiKey != null && envApiKey.isNotEmpty) {
_apiKey = envApiKey;
return _apiKey;
}
final db = await _openDb();
final rows = await db.query(
'settings',