Skip to content

Instantly share code, notes, and snippets.

View eseidel's full-sized avatar

Eric Seidel eseidel

View GitHub Profile
@eseidel
eseidel / non_const_set.dart
Created September 30, 2024 22:02
hashCode for non-const objects in Dart
class MyObject {
const MyObject(this.field);
final String field;
// Since this does not implement hashCode, every MyObject instance will
// have a unique hashCode. Meaning you can end up with multiple of the
// "same" object in a Set.
// If they're constructed with const, obviously there will only be one
// "const" instance, so those will all be the same.
}
@eseidel
eseidel / main.dart
Created September 8, 2024 05:25
go_router counter
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
void main() {
runApp(const MyApp());
}
/// The route configuration.
final GoRouter _router = GoRouter(
routes: <RouteBase>[
@eseidel
eseidel / switch_async.dart
Created August 8, 2024 15:51
Testing behavior of switch and async
// Stubs for package:http.
enum HttpMethod {
GET,
POST,
PATCH,
}
class HttpStatus {
static const int ok = 200;
static const int methodNotAllowed = 405;
@eseidel
eseidel / xcode.diff
Created June 17, 2024 21:33
XCode non-determinism
--- DiffPatchRunnerDisassembly 2024-06-17 17:06:29
+++ ReleaseRunnerDisassembly 2024-06-17 17:06:15
@@ -1,4 +1,4 @@
-DiffPatchRunner:
+ReleaseRunner:
(__TEXT,__text) section
0000000100004000 sub sp, sp, #0x40
0000000100004004 stp x22, x21, [sp, #0x10]
@@ -1278328,1181 +1278328,1163 @@
00000001004e3d94 ldp x28, x27, [sp, #0x60]
@eseidel
eseidel / path.dart
Created December 17, 2023 18:15
test of path with empty first value
import 'package:path/path.dart' as path;
void main() {
print(path.join('', 'bin', 'java.exe'));
}
@eseidel
eseidel / flutter_companies.md
Last active November 13, 2023 14:28
List of companies serving Flutter developers

This is a list of companies serving Flutter developers who replied to my Twitter thread on June 14th, 2023.

This does not include companies using Flutter (there are simply too many to list!), only those offering products or services for Flutter developers.

Presence on this list is not imply any endorsement of the company or its products (other than Shorebird, of course, I endourse my own company).

@eseidel
eseidel / fuel_logic.txt
Created June 10, 2023 15:07
output from fuel buying logic
X1-JY33-68113B 108 56
X1-SJ74-17013F 109 56
X1-AD50-96037Z 109 56
X1-PG48-77613D 110 57
X1-BF69-19557A 111 58
X1-JX24-85913A 119 62
X1-CG57-49267E 120 62
X1-PD87-99960E 125 113
X1-TK76-05664B 125 113
X1-YQ87-24385F 125 113
@eseidel
eseidel / confusion.dart
Created May 21, 2023 01:14
confusing exception handling with futures
class ApiException implements Exception {
ApiException();
}
Future<void> inner() async {
throw ApiException();
}
Future<void> _middle() async {
try {
@eseidel
eseidel / engine.txt
Created March 3, 2023 17:09
List of engine files
.
./android_release_x64
./android_release_x64/clang_x64
./android_release_x64/clang_x64/gen_snapshot.exe
./android_release_x64/flutter_embedding_release.jar
./android_release_x64/flutter_embedding_release.maven-metadata.xml
./android_release_x64/flutter_embedding_release.pom
./android_release_x64/flutter_patched_sdk
./android_release_x64/flutter_patched_sdk/platform_strong.dill
./android_release_x64/flutter_patched_sdk/platform_strong.dill.d
@eseidel
eseidel / bug_report.txt
Created February 28, 2023 18:09
bug_report from android emulator
This file has been truncated, but you can view the full file.
--------- beginning of kernel
02-28 10:04:05.379 0 0 I : Booting Linux on physical CPU 0x0000000000 [0x00000000]
02-28 10:04:05.379 0 0 I : Linux version 5.10.110-android12-9-00004-gb92ac325368e-ab8731800 (build-user@build-host) (Android (7284624, based on r416183b) clang version 12.0.5 (https://android.googlesource.com/toolchain/llvm-project c935d99d7cf2016289302412d708641d52d2f7ee), LLD 12.0.5 (/buildbot/src/android/llvm-toolchain/out/llvm-project/lld c935d99d7cf2016289302412d708641d52d2f7ee)) #1 SMP PREEMPT Tue Jun 14 13:40:53 UTC 2022
02-28 10:04:05.379 0 0 I Machine model: linux,ranchu
02-28 10:04:05.379 0 0 I : Stack Depot is disabled
02-28 10:04:05.379 0 0 I printk : debug: skip boot console de-registration.
02-28 10:04:05.379 0 0 I efi : UEFI not found.
02-28 10:04:05.379 0 0 I Zone ranges:
02-28 10:04:05.379 0 0 I : DMA32 [mem 0x0000000040000000-0x00000000bfffffff]
02-28 10:04:05.379 0 0