hl_image_picker_ios 1.0.2 copy "hl_image_picker_ios: ^1.0.2" to clipboard
hl_image_picker_ios: ^1.0.2 copied to clipboard

iOS implementation of the hl_image_picker plugin.

example/lib/main.dart

import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:hl_image_picker_ios/hl_image_picker_ios.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(
          children: [
            ElevatedButton(
                onPressed: () async {
                  final picker = await HLImagePickerIOS().openPicker(
                    mediaType: MediaType.image,
                    cropping: true,
                    style: HLPickerStyle(
                        maxFileSizeErrorText: "File too big",
                        tapHereToChangeText: "Tap tap",
                        cropCancelText: "Back",
                        cropDoneText: "Finish"),
                  );
                  print(jsonEncode(picker));
                },
                child: const Text('Open Picker')),
            ElevatedButton(
                onPressed: () async {
                  try {
                    final picker = await HLImagePickerIOS().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')),
          ],
        ),
      ),
    );
  }
}
2
likes
0
pub points
46%
popularity

Publisher

unverified uploader

iOS implementation of the hl_image_picker plugin.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, hl_image_picker_platform_interface

More

Packages that depend on hl_image_picker_ios