Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
modal_bottom_sheet
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jaime Blasco
2020-07-05 18:13:15 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
dd9709bc527040273fd7e6ec30ed7969a53d665c
dd9709bc
1 parent
e5dad3d6
Prepare version 0.2.0
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
39 additions
and
68 deletions
CHANGELOG.md
example/lib/examples/cupertino_share.dart
example/lib/modals/modal_inside_modal.dart
example/pubspec.lock
lib/src/bottom_sheet.dart
lib/src/bottom_sheet_route.dart
lib/src/bottom_sheets/cupertino_bottom_sheet.dart
lib/src/utils/bottom_sheet_suspended_curve.dart
pubspec.yaml
CHANGELOG.md
View file @
dd9709b
...
...
@@ -13,3 +13,9 @@
-
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
## [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.
\ No newline at end of file
...
...
example/lib/examples/cupertino_share.dart
View file @
dd9709b
...
...
@@ -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
(
...
...
example/lib/modals/modal_inside_modal.dart
View file @
dd9709b
...
...
@@ -35,7 +35,8 @@ class ModalInsideModal extends StatelessWidget {
backgroundColor:
Colors
.
transparent
,
builder:
(
context
,
scrollController
)
=>
ModalInsideModal
(
scrollController:
scrollController
,
reverse:
reverse
),
scrollController:
scrollController
,
reverse:
reverse
),
)),
)).
toList
(),
),
...
...
example/pubspec.lock
View file @
dd9709b
# 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:
...
...
@@ -29,34 +15,34 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
char
code
:
char
acters
:
dependency: transitive
description:
name: char
code
name: char
acters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
collection:
version: "1.0.0"
charcode:
dependency: transitive
description:
name: c
ollection
name: c
harcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.12"
convert:
version: "1.1.3"
clock:
dependency: transitive
description:
name: c
onvert
name: c
lock
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
version: "1.0.1"
collection:
dependency: transitive
description:
name: c
rypto
name: c
ollection
url: "https://pub.dartlang.org"
source: hosted
version: "
2.1.4
"
version: "
1.14.13
"
cupertino_icons:
dependency: "direct main"
description:
...
...
@@ -64,6 +50,13 @@ packages:
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
...
...
@@ -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:
...
...
@@ -106,21 +92,14 @@ 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:
...
...
@@ -128,13 +107,6 @@ packages:
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
...
...
@@ -181,7 +153,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1
5
"
version: "0.2.1
7
"
typed_data:
dependency: transitive
description:
...
...
@@ -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"
...
...
lib/src/bottom_sheet.dart
View file @
dd9709b
...
...
@@ -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
);
...
...
lib/src/bottom_sheet_route.dart
View file @
dd9709b
...
...
@@ -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
:
...
...
lib/src/bottom_sheets/cupertino_bottom_sheet.dart
View file @
dd9709b
...
...
@@ -198,7 +198,6 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> {
),
child:
child
,
animation:
secondaryAnimation
,
);
}
...
...
@@ -279,7 +278,6 @@ class _CupertinoModalTransition extends StatelessWidget {
}
}
class
_CupertinoScaffold
extends
InheritedWidget
{
final
AnimationController
animation
;
...
...
@@ -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
;
...
...
lib/src/utils/bottom_sheet_suspended_curve.dart
View file @
dd9709b
...
...
@@ -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
);
}
...
...
pubspec.yaml
View file @
dd9709b
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
:
...
...
Please
register
or
login
to post a comment