pit_gallery_count 0.1.1 copy "pit_gallery_count: ^0.1.1" to clipboard
pit_gallery_count: ^0.1.1 copied to clipboard

outdated

Plugin for count image in gallery, this plugin depends on other plugins, you must have a permission to use this plugin, you can use `pit_permission` plugin

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:pit_gallery_count/pit_gallery_count.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  int _galleryCount = 0;
  List<GalleryResultModel> res;

  @override
  void initState() {
    super.initState();
    getTotalImage();
  }

  Future<void> getTotalImage() async {
    int galleryCount;
    try {
      galleryCount = await PitGalleryCount.getGalleryCount();
      res = await PitGalleryCount.getImageList(imageSortBy: SortColumn.imageName, sortTypeBy: SortType.asc);
      print("${res.runtimeType} ${res}");
    } on PlatformException {
      galleryCount = -1;
    }

    if (!mounted) return;

    setState(() {
      _galleryCount = galleryCount;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: const Text('Plugin example app'),
          ),
          body: Text("Total Image on device :${_galleryCount}\n\n ${res}")),
    );
  }
}
1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Plugin for count image in gallery, this plugin depends on other plugins, you must have a permission to use this plugin, you can use `pit_permission` plugin

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on pit_gallery_count