than_pkg 1.6.2 copy "than_pkg: ^1.6.2" to clipboard
than_pkg: ^1.6.2 copied to clipboard

android native plugin.it is my personal lib and you can use.this is my first lib.

Added #

<application>
<provider
    android:name="than.plugin.than_pkg.TContentProvider"
    android:authorities="${applicationId}.provider"
    android:exported="false"
    android:grantUriPermissions="true" />

</application>
  • for above android xml code
Future<void> openPdfWithIntent({required String path})
Future<void> openVideoWithIntent({required String path})
Future<void> installApk({required String path})

Android Thumbnail #

  • ThanPkg.android.thumbnail
Future<void> genVideoThumbnailList
Future<String?> genVideoThumbnail
Future<void> genPdfCoverList
Future<String> genPdfImage
Future<int> getPdfPageCount

Android Camera #

final filePath = await ThanPkg.android.camera.openCamera();

Android Permission (All Version) #

if (!await ThanPkg.android.permission.isStoragePermissionGranted()) {
    await ThanPkg.android.permission.requestStoragePermission();
    return;
}
if (!await ThanPkg.android.permission.isCameraPermission()) {
    await ThanPkg.android.permission.requestCameraPermission();
    return;
}
  • ThanPkg.android.permission
Future<void> checkCanRequestPackageInstallsPermission
Future<bool> isPackageInstallPermission()
Future<bool> isStoragePermissionGranted()
Future<bool> isCameraPermission()
Future<bool> isLocationPermission()
Future<void> requestStoragePermission()
Future<void> requestPackageInstallPermission()
Future<void> requestCameraPermission()
Future<void> requestLocationPermission()

needed lib from linux #

sudo apt install net-tools  // wifi
sudo apt install poppler-utils //pdf thumbnail
sudo apt install ffmpeg //video thumbnail

Android && linux #

//old method
await ThanPkg.windowManagerensureInitialized();
await ThanPkg.platform.toggleFullScreen(isFullScreen: true);
await ThanPkg.platform.getAppRootPath();
await ThanPkg.platform.getAppExternalPath();
await ThanPkg.platform.getWifiAddressList();
await ThanPkg.platform.genPdfCover(outDirPath: '', pdfPathList: []);
await ThanPkg.platform.genVideoCover(outDirPath: '', videoPathList: []);

Android Permission #

//android any version can handle
await ThanPkg.platform.isStoragePermissionGranted();
await ThanPkg.platform.requestStoragePermission();
await ThanPkg.platform.checkAndRequestPackageInstallPermission();

Android only #

//old method
await ThanPkg.platform.getAppFilePath();
await ThanPkg.platform.isAppSystemThemeDarkMode();
await ThanPkg.platform.isAppInternetConnected();
await ThanPkg.platform.getAppBatteryLevel();
await ThanPkg.platform.getLastKnownLocation();
await ThanPkg.platform.getInstalledApps();
await ThanPkg.platform.checkScreenOrientation();
await ThanPkg.platform.requestScreenOrientation(type: ScreenOrientationTypes.Portrait);
//android device info <Map> type
await ThanPkg.platform.getAndroidDeviceInfo()
await ThanPkg.platform.openUrl(url: '');
await ThanPkg.platform.getPlatformVersion();
await ThanPkg.platform.getDeviceId();
await ThanPkg.platform.toggleKeepScreen(isKeep: false);
await ThanPkg.platform.toggleFullScreen(isFullScreen: !isFullScreen);
await ThanPkg.platform.getLocalIpAddress();
await ThanPkg.platform.getWifiAddress();

android AndroidManifest #

<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

1
likes
0
points
1.25k
downloads

Publisher

unverified uploader

Weekly Downloads

android native plugin.it is my personal lib and you can use.this is my first lib.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, package_info_plus, plugin_platform_interface, window_manager

More

Packages that depend on than_pkg

Packages that implement than_pkg