Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonah Williams jonahwilliams

View GitHub Profile
@jonahwilliams
jonahwilliams / main.dart
Created Aug 9, 2021
constantly repainting RO
View main.dart
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_svg/svg.dart';
void main() {
runApp(const MaterialApp(home: Scaffold(body: Example())));
}
class Example extends StatefulWidget {
View main.dart
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
void main() {
runApp(MaterialApp(home: Example()));
}
class Example extends StatefulWidget {
const Example({Key? key}) : super(key: key);
@jonahwilliams
jonahwilliams / main.dart
Created Jun 9, 2021
not even at swapchain
View main.dart
// @dart = 2.8
import 'package:glfw/glfw.dart';
import 'package:vulkan/vulkan.dart';
import 'dart:ffi';
import 'package:ffi/ffi.dart';
void main() {
// Init dart specific FFI libraries.
initGlfw();
View main.dart
/ Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/widgets.dart';
void main() =>
runApp(Example());
class Example extends StatefulWidget {
@jonahwilliams
jonahwilliams / main.dart
Created Mar 23, 2021
Confusing null promotion failure with while loop
View main.dart
import 'package:file/file.dart';
String? findProjectRoot(FileSystem fileSystem, [ String? directory ]) {
const String kProjectRootSentinel = 'pubspec.yaml';
directory ??= fileSystem.currentDirectory.path;
while (true) {
if (fileSystem.isFileSync(fileSystem.path.join(directory, kProjectRootSentinel))) {
return directory;
}
final String parent = fileSystem.path.dirname(directory);
View profile
*** BEGIN CFG
After AllocateRegisters
==== package:jumpjet/src/lighting.dart_LightingSystem__smoothColors@572387241 (RegularFunction)
0: B0[graph]:0 {
v0 <- Constant(#null) T{Null?}
v1 <- Constant(#<optimized out>) T{_OneByteString}
v27 <- Constant(#95999) [95999, 95999] T{_Smi}
v28 <- Constant(#0) [0, 0] T{_Smi}
v33 <- Constant(#true) T{bool}
v38 <- Constant(#256) [256, 256] T{_Smi}
View gist:9a5599f28191d744ade9474d2ae458d3
if (energy <= 0) {
return false;
}
updateVisibility();
var candidates = <Agent>[];
var friends = <Agent>[];
for (var agent in stage.agents) {
if (agent is Tombstone) {
continue;
}
View example ouput
(function() {
var _currentDirectory = (function () {
var _url;
var lines = new Error().stack.split('\n');
function lookupUrl() {
if (lines.length > 2) {
var match = lines[1].match(/^\s+at (.+):\d+:\d+$/);
// Chrome.
if (match) return match[1];
// Chrome nested eval case.
View gist:ad487e839c71bef6192a1188252c754e
ClientException: Connection closed while receiving data
Thread 0 main threadClientException: Connection closed while receiving data
at IOClient.send.<anonymous closure> (io_client.dart:50)
at _invokeErrorHandler (async_error.dart:16)
at _HandleErrorStream._handleError (stream_pipe.dart:282)
at _ForwardingStreamSubscription._handleError (stream_pipe.dart:161)
at _HttpClientResponse.listen.<anonymous closure> (http_impl.dart:441)
at _rootRunBinary (zone.dart:1214)
at _CustomZone.runBinary (zone.dart:1107)
at _CustomZone.runBinaryGuarded (zone.dart:1013)