-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from natsuk4ze/plugin_platform_interface
Add Plugin platform interface
- Loading branch information
Showing
3 changed files
with
68 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 22 additions & 14 deletions
36
lib/src/gal_platform.dart → lib/src/gal_method_channel.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'dart:typed_data'; | ||
|
||
import 'gal_method_channel.dart'; | ||
|
||
/// Plugin Platform Interface | ||
base class GalPlatform { | ||
const GalPlatform(); | ||
static GalPlatform instance = MethodChannelGal(); | ||
|
||
/// throw [UnimplementedError] when Plugin [MethodChannelGal] did not | ||
/// define [putVideo]. | ||
Future<void> putVideo(String path, {String? album}) => | ||
throw UnimplementedError('putVideo() has not been implemented.'); | ||
|
||
/// throw [UnimplementedError] when Plugin [MethodChannelGal] did not | ||
/// define [putImage]. | ||
Future<void> putImage(String path, {String? album}) => | ||
throw UnimplementedError('putImage() has not been implemented.'); | ||
|
||
/// throw [UnimplementedError] when Plugin [MethodChannelGal] did not | ||
/// define [putImageBytes]. | ||
Future<void> putImageBytes(Uint8List bytes, {String? album}) => | ||
throw UnimplementedError('putImageBytes() has not been implemented.'); | ||
|
||
/// throw [UnimplementedError] when Plugin [MethodChannelGal] did not | ||
/// define [open]. | ||
Future<void> open() => | ||
throw UnimplementedError('open() has not been implemented.'); | ||
|
||
/// throw [UnimplementedError] when Plugin [MethodChannelGal] did not | ||
/// define [hasAccess]. | ||
Future<bool> hasAccess({bool toAlbum = false}) => | ||
throw UnimplementedError('hasAccess() has not been implemented.'); | ||
|
||
/// throw [UnimplementedError] when Plugin [MethodChannelGal] did not | ||
/// define [requestAccess]. | ||
Future<bool> requestAccess({bool toAlbum = false}) => | ||
throw UnimplementedError('requestAccess() has not been implemented.'); | ||
} |