flutter_camera_widget 1.0.0 copy "flutter_camera_widget: ^1.0.0" to clipboard
flutter_camera_widget: ^1.0.0 copied to clipboard

discontinuedreplaced by: camera
retracted

A customizable Flutter package that displays a basic camera UI, with video and photo preview.

example/example.dart

import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:flutter_camera_widget/flutter_camera_widget.dart';

List<CameraDescription> cameras = [];

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  cameras = await availableCameras();

  runApp(const MySuperCoolApp());
}


class MySuperCoolApp extends StatelessWidget {
  const MySuperCoolApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Camera Widget Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: SafeArea(
        child: Scaffold(
          body: Camera(
            cameras: cameras,
            flash: true,
            video: true,
            focus: true,
            zoom: true,
            qrcode: true,
            resolution: ResolutionPreset.high,
            capturedMediaScreen: MyCustomMediaPreview(),
            showCapturedMedias: true,
            saveToGalleryOnCapture: false,
            backgroundColor: Colors.black,
            primaryColor: Colors.blue,
            accentColor: Colors.purpleAccent,
          ),
        ),
      ),
    );
  }
}

class MyCustomMediaPreview extends State<CapturedMediaScreen>{

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.black,
      body: Center(
        child: ListView.separated(
            scrollDirection: Axis.horizontal,
            itemCount: widget.medias.length,
            separatorBuilder: (BuildContext context, int index) {
              return const SizedBox(width: 20);
            },
            itemBuilder: (BuildContext context, int index) {
              return MediaPreview(widget.medias[index], () => {
                widget.handleRemoveMedia(widget.medias[index]),
                setState(() {
                  
                }),
                if(widget.medias.isEmpty) Navigator.pop(context),
              });
            },
            physics: const BouncingScrollPhysics(),
        ),
      ),
    );
  }
}
0
likes
0
points
151
downloads

Publisher

unverified uploader

Weekly Downloads

A customizable Flutter package that displays a basic camera UI, with video and photo preview.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

camera, flutter, gallery_saver_updated, path, path_provider, syncfusion_flutter_sliders, video_player, video_thumbnail

More

Packages that depend on flutter_camera_widget