ShareService class

App-facing share facade with empty-payload validation.

final share = ShareService();
await share.shareText('Look at this!', subject: 'Check it out');
await share.shareFiles(['/tmp/report.pdf'], text: 'Monthly report');

Constructors

ShareService({SharePort? port})

Properties

hashCode → int
The hash code for this object.
no setterinherited
port → SharePort
The platform adapter (or the in-memory default in tests).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
share({String? text, String? subject, List<String>? files}) → Future<void>
Shares an arbitrary combination; throws ShareException.nothingToShare when both text and files are empty (a caller bug, surfaced early).
shareFiles(List<String> files, {String? text, String? subject}) → Future<void>
Shares files (optionally with text/subject).
shareText(String text, {String? subject}) → Future<void>
Shares text (optionally with a subject).
toString() → String
A string representation of this object.
inherited

Operators

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