Skip to content

Instantly share code, notes, and snippets.

View eseidel's full-sized avatar

Eric Seidel eseidel

View GitHub Profile
@eseidel
eseidel / preview_main.dart
Created September 8, 2026 16:38
preview_main.dart
// Generated entry point. The build compiles this file, not the app's own
// main.dart, and removes it again when the build finishes.
//
// The point of it is ordering: the safe-area binding has to exist before the
// app calls runApp, and the font has to be registered before the first frame.
// Nothing about the app's source can be assumed, so the app is imported as a
// library and its main() is called last.
//
// In the real toolchain this is three files -- a generated entry point and two
// shims copied in beside it. Here they are one file so it stands alone.
@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