camera_with_files 0.0.13 copy "camera_with_files: ^0.0.13" to clipboard
camera_with_files: ^0.0.13 copied to clipboard

Make a Camera Module With Gallery View. Its Looks Like whatsapp Camera Module.

example/lib/main.dart

import 'dart:io';
import 'package:camera_with_files/camera_with_files.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MaterialApp(home: MyApp()));
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  List<File> files = [];
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: SingleChildScrollView(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              if (files.isNotEmpty)
                ...files.map<Image>((ele) {
                  if (kIsWeb) {
                    return Image.network(ele.path);
                  }
                  return Image.file(ele);
                }).toList(),
              TextButton(
                onPressed: () async {
                  var data = await Navigator.of(context).push(
                    MaterialPageRoute<List<File>>(
                      builder: (BuildContext context) => const CameraApp(
                          isMultiple: true,
                          isSimpleUI: true,
                          compressedSize: 100000),
                    ),
                  );
                  if (data != null) {
                    setState(() {
                      files = data;
                    });
                  }
                },
                child: const Text("Click"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
22
likes
110
points
106
downloads

Publisher

unverified uploader

Weekly Downloads

Make a Camera Module With Gallery View. Its Looks Like whatsapp Camera Module.

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

camera, flutter, flutter_image_compress, flutter_sliding_up_panel, image_gallery_saver, image_picker, intl, path_provider, permission_handler, photo_gallery

More

Packages that depend on camera_with_files