alexeyinkin commented on code in PR #24338:
URL: https://github.com/apache/beam/pull/24338#discussion_r1031600823
##########
playground/frontend/playground_components/lib/src/controllers/example_loaders/empty_example_loader.dart:
##########
@@ -20,24 +20,32 @@ import '../../cache/example_cache.dart';
import '../../models/example.dart';
import '../../models/example_base.dart';
import
'../../models/example_loading_descriptors/empty_example_loading_descriptor.dart';
+import '../../models/sdk.dart';
import 'example_loader.dart';
class EmptyExampleLoader extends ExampleLoader {
final EmptyExampleLoadingDescriptor descriptor;
+ final Example _example;
- const EmptyExampleLoader({
+ EmptyExampleLoader({
required this.descriptor,
// TODO(alexeyinkin): Remove when this lands:
https://github.com/dart-lang/language/issues/1813
required ExampleCache exampleCache,
- });
+ }) : _example = createExample(descriptor.sdk);
@override
- Future<Example> get future async => Example(
- name: 'Embedded_Example',
- path: '',
- sdk: descriptor.sdk,
- source: '',
- tags: [],
- type: ExampleType.example,
- );
+ Sdk get sdk => _example.sdk;
+
+ @override
+ Future<Example> get future async => _example;
+
+ static Example createExample(Sdk sdk) {
Review Comment:
`+`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]