contactos_platform_interface

pub package License: BSD-3-Clause style: very_good_analysis

A common platform interface for the contactos plugin.

This interface allows platform-specific implementations of the contactos plugin, as well as the plugin itself, to ensure they are supporting the same interface.

Architecture

The contactos plugin uses the federated plugin architecture.

  • contactos: The app-facing package that developers depend on.
  • contactos_platform_interface: This package. It declares the interface that platform packages must implement.
  • contactos_android, contactos_foundation: Platform-specific implementations.

Usage

To implement a new platform-specific implementation of contactos, extend ContactosPlatform with implementations that perform the platform-specific behaviors.

Example

class ContactosWindows extends ContactosPlatform {
  static void registerWith() {
    ContactosPlatform.instance = ContactosWindows();
  }

  @override
  Future<List<Contact>> getContacts({String? query, ...}) {
    // Implementation for Windows
  }

  // ... implement other methods
}