diff --git a/example/integration_test/integration_test.dart b/example/integration_test/integration_test.dart index 43e10663..ee552331 100644 --- a/example/integration_test/integration_test.dart +++ b/example/integration_test/integration_test.dart @@ -5,10 +5,13 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:gal/gal.dart'; +/// Integration_test is required to test native code, +/// but it is not necessary to build the widget. Future main() async { - for (var i = 0; i < 2; i++) { - final toAlbum = i == 0 ? false : true; - final album = toAlbum ? 'Album' : null; + for (var i = 0; i < TestCase.values.length; i++) { + final testCase = TestCase.values[i]; + final toAlbum = testCase.toAlbum; + final album = testCase.album; await run('hasAccess(toAlbum: $toAlbum)', () async => Gal.hasAccess(toAlbum: toAlbum)); @@ -68,3 +71,18 @@ Future getBytesData(String path) async { .asUint8List(byteData.offsetInBytes, byteData.lengthInBytes); return Uint8List.fromList(uint8List); } + +enum TestCase { + saveToAlbum, + notSaveToAlbum; + + bool get toAlbum => switch (this) { + saveToAlbum => true, + notSaveToAlbum => false, + }; + + String? get album => switch (this) { + saveToAlbum => 'toAlbum', + notSaveToAlbum => null, + }; +} diff --git a/lib/src/gal_platform_interface.dart b/lib/src/gal_platform_interface.dart index 462a2738..864b4e26 100644 --- a/lib/src/gal_platform_interface.dart +++ b/lib/src/gal_platform_interface.dart @@ -2,7 +2,8 @@ import 'dart:typed_data'; import 'gal_method_channel.dart'; -/// Plugin Platform Interface +/// Plugin Platform Interface to to allow Non-endorsed federated plugin +/// See: [PR](https://github.com/natsuk4ze/gal/pull/180) base class GalPlatform { const GalPlatform(); static GalPlatform instance = MethodChannelGal();