Remove nullOk in MediaQuery.of (#68736)
Adds MediaQuery.maybeOf to replace calling MediaQuery.of(context, nullOk: true), and removes the nullOk parameter. Also changes MediaQuery.of to return a non-nullable value, and removes many instances of the ! operator, reducing the possible places where a null dereference could occur.
This commit is contained in:
@@ -71,7 +71,7 @@ class AdaptiveContainer extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (MediaQuery.of(context)!.size.width < _kGridViewBreakpoint) {
|
||||
if (MediaQuery.of(context).size.width < _kGridViewBreakpoint) {
|
||||
return ListView(
|
||||
itemExtent: _kListItemExtent,
|
||||
children: names.map<Widget>((String name) => AdaptedListItem(name: name)).toList(),
|
||||
|
||||
Reference in New Issue
Block a user