WooSettings class

WooCommerce Settings Group Model

Represents a settings group in WooCommerce. Settings groups are top-level categories that organize related settings together, such as 'general', 'products', 'shipping', or 'payments'. Each group contains multiple setting options that can be configured independently.

Key Features

  • Hierarchical organization: Support for parent-child relationships
  • Sub-groups: Nested organization for complex settings structures
  • Human-readable labels: User-friendly names for display
  • Descriptive information: Help text for understanding group purpose

Common Settings Groups

  • general: Store name, currency, location, and basic settings
  • products: Product catalog, inventory, and display settings
  • shipping: Shipping zones, methods, and rate calculations
  • payments: Payment gateway configurations and options
  • tax: Tax calculation and display settings

Usage Examples

// Create a settings group
final group = WooSettings(
  id: 'custom_settings',
  label: 'Custom Settings',
  description: 'Custom store configuration options',
);

// Access group properties
print('Group: ${group.label}');
print('Description: ${group.description}');
print('Has sub-groups: ${group.subGroups?.isNotEmpty ?? false}');

Constructors

WooSettings({String? id, String? label, String? description, String? parentId, List<String>? subGroups})
Creates a new WooSettings instance
WooSettings.fake()
Creates a fake WooSettings instance for testing purposes
factory
WooSettings.fromJson(Map<String, dynamic> json)
Creates a WooSettings instance from JSON data

Properties

description String?
A human readable description for the setting used in interfaces.
final
hashCode int
The hash code for this object.
no setterinherited
id String?
A unique identifier that can be used to link settings together.
final
label String?
A human readable label for the setting used in interfaces.
final
parentId String?
ID of parent grouping.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subGroups List<String>?
IDs for settings sub groups.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the WooSettings instance to JSON format
toString() String
A string representation of this object.
inherited

Operators

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