Remove unnecessary null checks in dev/benchmarks (#118840)
* Remove unnecessary null checks in dev/benchmarks * empty
This commit is contained in:
committed by
GitHub
parent
ec51d3271e
commit
54217bd4b1
@@ -78,11 +78,6 @@ class StockData extends ChangeNotifier {
|
||||
void _fetchNextChunk() {
|
||||
_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}');
|
||||
_end();
|
||||
return;
|
||||
}
|
||||
const JsonDecoder decoder = JsonDecoder();
|
||||
add(decoder.convert(json) as List<dynamic>);
|
||||
if (_nextChunk < _chunkCount) {
|
||||
|
||||
@@ -85,9 +85,7 @@ class StockHomeState extends State<StockHome> {
|
||||
}
|
||||
|
||||
void _handleStockModeChange(StockMode? value) {
|
||||
if (widget.updater != null) {
|
||||
widget.updater(widget.configuration.copyWith(stockMode: value));
|
||||
}
|
||||
widget.updater(widget.configuration.copyWith(stockMode: value));
|
||||
}
|
||||
|
||||
void _handleStockMenu(BuildContext context, _StockMenuItem value) {
|
||||
|
||||
@@ -93,9 +93,7 @@ class StockSettingsState extends State<StockSettings> {
|
||||
}
|
||||
|
||||
void sendUpdates(StockConfiguration value) {
|
||||
if (widget.updater != null) {
|
||||
widget.updater(value);
|
||||
}
|
||||
widget.updater(value);
|
||||
}
|
||||
|
||||
AppBar buildAppBar(BuildContext context) {
|
||||
|
||||
@@ -18,7 +18,6 @@ class _StockSymbolView extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
assert(stock != null);
|
||||
final String lastSale = '\$${stock.lastSale.toStringAsFixed(2)}';
|
||||
String changeInPrice = '${stock.percentChange.toStringAsFixed(2)}%';
|
||||
if (stock.percentChange > 0) {
|
||||
|
||||
@@ -17,16 +17,7 @@ class StockConfiguration {
|
||||
required this.debugShowRainbow,
|
||||
required this.showPerformanceOverlay,
|
||||
required this.showSemanticsDebugger,
|
||||
}) : assert(stockMode != null),
|
||||
assert(backupMode != null),
|
||||
assert(debugShowGrid != null),
|
||||
assert(debugShowSizes != null),
|
||||
assert(debugShowBaselines != null),
|
||||
assert(debugShowLayers != null),
|
||||
assert(debugShowPointers != null),
|
||||
assert(debugShowRainbow != null),
|
||||
assert(showPerformanceOverlay != null),
|
||||
assert(showSemanticsDebugger != null);
|
||||
});
|
||||
|
||||
final StockMode stockMode;
|
||||
final BackupMode backupMode;
|
||||
|
||||
Reference in New Issue
Block a user