attriax_flutter_platform_interface 0.4.0
attriax_flutter_platform_interface: ^0.4.0 copied to clipboard
A common platform interface for the Attriax plugin.
attriax_flutter_platform_interface #
A common platform interface for the Attriax plugin.
This package is not intended to be added directly to most apps. End users
should depend on attriax_flutter.
Overview #
This package defines the abstract platform interface plus the shared public
types used by the Flutter SDK runtime and the federated platform packages. It
should be extended by platform-specific packages like
attriax_flutter_android and attriax_flutter_ios.
This package appears on pub.dev because federated Flutter plugins need a shared
contract package, but regular applications should still depend on
attriax_flutter instead of importing attriax_flutter_platform_interface
directly.
Requirements #
- Dart
^3.8.0 - Flutter
>=3.29.0
These constraints match the current federated plugin workspace and keep the
shared public types aligned with the main attriax_flutter package.
Architecture #
- Provides: platform-agnostic interface definitions plus the shared public Flutter SDK type library
- Exports:
attriax_platform_interface.dartfor native hooks andattriax_platform_types.dartfor the stable shared type surface, plusattriax_runtime_types.dartfor the broader runtime-only model set used byattriax_flutter - Also exports the shared
MethodChannelAttriaxbase used by federated packages whose Dart behavior matches the common method-channel flow. - Used by:
attriax_flutterplus the federated implementation packages - Federated implementations:
attriax_flutter_android,attriax_flutter_ios,attriax_flutter_windows
New platform-facing code should import attriax_platform_interface.dart.
Model-only consumers should import attriax_platform_types.dart.
Main-package runtime code that still needs internal-only shared models should
import attriax_runtime_types.dart instead of the compatibility umbrella.
Development #
This package uses plugin_platform_interface to define the shared contract and
the public types used by the federated implementations. The shared type library
is now split across smaller src/types_*.dart part files so large runtime
model edits do not have to flow through one monolithic source file. When adding
new platform methods:
- Add method definition to the interface
- Implement in each platform package
- Prefer extending
MethodChannelAttriaxwhen the shared channel/error handling already matches the platform's needs - Update the example app to demonstrate usage
Run the package-level regression tests before release:
cd sdk-flutter/attriax_flutter_platform_interface
flutter test
Contributing #
See the parent README.md for contribution guidelines.