mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-01 05:10:15 +02:00
Added category filter
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:obtainium/app_sources/github.dart';
|
||||
import 'package:obtainium/components/generated_form.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
@@ -153,4 +154,13 @@ class SettingsProvider with ChangeNotifier {
|
||||
set categories(Map<String, int> cats) {
|
||||
prefs?.setString('categories', jsonEncode(cats));
|
||||
}
|
||||
|
||||
getCategoryFormItem({String initCategory = ''}) =>
|
||||
GeneratedFormItem('category', // TODO
|
||||
label: 'Category',
|
||||
opts: [
|
||||
const MapEntry('', 'No Category'),
|
||||
...categories.entries.map((e) => MapEntry(e.key, e.key)).toList()
|
||||
],
|
||||
defaultValue: initCategory);
|
||||
}
|
||||
|
Reference in New Issue
Block a user