Created with <3 with dartpad.dev.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Options<PluginOptions extends Object?> { | |
| const Options({ | |
| this.pluginOptions, | |
| }); | |
| final PluginOptions? pluginOptions; | |
| } | |
| class AWSPluginOptions {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:async'; | |
| void callback() async { | |
| await Future.delayed(Duration.zero); | |
| throw Exception(); | |
| } | |
| void main() { | |
| try { | |
| callback(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:async'; | |
| void main() { | |
| final controller = StreamController<void>(); | |
| controller.close(); | |
| try { | |
| controller.add(null); | |
| } catch (e) { | |
| print(e.runtimeType); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() async { | |
| final future = Future.error('error'); | |
| try { | |
| await future; | |
| } catch (e) { | |
| print('Caught $e'); | |
| } | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:http/http.dart' as http; | |
| enum APIAuthorizationType<T extends AuthProvider> { | |
| // apiKey, | |
| // userPools, | |
| iam<IAMAuthProvider>(), | |
| // oidc, | |
| // lambda | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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()); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Model {} | |
| class ConflictData<M extends Model> { | |
| final M local; | |
| final M remote; | |
| const ConflictData(this.local, this.remote); | |
| } | |
| class ModelA extends Model {} |