mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
refactor(mobile): shared_handler.interface.dart (#19333)
refactor(mobile): shared_handler.repository.dart
This commit is contained in:
parent
5c74f634b7
commit
1f2c779b36
@ -1,7 +0,0 @@
|
|||||||
import 'package:immich_mobile/models/upload/share_intent_attachment.model.dart';
|
|
||||||
|
|
||||||
abstract interface class IShareHandlerRepository {
|
|
||||||
void Function(List<ShareIntentAttachment>)? onSharedMedia;
|
|
||||||
|
|
||||||
Future<void> init();
|
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:immich_mobile/interfaces/share_handler.interface.dart';
|
|
||||||
import 'package:immich_mobile/models/upload/share_intent_attachment.model.dart';
|
import 'package:immich_mobile/models/upload/share_intent_attachment.model.dart';
|
||||||
import 'package:share_handler/share_handler.dart';
|
import 'package:share_handler/share_handler.dart';
|
||||||
|
|
||||||
@ -9,13 +8,11 @@ final shareHandlerRepositoryProvider = Provider(
|
|||||||
(ref) => ShareHandlerRepository(),
|
(ref) => ShareHandlerRepository(),
|
||||||
);
|
);
|
||||||
|
|
||||||
class ShareHandlerRepository implements IShareHandlerRepository {
|
class ShareHandlerRepository {
|
||||||
ShareHandlerRepository();
|
ShareHandlerRepository();
|
||||||
|
|
||||||
@override
|
|
||||||
void Function(List<ShareIntentAttachment> attachments)? onSharedMedia;
|
void Function(List<ShareIntentAttachment> attachments)? onSharedMedia;
|
||||||
|
|
||||||
@override
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
final handler = ShareHandlerPlatform.instance;
|
final handler = ShareHandlerPlatform.instance;
|
||||||
final media = await handler.getInitialSharedMedia();
|
final media = await handler.getInitialSharedMedia();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user