ServiceFeatureTable class final

A table of features that typically represent real-world objects created from an ArcGIS feature service.

An instance of this class represents the dataset of an individual layer or table in an ArcGIS map or feature service. The map or feature service may be hosted in the cloud on ArcGIS Online, or on-premises on an ArcGIS Server. To access these services you may need to provide authentication in your application.

You can construct a ServiceFeatureTable directly from the feature service using its URI or PortalItem. Alternatively, you can obtain a ServiceFeatureTable from a FeatureLayer or a FeatureTable that is part of an ArcGISMap or ArcGISScene. You can also obtain a ServiceFeatureTable directly from its service geodatabase using ServiceGeodatabase.getTable.

The ServiceFeatureTable adopts the loadable pattern so many of its properties are initialized asynchronously after connecting to the service. For more information, see Loadable.

Display

If the FeatureTable.hasGeometry is true, you can display the features in an ArcGISMap or ArcGISScene. To do this create a FeatureLayer from the feature table and add it to the map or scene's collection of operational layers (GeoModel.operationalLayers). Spatial features are requested in the SpatialReference that matches the ArcGISMap or ArcGISScene and are displayed using the ArcGISSymbol information defined by the map or feature service. Query You can query the data in the ServiceFeatureTable based on SQL expressions and/or spatial relationships. Use the QueryParameters object to define your spatial or attribute query and pass it to the ServiceFeatureTable.queryFeaturesWithFieldOptions method. If the service feature table is related to any other tables that are part of the map or scene, use the ServiceFeatureTable.queryRelatedFeaturesWithFieldOptions method to query the related tables. For more information, see RelatedQueryParameters. Edit A ServiceFeatureTable can have editable attribute fields, feature templates (FeatureTemplate), feature types (FeatureType), and editing capabilities defined in ArcGISFeatureLayerInfo.capabilities. You can create, delete, and update data in the local cache depending upon whether the service allows those operations, who owns the data, and what ownership-based access control policies are in place. Permission to edit the data is managed by the author of the feature service. Explore FeatureTable.isEditable, FeatureTable.canAdd, FeatureTable.canUpdate, and FeatureTable.canDelete for information on what is permitted. If the service supports attachments (ArcGISFeatureTable.hasAttachments), you can also view and potentially edit the attachments. If you want to apply your edits to the feature service, you must call the ServiceGeodatabase.applyEdits method on the ServiceFeatureTable.serviceGeodatabase. This will ensure that the table and any tables involved in geodatabase behavior are updated. Areas that have geodatabase behavior include: * Composite relationships * Annotation feature layers * Utility network association deletion semantics * Attribute rules

Contingent Values The ServiceFeatureTable supports querying and editing contingent values. See ArcGISFeatureTable.getContingentValues(ArcGISFeature, String) for more information.

Offline If you wish to adopt an offline workflow, you can take areas of a ServiceFeatureTable offline using the GeodatabaseSyncTask. If you wish to take an ArcGISMap offline use the OfflineMapTask. See Build offline applications for more information.

Feature Request Mode The FeatureRequestMode determines whether ServiceFeatureTable features are cached locally (for quicker access by map and scene layers) and whether queries are performed on the local cache or on the server. Consider which of these 3 modes is appropriate for your application:

Inheritance
Implemented types

Constructors

ServiceFeatureTable.fromTable(ServiceFeatureTable table, {required RelationshipInfo relationshipInfo})
Creates a new service feature table object from the specified table and relationship information.
factory
ServiceFeatureTable.withFeatureLayerItem(Item item)
Creates a new service feature table object from an ArcGIS feature service or feature layer portal item.
factory
ServiceFeatureTable.withItem(Item item, {required int layerId})
Creates a new service feature table object from a feature service portal item.
factory
ServiceFeatureTable.withUri(Uri uri)
Creates a new service feature table object from a given URI.
factory

Properties

apiKey String
The API key allows your app to access ArcGIS location services and private portal items.
getter/setter pairoverride
bufferFactor double
The factor used to calculate a buffered extent around the current visible area when requesting features from a service.
getter/setter pair
defaultSubtypeCode → dynamic
The table's default subtype code.
no setterinherited
definitionExpression String
An expression (SQL where clause) to filter features queried in this table.
getter/setter pair
displayName String
A user-friendly name that can be displayed in the UI (for example, in a Table of Contents).
getter/setter pairinherited
editableAttributeFields List<Field>
A list of editable fields.
no setterinherited
extent Envelope?
The geographic extent of features within the table.
no setterinherited
featureRequestMode FeatureRequestMode
Defines when features and non-spatial records are requested from the feature service.
getter/setter pair
featureSubtypes List<FeatureSubtype>
The table's feature subtypes.
no setterinherited
featureTemplates List<FeatureTemplate>
A list of the feature templates on this table.
no setterinherited
featureTypes List<FeatureType>
The feature types for this table.
no setterinherited
fields List<Field>
The collection of Field objects representing the fields of the feature table.
no setterinherited
geodatabaseVersion String
The service geodatabase version name.
getter/setter pair
geometryType GeometryType
The type of geometry of the features stored in this table.
no setterinherited
globalIdField String
The global id field name.
no setterinherited
hasAttachments bool
True if the features in this table support attachments, false otherwise.
no setterinherited
hasGeometry bool
True if the feature table supports geographic features, false otherwise.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasM bool
True if the feature table supports geometries with M values, false otherwise.
no setterinherited
hasZ bool
True if the feature table supports geometries with Z values, false otherwise.
no setterinherited
isEditable bool
True if this feature table is editable, false otherwise.
no setterinherited
item Item?
The Item that defines the service feature table.
no setter
layer Layer?
The layer that displays this table, if any.
no setterinherited
layerInfo ArcGISFeatureLayerInfo?
The service information related to the feature layer.
no setterinherited
loadError ArcGISException?
The load error.
no setterinherited
loadStatus LoadStatus
The load status.
no setterinherited
numberOfFeatures int
The number of features in the table.
no setterinherited
objectIdField String
The object id field name.
no setterinherited
onLoadStatusChanged Stream<LoadStatus>
A stream that reports changes to the LoadStatus.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serviceGeodatabase ServiceGeodatabase?
The service geodatabase this service feature table is part of.
no setter
serviceLayerId int
The layer ID in the feature service that this table was created from.
no setterinherited
spatialReference SpatialReference?
The spatial reference of the table.
no setterinherited
subtypeField String
The table's subtype field.
no setterinherited
tableName String
The name of the table in the source dataset.
no setterinherited
typeIdField String
The type id field name.
no setterinherited
uri Uri?
The URI of the service feature table.
no setter
useAdvancedSymbology bool
True if the table is using advanced symbology, false otherwise.
getter/setter pairinherited
username String
The username of the feature table.
no setterinherited

Methods

addFeature(Feature feature) Future<void>
Adds a feature to the table.
inherited
addFeatures(List<Feature> features) Future<void>
Adds a collection of features to the table.
inherited
applyEdits() Future<List<FeatureEditResult>>
Uploads any changes to the local table to the feature service.
canAdd() bool
Determines whether you can add new features to the table.
inherited
cancelLoad() → void
Cancels loading metadata for the object.
inherited
canDelete(Feature feature) bool
Determines whether you can delete the feature from the table.
inherited
canEditGeometry() bool
Determines whether you can edit the geometry field in a table.
inherited
canUpdate(Feature feature) bool
Determines whether you can update the feature in the table.
inherited
clearCache({required bool keepLocalEdits}) → void
Clears cached data.
createFeature({Map<String, dynamic> attributes = const {}, Geometry? geometry}) Feature
Creates a new feature with the provided attribute values and, optionally, geometry.
inherited
createFeatureWithSubtype(FeatureSubtype featureSubtype, {Geometry? geometry}) ArcGISFeature
Creates a new feature based on the provided feature subtype and geometry.
inherited
createFeatureWithTemplate(FeatureTemplate featureTemplate, {Geometry? geometry}) ArcGISFeature
Creates a new feature based on the provided feature template and geometry.
inherited
createFeatureWithType(FeatureType featureType, {Geometry? geometry}) ArcGISFeature
Creates a new feature based on the provided feature type and geometry.
inherited
deleteFeature(Feature feature) Future<void>
Deletes a feature from the table.
inherited
deleteFeatures(List<Feature> features) Future<void>
Deletes a collection of features from the table.
inherited
getAddedFeatures() Future<FeatureQueryResult>
Returns the features added since the last sync.
inherited
getAddedFeaturesCount() Future<int>
Returns the number of features added since the last sync.
inherited
getDeletedFeatures() Future<FeatureQueryResult>
Returns the features deleted since the last sync.
inherited
getDeletedFeaturesCount() Future<int>
Returns the number of features deleted since the last sync.
inherited
getFeatureTemplate({required String name}) FeatureTemplate?
Searches for the feature template with the given name.
inherited
getFeatureType({required String name}) FeatureType?
Searches for the feature type with the given name.
inherited
getField({required String fieldName}) Field?
Retrieves the field with the given name.
inherited
getLocalEdits() Future<LocalFeatureEditsResult>
Returns all the features that were added, updated or deleted since the last sync.
inherited
getLocalEditsCount() Future<int>
Returns the number of features that were added, updated or deleted since the last sync.
inherited
getRelatedTables() List<ArcGISFeatureTable>
Returns a list of all related tables that have been added to the map.
inherited
getRelatedTablesWithRelationshipInfo(RelationshipInfo relationshipInfo) List<ArcGISFeatureTable>
Returns list of tables related by the given relationship info.
inherited
getUpdatedFeatures() Future<FeatureQueryResult>
Returns the features updated since the last sync.
inherited
getUpdatedFeaturesCount() Future<int>
Returns the number of features updated since the last sync.
inherited
hasLocalEdits() bool
Checks whether the feature table has local edits.
inherited
load() Future<void>
Loads the metadata for the object asynchronously.
inherited
loadOrRefreshFeatures(List<Feature> features) Future<void>
Loads all attributes and geometries for features that have not been loaded and fetches attributes and geometries for previously loaded features.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
populateFromService({required QueryParameters parameters, required bool clearCache, required List<String> outFields}) Future<FeatureQueryResult>
Queries the feature service and places the resulting features in the local table, which is cached for the duration of the session. The ServiceFeatureTable must have its ServiceFeatureTable.featureRequestMode set to FeatureRequestMode.manualCache.
queryExtent(QueryParameters queryParameters) Future<Envelope>
Determines the minimum bounding envelope that contains features satisfying the provided query parameters.
inherited
queryFeatureCount(QueryParameters queryParameters) Future<int>
Determines the count of features that satisfy the provided query parameters.
inherited
queryFeatures(QueryParameters queryParameters) Future<FeatureQueryResult>
Submits a query against the table.
inherited
queryFeaturesWithFieldOptions({required QueryParameters parameters, required QueryFeatureFields queryFeatureFields}) Future<FeatureQueryResult>
Queries features from this table's cache and/or from the feature service used to create this table.
queryRelatedFeatureCount({required ArcGISFeature feature, RelatedQueryParameters? parameters}) Future<int>
Performs a query that returns the number of related features to supplied feature based on the parameters.
inherited
queryRelatedFeatures({required ArcGISFeature feature, RelatedQueryParameters? parameters}) Future<List<RelatedFeatureQueryResult>>
Queries for related features of a given feature in a specific relationship.
inherited
queryRelatedFeaturesWithFieldOptions({required ArcGISFeature feature, required RelatedQueryParameters parameters, required QueryFeatureFields queryFeatureFields}) Future<List<RelatedFeatureQueryResult>>
Queries for related features in this service feature table using the provided parameters and query feature fields. See ServiceFeatureTable.queryFeaturesWithFieldOptions for more details.
queryStatistics(StatisticsQueryParameters statisticsQueryParameters) Future<StatisticsQueryResult>
Calculates values for the requested statistics.
inherited
retryLoad() Future<void>
Loads or retries loading metadata for the object asynchronously.
inherited
toString() String
A string representation of this object.
inherited
undoLocalEdits() Future<void>
Undoes all of the local edits since the last server acknowledgment.
updateFeature(Feature feature) Future<void>
Updates a feature in the table.
inherited
updateFeatures(List<Feature> features) Future<void>
Updates a collection of features in the table.
inherited
validateRelationshipConstraints({required ArcGISFeature feature}) Future<RelationshipConstraintViolationType>
Validates constraints for a given feature participating in a relationship.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited