Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import 'package:flutter/material.dart';
import 'package:playground/constants/colors.dart';

class LoadingIndicator extends StatelessWidget {
final double size;

const LoadingIndicator({Key? key, required this.size}) : super(key: key);

@override
Widget build(BuildContext context) {
return Center(
child: SizedBox(
height: size,
width: size,
child: const CircularProgressIndicator(
color: kLightPrimary,
),
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class CodeRepository {
final log = responses[1];
final error = responses[2];
return RunCodeResult(
pipelineUuid: pipelineUuid,
status: status,
output: prevOutput + output.output + error.output,
log: prevLog + log.output,
Expand Down
32 changes: 20 additions & 12 deletions playground/frontend/lib/modules/examples/example_selector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import 'package:flutter/material.dart';
import 'package:playground/components/loading_indicator/loading_indicator.dart';
import 'package:playground/config/theme.dart';
import 'package:playground/constants/sizes.dart';
import 'package:playground/modules/examples/components/examples_components.dart';
Expand Down Expand Up @@ -151,18 +152,10 @@ class _ExampleSelectorState extends State<ExampleSelector>
color: Theme.of(context).backgroundColor,
borderRadius: BorderRadius.circular(kMdBorderRadius),
),
child: Column(
children: [
SearchField(controller: textController),
const TypeFilter(),
ExampleList(
controller: scrollController,
selectedExample: playgroundState.selectedExample!,
animationController: animationController,
dropdown: examplesDropdown,
),
],
),
child: exampleState.sdkCategories == null ||
playgroundState.selectedExample == null
? const LoadingIndicator(size: kContainerHeight)
: _buildDropdownContent(playgroundState),
),
),
),
Expand All @@ -175,6 +168,21 @@ class _ExampleSelectorState extends State<ExampleSelector>
);
}

Widget _buildDropdownContent(PlaygroundState playgroundState) {
return Column(
children: [
SearchField(controller: textController),
const TypeFilter(),
ExampleList(
controller: scrollController,
selectedExample: playgroundState.selectedExample!,
animationController: animationController,
dropdown: examplesDropdown,
),
],
);
}

SelectorPositionModel findSelectorPositionData() {
RenderBox? rBox =
selectorKey.currentContext?.findRenderObject() as RenderBox;
Expand Down