mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-07-31 21:00:15 +02:00
Added category add/remove (no recolour/rename for now)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
// Exposes functions used to save/load app settings
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
@@ -144,4 +146,11 @@ class SettingsProvider with ChangeNotifier {
|
||||
prefs?.setString(settingId, value);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Map<String, int> get categories =>
|
||||
Map<String, int>.from(jsonDecode(prefs?.getString('categories') ?? '{}'));
|
||||
|
||||
set categories(Map<String, int> cats) {
|
||||
prefs?.setString('categories', jsonEncode(cats));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user