Usage

Welcome to Pickers, to use this plugin, add pickers as a dependency in your pubspec.yaml file. Or you can install it from github by adding the following to your pubspec.yaml file:

dependencies:
    pickers:
        git:
            url: https://github.com/ashtav/pickers.git
            ref: master

Example

GestureDetector(
    onTap: () async {
        DateTime? dateTime = await Pickers.datePicker(context);
    },
)

GestureDetector(
    onTap: () async {
        DateTime? dateTime = await Pickers.timePicker(context);
        String time = Mixins.dateFormat(dateTime, format: 'HH:mm') // 10:30
    },
)

GestureDetector(
    onTap: () async {
        List<Media>? images = await Pickers.imagePicker(context, maxImages: 5);
    },
),

iOS

Add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist:

<key>NSCameraUsageDescription</key>
<string>your usage description here</string>
<key>NSMicrophoneUsageDescription</key>
<string>your usage description here</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Example usage description</string>

Android

Add the following permissions to your AndroidManifest.xml, located in <project root>/android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.

minSdkVersion 21

GitHub

View Github