Skip to content

Commit

Permalink
Prepare version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesblasco committed Jul 5, 2020
1 parent e5dad3d commit dd9709b
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 79 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@
## [0.1.6] - New custom params
- Use `duration` to define the opening duration of the modal
- Change the top radius of the cupertino bottom sheet
Thanks to @bierbaumtim @troyanskiy @rodineijf for the contributions
Thanks to @bierbaumtim @troyanskiy @rodineijf for the contributions


## [0.2.0] - New Cool Features
- Added support for scroll-to-top by tapping the status bar on iOS devices.
- Use `curveAnimation` to define a custom curve animation for the modal transition
- Bug fixes releated to horizontal scroll, clamping physics and othes.
1 change: 0 additions & 1 deletion example/lib/examples/cupertino_share.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
class CupertinoSharePage extends StatelessWidget {
@override
Widget build(BuildContext context) {

return Scaffold(
appBar: appBar(context),
body: CupertinoPageScaffold(
Expand Down
3 changes: 2 additions & 1 deletion example/lib/modals/modal_inside_modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class ModalInsideModal extends StatelessWidget {
backgroundColor: Colors.transparent,
builder: (context, scrollController) =>
ModalInsideModal(
scrollController: scrollController, reverse: reverse),
scrollController: scrollController,
reverse: reverse),
)),
)).toList(),
),
Expand Down
83 changes: 24 additions & 59 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.0"
async:
dependency: transitive
description:
Expand All @@ -29,41 +15,48 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
charcode:
characters:
dependency: transitive
description:
name: charcode
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
collection:
version: "1.0.0"
charcode:
dependency: transitive
description:
name: collection
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.12"
convert:
version: "1.1.3"
clock:
dependency: transitive
description:
name: convert
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
version: "1.0.1"
collection:
dependency: transitive
description:
name: crypto
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
version: "1.14.13"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -79,20 +72,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.12"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.6"
version: "0.12.8"
meta:
dependency: transitive
description:
Expand All @@ -106,35 +92,21 @@ packages:
path: ".."
relative: true
source: path
version: "0.1.6"
version: "0.2.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
version: "1.7.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -181,7 +153,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.15"
version: "0.2.17"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -224,13 +196,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.1"
sdks:
dart: ">=2.7.0 <3.0.0"
dart: ">=2.9.0-14.0.dev <3.0.0"
flutter: ">=1.12.8 <2.0.0"
1 change: 0 additions & 1 deletion lib/src/bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import 'package:flutter/widgets.dart';
import 'package:modal_bottom_sheet/src/utils/primary_scroll_status_bar.dart';

import 'package:modal_bottom_sheet/src/utils/bottom_sheet_suspended_curve.dart';
import 'package:modal_bottom_sheet/src/utils/primary_scroll_status_bar.dart';


const Curve _decelerateEasing = Cubic(0.0, 0.0, 0.2, 1.0);
Expand Down
3 changes: 3 additions & 0 deletions lib/src/bottom_sheet_route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> {
final platform = Theme.of(context)?.platform ?? defaultTargetPlatform;
switch (platform) {
case TargetPlatform.iOS:
case TargetPlatform.linux:
case TargetPlatform.macOS:
case TargetPlatform.windows:
return '';
case TargetPlatform.android:
case TargetPlatform.fuchsia:
Expand Down
24 changes: 11 additions & 13 deletions lib/src/bottom_sheets/cupertino_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,18 +187,17 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> {
(paddingTop + _behind_widget_visible_height) * 0.9;
final offsetY = secondaryAnimation.value * (paddingTop - distanceWithScale);
final scale = 1 - secondaryAnimation.value / 10;
return AnimatedBuilder(
builder: (context, child) => Transform.translate(
offset: Offset(0, offsetY),
child: Transform.scale(
scale: scale,
child: child,
alignment: Alignment.topCenter,
),
return AnimatedBuilder(
builder: (context, child) => Transform.translate(
offset: Offset(0, offsetY),
child: Transform.scale(
scale: scale,
child: child,
alignment: Alignment.topCenter,
),
child: child,
animation: secondaryAnimation,

),
child: child,
animation: secondaryAnimation,
);
}

Expand Down Expand Up @@ -279,7 +278,6 @@ class _CupertinoModalTransition extends StatelessWidget {
}
}


class _CupertinoScaffold extends InheritedWidget {
final AnimationController animation;

Expand Down Expand Up @@ -339,7 +337,7 @@ class CupertinoScaffold extends StatefulWidget {
assert(enableDrag != null);
assert(debugCheckHasMediaQuery(context));
final isCupertinoApp = Theme.of(context, shadowThemeOnly: true) == null;
String barrierLabel = '';
var barrierLabel = '';
if (!isCupertinoApp) {
assert(debugCheckHasMaterialLocalizations(context));
barrierLabel = MaterialLocalizations.of(context).modalBarrierDismissLabel;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/bottom_sheet_suspended_curve.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class BottomSheetSuspendedCurve extends ParametricCurve<double> {
return t;
}

final double curveProgress = (t - startingPoint) / (1 - startingPoint);
final double transformed = curve.transform(curveProgress);
final curveProgress = (t - startingPoint) / (1 - startingPoint);
final transformed = curve.transform(curveProgress);
return lerpDouble(startingPoint, 1, transformed);
}

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: 0.1.6
version: 0.2.0
homepage: 'https://github.com/jamesblasco/modal_bottom_sheet'

environment:
Expand Down

0 comments on commit dd9709b

Please sign in to comment.