Showing
1 changed file
with
6 additions
and
6 deletions
@@ -83,12 +83,12 @@ Future<T> showCupertinoModalBottomSheet<T>({ | @@ -83,12 +83,12 @@ Future<T> showCupertinoModalBottomSheet<T>({ | ||
83 | assert(useRootNavigator != null); | 83 | assert(useRootNavigator != null); |
84 | assert(enableDrag != null); | 84 | assert(enableDrag != null); |
85 | assert(debugCheckHasMediaQuery(context)); | 85 | assert(debugCheckHasMediaQuery(context)); |
86 | - final isCupertinoApp = Theme.of(context, shadowThemeOnly: true) == null; | ||
87 | - String barrierLabel = ''; | ||
88 | - if (!isCupertinoApp) { | ||
89 | - assert(debugCheckHasMaterialLocalizations(context)); | ||
90 | - barrierLabel = MaterialLocalizations.of(context).modalBarrierDismissLabel; | ||
91 | - } | 86 | + final hasMaterialLocalizations = |
87 | + Localizations.of<MaterialLocalizations>(context, MaterialLocalizations) != | ||
88 | + null; | ||
89 | + final barrierLabel = hasMaterialLocalizations | ||
90 | + ? MaterialLocalizations.of(context).modalBarrierDismissLabel | ||
91 | + : ''; | ||
92 | 92 | ||
93 | final result = await Navigator.of(context, rootNavigator: useRootNavigator) | 93 | final result = await Navigator.of(context, rootNavigator: useRootNavigator) |
94 | .push(CupertinoModalBottomSheetRoute<T>( | 94 | .push(CupertinoModalBottomSheetRoute<T>( |
-
Please register or login to post a comment