Skip to content

Instantly share code, notes, and snippets.

View Hexer10's full-sized avatar
🏠
Working from home

Mattia Hexer10

🏠
Working from home
View GitHub Profile
@Hexer10
Hexer10 / main.dart
Last active February 20, 2024 18:31
Flutter Web Camera
import 'dart:html';
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
Future<void> main() async {
runApp(CameraApp());
}
class CameraApp extends StatefulWidget {
String prettyHex(List<int> bytes, int length) {
final buffer = StringBuffer();
for (var i = 0; i < bytes.length; i += length) {
final list = bytes.sublist(i, min(i + length, bytes.length));
final l1 = list.map((e) => e.toRadixString(16).padLeft(2, '0')).toList();
final l2 = list.map((e) {
if (e > 0 && e < 128) {
return ascii.decode([e]);
}
return '.';
import 'package:benchmark_harness/benchmark_harness.dart';
final list = List.generate(100000, (index) => index);
class CollectionForBenchmark extends BenchmarkBase {
const CollectionForBenchmark() : super('CollectionFor');
static void main() {
CollectionForBenchmark().report();
}