Skip to content

Instantly share code, notes, and snippets.

View main.dart
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void _enablePlatformOverrideForDesktop() {
if (!kIsWeb && (Platform.isWindows || Platform.isLinux)) {
debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;
}
}
View main.dart
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void _enablePlatformOverrideForDesktop() {
if (!kIsWeb && (Platform.isWindows || Platform.isLinux)) {
debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;
}
}
@Hixie
Hixie / dashboard.pl
Created Feb 5, 2020
Script to track a GQ Geiger Counter and report how long until a radioactive cat is safe to release
View dashboard.pl
#!/usr/bin/perl -wT
use strict;
use Device::SerialPort;
if ($< != 0) {
print("Must be run as root.\n");
exit(1);
}
my $port = Device::SerialPort->new("/dev/ttyUSB0");
View gist:12a573fae98de8c5a191d5307006136c
STARTING TEST
Spawning flutter [run, --machine, -d, flutter-tester, --start-paused] in /tmp/flutter_expression_test.ITINEI
Expecting daemon.connected event...
<=stdout= [{"event":"daemon.connected","params":{"version":"0.4.2","pid":258867}}]
OK (daemon.connected event)
Expecting app.started event...
Expecting app.debugPort event...
<=stdout= [{"event":"app.start","params":{"appId":"255f4a36-3bb0-4314-a5a7-0c21bad6fd7e","deviceId":"flutter-tester","directory":"/tmp/flutter_expression_test.ITINEI","supportsRestart":true}}]
<=stdout= Launching lib/main.dart on Flutter test device in debug mode...
<=stdout= [{"event":"app.debugPort","params":{"appId":"255f4a36-3bb0-4314-a5a7-0c21bad6fd7e","port":42159,"wsUri":"ws://127.0.0.1:42159/ws","baseUri":"file:///tmp/flutter_expression_test.ITINEIQJXLRQ/flutter_expression_test.ITINEI/"}}]
View main.dart
import 'dart:async';
import 'package:flutter/material.dart';
final Identifier time = new Identifier();
final Identifier counter = new Identifier();
void main() {
Model model = new Model();
runApp(new ModelProvider(
View constbench.dart
import 'package:flutter/material.dart';
void main() {
runApp(
new MaterialApp(
title: "Flutter Demo",
routes: <String, RouteBuilder>{
'/': (RouteArguments args) {
return new Scaffold(
toolBar: new ToolBar(