drishya_picker 1.0.0+1
drishya_picker: ^1.0.0+1 copied to clipboard

Messenger like image, video picker with two different option. 1. Using Controller 2. Using MediaPicker widget

drishya_picker #

Messanger like media picker

Using controller

/// Media picker demo using controller
class PickerDemo extends StatelessWidget {
    final controller = DrishyaPickerController();

    // Call this method to pick data
    Future<void> _pickData({DrishyaSetting? setting}) async {
        final data = await controller.pickMedia(setting: setting);
    }

    @override
    Widget build(BuildContext context) {
        return Scaffold(
            appBar: AppBar(
                title: const Text('Pick using controller'),
            ),
            body: DrishyaPicker(
                controller: controller,
                child: ...
            ),
        );
    }
}

Using picker

class PickerDemo extends StatefulWidget {
    @override
    _PickerDemoState createState() => _PickerDemoState();
}

/// Media picker demo using controller
class _PickerDemoState extends State<PickerDemo> {
    final controller = DrishyaPickerController();

    // Call this method to pick data
    Future<void> _pickData({DrishyaSetting? setting}) async {
        final data = await controller.pickMedia(setting: setting);
    }

    @override
    Widget build(BuildContext context) {
        return DrishyaPicker(
            requestType: RequestType.common,
            topMargin: MediaQuery.of(context).padding.top,
            child: Scaffold(
                body: Center(
                    child: MediaPicker(
                        setting: DrishyaSetting(
                            selected: list,
                            maximum: 5,
                            albumSubtitle: 'common',
                        ),
                        onChanged: (entity, isRemoved) {
                            //
                        },
                        onSubmitted: (list) {
                            //
                        },
                        child: child,
                    ),
                ),
            ),
        );
    }
}
4
likes
120
pub points
31%
popularity

Messenger like image, video picker with two different option. 1. Using Controller 2. Using MediaPicker widget

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

koiralapankaj007@gmail.com

License

Apache 2.0 (LICENSE)

Dependencies

bloc, flutter, flutter_bloc, photo_manager

More

Packages that depend on drishya_picker