Webify class

Central controller for all webify SEO operations.

Initialize once at app startup, then use throughout your app:

void main() {
  Webify.initialize(
    config: WebifyConfig(
      baseUrl: 'https://myapp.com',
      defaultTitle: 'My App',
      titleTemplate: '%s | My App',
    ),
  );
  runApp(MyApp());
}

Then use declarative widgets like SeoHead and SeoPage, or call methods directly:

Webify.instance.updateMeta(title: 'About', description: '...');

Properties

config → WebifyConfig
Get the current configuration
no setter
currentMeta → Map<String, String>
Get all currently set meta tags
no setter
currentTitle → String?
Get the current page title
no setter
hashCode → int
The hash code for this object.
no setterinherited
platform → WebifyPlatform
Get the underlying platform implementation (for advanced use)
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

injectJsonLd(String jsonLd, {String? id}) → void
Inject JSON-LD structured data.
injectNoscriptFallback({required String title, String? description, String? bodyHtml, List<NoscriptLink>? links}) → void
Inject
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeJsonLd({String? id, String? type}) → void
Remove JSON-LD structured data by id or @type.
toString() → String
A string representation of this object.
inherited
trackEvent({required String name, Map<String, dynamic>? parameters}) → void
Track a custom event across all configured analytics providers.
trackPageView({required String path, String? title, Map<String, dynamic>? parameters}) → void
Track a page view across all configured analytics providers.
updateMeta({String? title, String? description, String? keywords, String? canonicalUrl, String? author, String? ogTitle, String? ogDescription, String? ogImage, String? ogImageWidth, String? ogImageHeight, String? ogType, String? ogUrl, String? ogSiteName, String? twitterCard, String? twitterTitle, String? twitterDescription, String? twitterImage, String? twitterSite, String? twitterCreator, String? robots, Map<String, String>? customMeta, Map<String, String>? customPropertyMeta}) → void
Update page meta tags.

Operators

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

Static Properties

instance → Webify
Get the singleton instance. Throws if initialize hasn't been called.
no setter
isInitialized → bool
Whether webify has been initialized
no setter

Static Methods

initialize({required WebifyConfig config}) → void
Initialize webify with the given configuration.
reset() → void
Reset the instance (useful for testing)