mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 02:05:29 +00:00
Defines a class for representing an InvenTreePlugin instance
This commit is contained in:
13
lib/api.dart
13
lib/api.dart
@ -17,6 +17,7 @@ import "package:flutter_cache_manager/flutter_cache_manager.dart";
|
||||
import "package:inventree/widget/dialogs.dart";
|
||||
import "package:inventree/l10.dart";
|
||||
import "package:inventree/inventree/sentry.dart";
|
||||
import "package:inventree/inventree/model.dart";
|
||||
import "package:inventree/user_profile.dart";
|
||||
import "package:inventree/widget/snacks.dart";
|
||||
import "package:path_provider/path_provider.dart";
|
||||
@ -227,9 +228,14 @@ class InvenTreeAPI {
|
||||
|
||||
int get apiVersion => _apiVersion;
|
||||
|
||||
// Are plugins enabled on the server?
|
||||
bool _pluginsEnabled = false;
|
||||
|
||||
bool pluginsEnabled() => supportPlugins() && _pluginsEnabled;
|
||||
// True plugin support requires API v34 or newer
|
||||
// Returns True only if the server API version is new enough, and plugins are enabled
|
||||
bool pluginsEnabled() => apiVersion >= 34 && _pluginsEnabled;
|
||||
|
||||
List<InvenTreePlugin> plugins = [];
|
||||
|
||||
// Getter for server version information
|
||||
String get version => _version;
|
||||
@ -260,11 +266,6 @@ class InvenTreeAPI {
|
||||
return apiVersion >= 14;
|
||||
}
|
||||
|
||||
// True plugin support requires API v34 or newer
|
||||
bool supportPlugins() {
|
||||
return apiVersion >= 34;
|
||||
}
|
||||
|
||||
/*
|
||||
* Connect to the remote InvenTree server:
|
||||
*
|
||||
|
Reference in New Issue
Block a user