Jaime Blasco

Version 1.0.0

## 1.0.0 - An optimized modal + Breaking change
- An optimized builder function.
- The `builder` param has changed from:
```dart
showMaterialModalBottomSheet(
context: context,
builder: (context, scrollController) {
return SingleChildScrollView(
controller: scrollController,
child: Container()
)
},
)
```
to
```dart
showMaterialModalBottomSheet(
context: context,
builder: (context) {
return SingleChildScrollView(
controller: ModalScrollController.of(context),
child: Container()
)
},
)
```
Now you can access the modal's scrollController from any inside widget like `ModalScrollController.of(context)`.
## [1.0.1-dev] - Fix instance member 'opaque' can't accessed in an initalizer.
- https://github.com/jamesblasco/modal_bottom_sheet/issues/98
... ...
... ... @@ -2,6 +2,10 @@
# Flutter Modal Bottom Sheet
**BREAKING CHANGE IN 1.0.0**
In the `builder` param remove `scrollController` and use `ModalScrollController.of(context)` instead to access the modal's scrollController.
[![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square)](https://github.com/Solido/awesome-flutter)
[![Pub](https://img.shields.io/pub/v/modal_bottom_sheet.svg?logo=flutter&color=blue&style=flat-square)](https://pub.dev/packages/modal_bottom_sheet)
... ... @@ -36,7 +40,7 @@ https://pub.dev/packages/modal_bottom_sheet#-installing-tab-)
```dart
showMaterialModalBottomSheet(
context: context,
builder: (context, scrollController) => Container(),
builder: (context) => Container(),
)
```
... ... @@ -58,6 +62,17 @@ showMaterialModalBottomSheet(
#### Material params
The optional `backgroundColor`, `elevation`, `shape`, and `clipBehavior` parameters can be passed in to customize the appearance and behavior of material bottom sheets.
#### Using it with a scroll view inside
Assign the `ModalScrollController.of(context)` to your primary modal to sync the scroll with the modal's drag
```dart
showMaterialModalBottomSheet(
context: context,
builder: (context) => SingleChildScrollView(
controller: ModalScrollController.of(context),
child: Container(),
),
);
```
## Cupertino Modal BottomSheet
... ... @@ -67,7 +82,7 @@ iOS 13 came with an amazing new modal navigation and now it is available to use
```dart
showCupertinoModalBottomSheet(
context: context,
builder: (context, scrollController) => Container(),
builder: (context) => Container(),
)
```
See generic paramameter in the Material section above
... ...
... ... @@ -99,7 +99,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.1.0-dev"
version: "1.0.0"
path:
dependency: transitive
description:
... ...
... ... @@ -227,6 +227,7 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
if (_dismissUnderway || !isDragging) return;
isDragging = false;
// ignore: unawaited_futures
_bounceDragController.reverse();
var canClose = true;
... ... @@ -240,6 +241,7 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
_close();
} else if (hasReachedCloseThreshold) {
if (widget.animationController.value > 0.0) {
// ignore: unawaited_futures
widget.animationController.fling(velocity: -1.0);
}
_close();
... ... @@ -293,6 +295,7 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
// Otherwise the calculate the velocity with a VelocityTracker
if (_velocityTracker == null) {
//final pointerKind = defaultPointerDeviceKind(context);
// ignore: deprecated_member_use
_velocityTracker = VelocityTracker();
_startTime = DateTime.now();
}
... ...
... ... @@ -7,49 +7,49 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety"
version: "2.5.0-nullsafety.2"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety"
version: "2.1.0-nullsafety.2"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.2"
version: "1.1.0-nullsafety.4"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety"
version: "1.2.0-nullsafety.2"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety"
version: "1.1.0-nullsafety.2"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.2"
version: "1.15.0-nullsafety.4"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety"
version: "1.2.0-nullsafety.2"
flutter:
dependency: "direct main"
description: flutter
... ... @@ -66,21 +66,21 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10-nullsafety"
version: "0.12.10-nullsafety.2"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.2"
version: "1.3.0-nullsafety.5"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety"
version: "1.8.0-nullsafety.2"
pedantic:
dependency: "direct dev"
description:
... ... @@ -99,56 +99,56 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety"
version: "1.8.0-nullsafety.3"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety"
version: "1.10.0-nullsafety.5"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety"
version: "2.1.0-nullsafety.2"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety"
version: "1.1.0-nullsafety.2"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety"
version: "1.2.0-nullsafety.2"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19-nullsafety"
version: "0.2.19-nullsafety.4"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.2"
version: "1.3.0-nullsafety.4"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.2"
version: "2.1.0-nullsafety.4"
sdks:
dart: ">=2.10.0-0.0.dev <2.10.0"
dart: ">=2.11.0-0.0 <2.12.0"
flutter: ">=1.12.0 <2.0.0"
... ...
name: modal_bottom_sheet
description: 'Create awesome and powerful modal bottom sheets. Material, Cupertino iOS 13 or create your own style'
version: 1.1.0-dev
version: 1.0.0
homepage: 'https://github.com/jamesblasco/modal_bottom_sheet'
environment:
... ...