Skip to content

Instantly share code, notes, and snippets.

View dnys1's full-sized avatar

Dillon Nys dnys1

View GitHub Profile
@dnys1
dnys1 / main.dart
Created March 15, 2023 23:54
hopeful-zephyr-4541
class Options<PluginOptions extends Object?> {
const Options({
this.pluginOptions,
});
final PluginOptions? pluginOptions;
}
class AWSPluginOptions {}
@dnys1
dnys1 / main.dart
Created December 14, 2022 17:40
hopeful-zephyr-4541
import 'dart:async';
void callback() async {
await Future.delayed(Duration.zero);
throw Exception();
}
void main() {
try {
callback();
@dnys1
dnys1 / main.dart
Created December 2, 2022 20:28
hopeful-zephyr-4541
import 'dart:async';
void main() {
final controller = StreamController<void>();
controller.close();
try {
controller.add(null);
} catch (e) {
print(e.runtimeType);
}
@dnys1
dnys1 / readme.md
Created October 18, 2022 00:19
neapolitan-marble-4335

neapolitan-marble-4335

Created with <3 with dartpad.dev.

@dnys1
dnys1 / main.dart
Last active October 3, 2022 18:53
neapolitan-marble-4335
void main() async {
final future = Future.error('error');
try {
await future;
} catch (e) {
print('Caught $e');
}
try {
/*
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
import 'package:http/http.dart' as http;
enum APIAuthorizationType<T extends AuthProvider> {
// apiKey,
// userPools,
iam<IAMAuthProvider>(),
// oidc,
// lambda
}
import 'package:e2e_test/e2e_test.dart';
import 'package:e2e_test/src/workers.debug.compiled.dart'
deferred as debug_workers;
import 'package:e2e_test/src/workers.release.compiled.dart'
deferred as release_workers;
import 'package:test/test.dart';
void main() {
Future<void> warmup() async {
@dnys1
dnys1 / main.dart
Last active February 12, 2022 16:45
import 'dart:async';
void main() {
final stateMachine = MyStateMachine();
// Dispatch three events synchronously. Notice how they are processed.
stateMachine.dispatch(MyEvent());
stateMachine.dispatch(MyEvent());
stateMachine.dispatch(MyEvent());
}
class Model {}
class ConflictData<M extends Model> {
final M local;
final M remote;
const ConflictData(this.local, this.remote);
}
class ModelA extends Model {}