box_in_camera 0.0.1 copy "box_in_camera: ^0.0.1" to clipboard
box_in_camera: ^0.0.1 copied to clipboard

discontinued
outdated

A new flutter plugin project.

example/lib/main.dart

import 'dart:async';

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

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await BoxInCamera.initialize();
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(debugShowCheckedModeBanner: false, home: MyHomePage());
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Box in Camera Example"),
        backgroundColor: Colors.grey.shade800,
      ),
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            ElevatedButton(
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => BoxInCamera(),
                  ),
                ).then((value) {
                  if (value != null) {
                    Timer(Duration(milliseconds: 30), () {
                      showDialog(
                        context: context,
                        builder: (context) => AlertDialog(
                          titlePadding:
                              EdgeInsets.fromLTRB(12.0, 12.0, 12.0, 0),
                          contentPadding: EdgeInsets.all(12.0),
                          title: Text("Croped Image"),
                          content: SizedBox(
                            width: 280.0,
                            height: 280.0,
                            child: Image.memory(value),
                          ),
                        ),
                      );
                    });
                  }
                });
              },
              style: ButtonStyle(
                backgroundColor: MaterialStateProperty.all<Color>(
                  Colors.grey.shade800,
                ),
              ),
              child: Text("Start Camera"),
            )
          ],
        ),
      ),
    );
  }
}
2
likes
0
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

A new flutter plugin project.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

camera, flutter, image

More

Packages that depend on box_in_camera

Packages that implement box_in_camera