diff --git a/packages/flutter/example/stocks/lib/stock_data.dart b/packages/flutter/example/stocks/lib/stock_data.dart index 5526a9c9cd..7c1e046c21 100644 --- a/packages/flutter/example/stocks/lib/stock_data.dart +++ b/packages/flutter/example/stocks/lib/stock_data.dart @@ -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) {