color_picker_camera 1.0.0 icon indicating copy to clipboard operation
color_picker_camera: ^1.0.0 copied to clipboard

As the name suggests "Color Picker Camera" lets its users to obtain the RGB(hex) color code of any object.It opens the back camera and shows color code of the object that comes in focus within the cen [...]

example/lib/main.dart

import 'dart:io';

import 'package:flutter/material.dart';

import 'package:color_picker_camera/color_picker_camera.dart';
import 'package:permission_handler/permission_handler.dart';

void main() {
  runApp(MaterialApp(debugShowCheckedModeBanner: false, home: MyApp()));
}

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  Color bgColor;
  String selectedColor = "";
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: bgColor,
        appBar: AppBar(
          centerTitle: true,
          title: Text("Color Picker Camera"),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text("Hello fellows :)"),
              SizedBox(
                height: 10,
              ),
              Text(selectedColor),
              SizedBox(
                height: 10,
              ),
              RaisedButton(
                color: Colors.red,
                onPressed: () async {
                  String colorCode =
                      await ColorPickerCamera.captureColorFromCamera;
                  setState(() {
                    selectedColor = colorCode;
                    bgColor = Color(int.parse(colorCode));
                  });
                },
                child: Text("Go To Camera"),
              )
            ],
          ),
        ));
  }
}
4
likes
80
pub points
51%
popularity

Publisher

verified publisher iconnytrotech.com

As the name suggests "Color Picker Camera" lets its users to obtain the RGB(hex) color code of any object.It opens the back camera and shows color code of the object that comes in focus within the centered target.You can utilize RGB(hex) color code of object according to your need.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter, permission_handler

More

Packages that depend on color_picker_camera