Skip to content

Instantly share code, notes, and snippets.

View Alby-o's full-sized avatar

Alexander Blyth Alby-o

  • Brisbane, Australia
View GitHub Profile
View image_converter.dart
// imgLib -> Image package from
import 'package:image/image.dart' as imglib;
import 'package:camera/camera.dart';
Future<List<int>> convertImagetoPng(CameraImage image) async {
try {
imglib.Image img;
if ( == ImageFormatGroup.yuv420) {
img = _convertYUV420(image);
} else if ( == ImageFormatGroup.bgra8888) {
Alby-o / main.dart
Created March 7, 2019 06:38
Heroes Failed assertion: line 248 pos 12: 'box != null && box.hasSize': is not true.
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
Alby-o / main.dart
Last active February 8, 2019 04:08
Attempt to invoke virtual method 'int android.hardware.camera2.CameraCaptureSession.capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession$CaptureCallback, android.os.Handler)' on a null object reference
View main.dart
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:camera/camera.dart';
import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart';
void main() {