Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
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
4 changes: 4 additions & 0 deletions sky/sdk/example/stocks/lib/stock_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ class StockDataFetcher {
int _nextChunk = 0;
final StockDataCallback callback;

static bool actuallyFetchData = true;

StockDataFetcher(this.callback) {
_fetchNextChunk();
}

void _fetchNextChunk() {
if (!actuallyFetchData)
return;
fetchBody(_urlToFetch(_nextChunk++)).then((Response response) {
String json = response.bodyAsString();
if (json == null) {
Expand Down
3 changes: 3 additions & 0 deletions sky/tests/examples/stocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'dart:async';
import 'package:sky/widgets/widget.dart';

import '../../sdk/example/stocks/lib/main.dart';
import '../../sdk/example/stocks/lib/stock_data.dart';
import '../resources/display_list.dart';

class TestStocksApp extends StocksApp {
Expand All @@ -21,6 +22,8 @@ class TestStocksApp extends StocksApp {
}

main() async {
StockDataFetcher.actuallyFetchData = false;

TestRenderView testRenderView = new TestRenderView();
TestStocksApp app = new TestStocksApp();
runApp(app, renderViewOverride: testRenderView);
Expand Down