mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-16 20:25:26 +00:00
Request and cache plugin information when connecting to the server
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user