Prefer void to null (#22977)
* Future<void> main * Future<void>.delayed * prefer_void_to_Null * address review comments
This commit is contained in:
committed by
GitHub
parent
5efe095895
commit
0fb84e96c7
@@ -77,7 +77,7 @@ class StockData extends ChangeNotifier {
|
||||
static bool actuallyFetchData = true;
|
||||
|
||||
void _fetchNextChunk() {
|
||||
_httpClient.get(_urlToFetch(_nextChunk++)).then<Null>((http.Response response) {
|
||||
_httpClient.get(_urlToFetch(_nextChunk++)).then<void>((http.Response response) {
|
||||
final String json = response.body;
|
||||
if (json == null) {
|
||||
debugPrint('Failed to load stock data chunk ${_nextChunk - 1}');
|
||||
|
||||
@@ -263,7 +263,7 @@ class StockHomeState extends State<StockHome> {
|
||||
Navigator.pushNamed(context, '/stock:${stock.symbol}');
|
||||
},
|
||||
onShow: (Stock stock) {
|
||||
_scaffoldKey.currentState.showBottomSheet<Null>((BuildContext context) => StockSymbolBottomSheet(stock: stock));
|
||||
_scaffoldKey.currentState.showBottomSheet<void>((BuildContext context) => StockSymbolBottomSheet(stock: stock));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -29,13 +29,13 @@ void main() {
|
||||
// Scroll down
|
||||
for (int i = 0; i < 5; i++) {
|
||||
await driver.scroll(stockList, 0.0, -300.0, const Duration(milliseconds: 300));
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 500));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 500));
|
||||
}
|
||||
|
||||
// Scroll up
|
||||
for (int i = 0; i < 5; i++) {
|
||||
await driver.scroll(stockList, 0.0, 300.0, const Duration(milliseconds: 300));
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 500));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 500));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user