story_camera 0.1.0 copy "story_camera: ^0.1.0" to clipboard
story_camera: ^0.1.0 copied to clipboard

outdated

A flutter package that show a customize camera (front and back) to take photos or record videos, similarly for create story in social media.

example/main.dart

import 'dart:io';

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

void main() => runApp(MyApp());

// ignore: must_be_immutable
class MyApp extends StatelessWidget {
  File? file;

  MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return StoryCamera(
      onImageCaptured: (value) {
        file = File(value.path);

        print(file);

        Navigator.push(context,
            MaterialPageRoute(builder: (_) => FileContent(file: file!)));
      },
      onVideoRecorded: (value) {
        file = File(value.path);

        print(file);

        // Use your favorite video player to display it.
      },
      // onClosePressed: () => Navigator.pop(context),
    );
  }
}

// Example to show image taken by camera.
class FileContent extends StatelessWidget {
  final File file;

  const FileContent({super.key, required this.file});

  @override
  Widget build(BuildContext context) {
    return SizedBox(
        height: double.infinity,
        width: double.infinity,
        child: Image.file(file));
  }
}
2
likes
150
points
9
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter package that show a customize camera (front and back) to take photos or record videos, similarly for create story in social media.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

camera, flutter

More

Packages that depend on story_camera