hl_image_picker 1.1.1 copy "hl_image_picker: ^1.1.1" to clipboard
hl_image_picker: ^1.1.1 copied to clipboard

A Flutter plugin for iOS and Android for picking images, videos from the image library.

example/lib/main.dart

import 'dart:convert';

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            ElevatedButton(
                onPressed: () async {
                  final picker = await HLImagePicker().openPicker(
                    mediaType: MediaType.image,
                    cropping: true,
                    style: HLPickerStyle(
                      maxFileSizeErrorText: "File too big",
                      tapHereToChangeText: "Tap tap",
                      cropCancelText: "Back",
                      cropDoneText: "Finish",
                      cropTitleText: "Crop image",
                    ),
                  );
                  print(jsonEncode(picker));
                },
                child: const Text('Open Picker')),
            ElevatedButton(
                onPressed: () async {
                  try {
                    final picker = await HLImagePicker().openCamera(
                      cameraType: CameraType.image,
                      cropping: true,
                      style: HLPickerStyle(
                        maxFileSizeErrorText: "File too big",
                        tapHereToChangeText: "Tap tap",
                        cropCancelText: "Back",
                        cropDoneText: "Finish",
                        cropTitleText: "Crop image",
                      ),
                    );
                    print(jsonEncode(picker));
                  } catch (e) {
                    print(e.toString());
                  }
                },
                child: const Text('Open Camera')),
          ],
        ),
      ),
    );
  }
}
51
likes
0
pub points
92%
popularity

Publisher

unverified uploader

A Flutter plugin for iOS and Android for picking images, videos from the image library.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, hl_image_picker_android, hl_image_picker_ios, hl_image_picker_platform_interface

More

Packages that depend on hl_image_picker