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

A Flutter package that allows you to open the camera and capture images with a timer logic. Perfect for those moments when you need a delay before the shot!

example/lib/main.dart

import 'dart:io';

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

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  runApp(const App());
}

class App extends StatelessWidget {
  const App({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: _Home(),
    );
  }
}

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

  @override
  State<_Home> createState() => _HomeState();
}

class _HomeState extends State<_Home> {
  XFile? currentImage;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Timer Camera'),
        centerTitle: true,
      ),
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            ElevatedButton(
              onPressed: () {
                showTimerCamera(
                  context: context,
                  onSubmit: (capturedImage) {
                    setState(() {
                      currentImage = capturedImage;
                    });
                  },
                );
              },
              child: const Text('Open Camera'),
            ),
            currentImage == null
                ? const SizedBox.shrink()
                : SizedBox(
                    width: 300,
                    height: 300,
                    child: Image.file(File(currentImage!.path)),
                  ),
          ],
        ),
      ),
    );
  }
}
1
likes
0
pub points
42%
popularity

Publisher

unverified uploader

A Flutter package that allows you to open the camera and capture images with a timer logic. Perfect for those moments when you need a delay before the shot!

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

camera, camera_platform_interface, custom_sliding_segmented_control, flutter, flutter_riverpod, freezed_annotation

More

Packages that depend on flutter_timer_camera