mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Request and cache plugin information when connecting to the server
This commit is contained in:
parent
0c9c7b2a68
commit
de45e18359
2 changed files with 54 additions and 4 deletions
|
|
@ -509,8 +509,27 @@ class InvenTreePlugin extends InvenTreeModel {
|
|||
|
||||
InvenTreePlugin.fromJson(Map<String, dynamic> json) : super.fromJson(json);
|
||||
|
||||
@override
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) {
|
||||
return InvenTreePlugin.fromJson(json);
|
||||
}
|
||||
|
||||
@override
|
||||
String get URL => "plugin/";
|
||||
|
||||
String get key => (jsondata["key"] ?? "") as String;
|
||||
|
||||
bool get active => (jsondata["active"] ?? false) as bool;
|
||||
|
||||
// Return the metadata struct for this plugin
|
||||
Map<String, dynamic> get _meta => (jsondata["meta"] ?? {}) as Map<String, dynamic>;
|
||||
|
||||
// Return the mixins struct for this plugin
|
||||
Map<String, dynamic> get _mixins => (jsondata["mixins"] ?? {}) as Map<String, dynamic>;
|
||||
|
||||
bool supportsMixin(String mixin) {
|
||||
return _mixins.containsKey(mixin);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue