feat: Add an API for creating direct share shortcuts
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
library moxplatform_platform_interface;
|
||||
|
||||
export 'src/contacts.dart';
|
||||
export 'src/contacts_stub.dart';
|
||||
export 'src/crypto.dart';
|
||||
export 'src/crypto_stub.dart';
|
||||
export 'src/interface.dart';
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// The type of icon to use when no avatar path is provided.
|
||||
enum FallbackIconType {
|
||||
none(-1),
|
||||
person(0),
|
||||
notes(1);
|
||||
|
||||
const FallbackIconType(this.id);
|
||||
|
||||
// The ID of the fallback icon.
|
||||
final int id;
|
||||
}
|
||||
|
||||
// Wrapper around various contact APIs.
|
||||
// ignore: one_member_abstracts
|
||||
abstract class ContactsImplementation {
|
||||
Future<void> recordSentMessage(
|
||||
String name,
|
||||
String jid, {
|
||||
String? avatarPath,
|
||||
FallbackIconType fallbackIcon = FallbackIconType.none,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import 'package:moxplatform_platform_interface/src/contacts.dart';
|
||||
|
||||
class StubContactsImplementation extends ContactsImplementation {
|
||||
@override
|
||||
Future<void> recordSentMessage(
|
||||
String name,
|
||||
String jid, {
|
||||
String? avatarPath,
|
||||
FallbackIconType fallbackIcon = FallbackIconType.none,
|
||||
}) async {}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:moxplatform_platform_interface/src/contacts.dart';
|
||||
import 'package:moxplatform_platform_interface/src/contacts_stub.dart';
|
||||
import 'package:moxplatform_platform_interface/src/crypto.dart';
|
||||
import 'package:moxplatform_platform_interface/src/crypto_stub.dart';
|
||||
import 'package:moxplatform_platform_interface/src/isolate.dart';
|
||||
@@ -14,6 +16,7 @@ abstract class MoxplatformInterface extends PlatformInterface {
|
||||
static IsolateHandler handler = StubIsolateHandler();
|
||||
static MediaScannerImplementation media = StubMediaScannerImplementation();
|
||||
static CryptographyImplementation crypto = StubCryptographyImplementation();
|
||||
static ContactsImplementation contacts = StubContactsImplementation();
|
||||
|
||||
/// Return the current platform name.
|
||||
Future<String?> getPlatformName();
|
||||
|
||||
Reference in New Issue
Block a user