Unverified Commit 9a7b1a73 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Replace platform check with swtich (#24752)

Generally, we should always use default-less switches for
platform-specific behaviour so we're forced to make a conscious decision
on each instance of such behaviour any time we add support for a new
platform.
parent 5e8e3972
...@@ -1777,21 +1777,26 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin { ...@@ -1777,21 +1777,26 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {
removeBottomPadding: true, removeBottomPadding: true,
); );
if (themeData.platform == TargetPlatform.iOS) { switch (themeData.platform) {
_addIfNonNull( case TargetPlatform.iOS:
children, _addIfNonNull(
GestureDetector( children,
behavior: HitTestBehavior.opaque, GestureDetector(
onTap: _handleStatusBarTap, behavior: HitTestBehavior.opaque,
// iOS accessibility automatically adds scroll-to-top to the clock in the status bar onTap: _handleStatusBarTap,
excludeFromSemantics: true, // iOS accessibility automatically adds scroll-to-top to the clock in the status bar
), excludeFromSemantics: true,
_ScaffoldSlot.statusBar, ),
removeLeftPadding: false, _ScaffoldSlot.statusBar,
removeTopPadding: true, removeLeftPadding: false,
removeRightPadding: false, removeTopPadding: true,
removeBottomPadding: true, removeRightPadding: false,
); removeBottomPadding: true,
);
break;
case TargetPlatform.android:
case TargetPlatform.fuchsia:
break;
} }
if (_endDrawerOpened) { if (_endDrawerOpened) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment