Skip to content

Commit

Permalink
Merge pull request jamesblasco#105 from noordawod/bugfix/theme-of
Browse files Browse the repository at this point in the history
Fix a bug with latest version of Flutter.
  • Loading branch information
jamesblasco authored Nov 11, 2020
2 parents 3018a40 + 6ff9415 commit c0a3b4c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/src/bottom_sheets/cupertino_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import 'dart:async';

import 'package:flutter/cupertino.dart' show CupertinoTheme;
import 'package:flutter/cupertino.dart' show CupertinoTheme, CupertinoApp;
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'
Expand Down Expand Up @@ -341,7 +341,8 @@ class CupertinoScaffold extends StatefulWidget {
assert(useRootNavigator != null);
assert(enableDrag != null);
assert(debugCheckHasMediaQuery(context));
final isCupertinoApp = Theme.of(context, shadowThemeOnly: true) == null;
final isCupertinoApp =
context.findAncestorWidgetOfExactType<CupertinoApp>() != null;
var barrierLabel = '';
if (!isCupertinoApp) {
assert(debugCheckHasMaterialLocalizations(context));
Expand Down
2 changes: 1 addition & 1 deletion lib/src/bottom_sheets/material_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Future<T> showMaterialModalBottomSheet<T>({
elevation: elevation,
shape: shape,
clipBehavior: clipBehavior,
theme: Theme.of(context, shadowThemeOnly: true),
theme: Theme.of(context),
),
secondAnimationController: secondAnimation,
bounce: bounce,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: modal_bottom_sheet
description: 'Create awesome and powerful modal bottom sheets. Material, Cupertino iOS 13 or create your own style'
version: 1.0.1-dev
version: 1.1.0-dev
homepage: 'https://github.com/jamesblasco/modal_bottom_sheet'

environment:
Expand Down

0 comments on commit c0a3b4c

Please sign in to comment.