Skip to content

Commit

Permalink
get sdkId (apache#23593)
Browse files Browse the repository at this point in the history
  • Loading branch information
darkhan.nausharipov committed Nov 5, 2022
1 parent 8807c00 commit 8e8d8c9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions learning/tour-of-beam/frontend/lib/models/content_tree.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,27 @@ import 'node.dart';
import 'parent_node.dart';

class ContentTreeModel extends ParentNodeModel {
final String sdkId;
final String sdk;
final List<ModuleModel> modules;

String get sdkId => sdk;

@override
List<NodeModel> get nodes => modules;

const ContentTreeModel({
required this.sdkId,
required this.sdk,
required this.modules,
}) : super(
id: sdkId,
parent: null,
title: '',
nodes: modules,
);
id: sdk,
parent: null,
title: '',
nodes: modules,
);

ContentTreeModel.fromResponse(GetContentTreeResponse response)
: this(
sdkId: response.sdkId,
sdk: response.sdkId,
modules: response.modules
.map(ModuleModel.fromResponse)
.toList(growable: false),
Expand Down

0 comments on commit 8e8d8c9

Please sign in to comment.