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
2023-01-28 17:03:25 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-01-28 19:03:25 +0300
Commit
2e9afcec800ccd4d91cdad7a5c9c23cadccdc5c5
2e9afcec
1 parent
42da8b01
fix: deprecate duplicated name (#323)
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
28 additions
and
21 deletions
modal_bottom_sheet/example/lib/modals/circular_modal.dart
modal_bottom_sheet/example/macos/Podfile
modal_bottom_sheet/example/macos/Podfile.lock
modal_bottom_sheet/example/macos/Runner.xcodeproj/project.pbxproj
modal_bottom_sheet/lib/src/bottom_sheet_route.dart
modal_bottom_sheet/lib/src/bottom_sheets/bar_bottom_sheet.dart
modal_bottom_sheet/lib/src/bottom_sheets/cupertino_bottom_sheet.dart
modal_bottom_sheet/lib/src/bottom_sheets/material_bottom_sheet.dart
modal_bottom_sheet/lib/src/material_with_modal_page_route.dart
modal_bottom_sheet/example/lib/modals/circular_modal.dart
View file @
2e9afce
...
...
@@ -99,7 +99,7 @@ Future<T?> showAvatarModalBottomSheet<T>({
assert
(
debugCheckHasMediaQuery
(
context
));
assert
(
debugCheckHasMaterialLocalizations
(
context
));
final
result
=
await
Navigator
.
of
(
context
,
rootNavigator:
useRootNavigator
)
.
push
(
modal_bottom_sheet
.
Modal
Bottom
SheetRoute
<
T
>(
.
push
(
modal_bottom_sheet
.
ModalSheetRoute
<
T
>(
builder:
builder
,
containerBuilder:
(
_
,
animation
,
child
)
=>
AvatarBottomSheet
(
child:
child
,
...
...
modal_bottom_sheet/example/macos/Podfile
View file @
2e9afce
platform
:osx
,
'10.1
1
'
platform
:osx
,
'10.1
4
'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV
[
'COCOAPODS_DISABLE_STATS'
]
=
'true'
...
...
modal_bottom_sheet/example/macos/Podfile.lock
View file @
2e9afce
...
...
@@ -14,9 +14,9 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
SPEC CHECKSUMS:
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
url_launcher_macos: c04e4fa86382d4f94f6b38f14625708be3ae52e2
PODFILE CHECKSUM:
6eac6b3292e5142cfc23bdeb71848a40ec51c14c
PODFILE CHECKSUM:
353c8bcc5d5b0994e508d035b5431cfe18c1dea7
COCOAPODS: 1.11.3
...
...
modal_bottom_sheet/example/macos/Runner.xcodeproj/project.pbxproj
View file @
2e9afce
...
...
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 5
1
;
objectVersion = 5
4
;
objects = {
/* Begin PBXAggregateTarget section */
...
...
@@ -278,6 +278,7 @@
};
3399D490228B24CF009A79C7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
...
...
@@ -404,7 +405,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.1
1
;
MACOSX_DEPLOYMENT_TARGET = 10.1
4
;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
...
...
@@ -483,7 +484,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.1
1
;
MACOSX_DEPLOYMENT_TARGET = 10.1
4
;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
...
...
@@ -530,7 +531,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.1
1
;
MACOSX_DEPLOYMENT_TARGET = 10.1
4
;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
...
...
modal_bottom_sheet/lib/src/bottom_sheet_route.dart
View file @
2e9afce
...
...
@@ -19,7 +19,7 @@ class _ModalBottomSheet<T> extends StatefulWidget {
})
:
super
(
key:
key
);
final
double
?
closeProgressThreshold
;
final
Modal
Bottom
SheetRoute
<
T
>
route
;
final
ModalSheetRoute
<
T
>
route
;
final
bool
expanded
;
final
bool
bounce
;
final
bool
enableDrag
;
...
...
@@ -122,8 +122,14 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> {
}
}
class
ModalBottomSheetRoute
<
T
>
extends
PageRoute
<
T
>
{
ModalBottomSheetRoute
({
@Deprecated
(
'ModalBottomSheetRoute has been introduced in Flutter 3.7, to avoid name '
'conflicts, this class has been renamed to ModalSheetRoute in this '
'packages. ModalBottomSheetRoute will be removed in the next major version.'
)
typedef
ModalBottomSheetRoute
<
T
>
=
ModalSheetRoute
<
T
>;
class
ModalSheetRoute
<
T
>
extends
PageRoute
<
T
>
{
ModalSheetRoute
({
this
.
closeProgressThreshold
,
this
.
containerBuilder
,
required
this
.
builder
,
...
...
@@ -211,11 +217,11 @@ class ModalBottomSheetRoute<T> extends PageRoute<T> {
@override
bool
canTransitionTo
(
TransitionRoute
<
dynamic
>
nextRoute
)
=>
nextRoute
is
Modal
Bottom
SheetRoute
;
nextRoute
is
ModalSheetRoute
;
@override
bool
canTransitionFrom
(
TransitionRoute
<
dynamic
>
previousRoute
)
=>
previousRoute
is
Modal
Bottom
SheetRoute
||
previousRoute
is
PageRoute
;
previousRoute
is
ModalSheetRoute
||
previousRoute
is
PageRoute
;
Widget
getPreviousRouteTransition
(
BuildContext
context
,
...
...
@@ -257,7 +263,7 @@ Future<T?> showCustomModalBottomSheet<T>({
:
''
;
final
result
=
await
Navigator
.
of
(
context
,
rootNavigator:
useRootNavigator
)
.
push
(
Modal
Bottom
SheetRoute
<
T
>(
.
push
(
ModalSheetRoute
<
T
>(
builder:
builder
,
bounce:
bounce
,
containerBuilder:
containerWidget
,
...
...
modal_bottom_sheet/lib/src/bottom_sheets/bar_bottom_sheet.dart
View file @
2e9afce
...
...
@@ -98,7 +98,7 @@ Future<T?> showBarModalBottomSheet<T>({
assert
(
debugCheckHasMediaQuery
(
context
));
assert
(
debugCheckHasMaterialLocalizations
(
context
));
final
result
=
await
Navigator
.
of
(
context
,
rootNavigator:
useRootNavigator
)
.
push
(
modal_bottom_sheet
.
Modal
Bottom
SheetRoute
<
T
>(
.
push
(
modal_bottom_sheet
.
ModalSheetRoute
<
T
>(
builder:
builder
,
bounce:
bounce
,
closeProgressThreshold:
closeProgressThreshold
,
...
...
modal_bottom_sheet/lib/src/bottom_sheets/cupertino_bottom_sheet.dart
View file @
2e9afce
...
...
@@ -144,7 +144,7 @@ Future<T?> showCupertinoModalBottomSheet<T>({
return
result
;
}
class
CupertinoModalBottomSheetRoute
<
T
>
extends
Modal
Bottom
SheetRoute
<
T
>
{
class
CupertinoModalBottomSheetRoute
<
T
>
extends
ModalSheetRoute
<
T
>
{
final
Radius
topRadius
;
final
Curve
?
previousRouteAnimationCurve
;
...
...
modal_bottom_sheet/lib/src/bottom_sheets/material_bottom_sheet.dart
View file @
2e9afce
...
...
@@ -26,7 +26,7 @@ Future<T?> showMaterialModalBottomSheet<T>({
assert
(
debugCheckHasMediaQuery
(
context
));
assert
(
debugCheckHasMaterialLocalizations
(
context
));
final
result
=
await
Navigator
.
of
(
context
,
rootNavigator:
useRootNavigator
)
.
push
(
modal_bottom_sheet
.
Modal
Bottom
SheetRoute
<
T
>(
.
push
(
modal_bottom_sheet
.
ModalSheetRoute
<
T
>(
builder:
builder
,
closeProgressThreshold:
closeProgressThreshold
,
containerBuilder:
_materialContainerBuilder
(
...
...
modal_bottom_sheet/lib/src/material_with_modal_page_route.dart
View file @
2e9afce
...
...
@@ -19,7 +19,7 @@ class MaterialWithModalsPageRoute<T> extends MaterialPageRoute<T> {
builder:
builder
,
maintainState:
maintainState
);
modal_bottom_sheet
.
Modal
Bottom
SheetRoute
?
_nextModalRoute
;
modal_bottom_sheet
.
ModalSheetRoute
?
_nextModalRoute
;
@override
bool
canTransitionTo
(
TransitionRoute
<
dynamic
>
nextRoute
)
{
...
...
@@ -28,12 +28,12 @@ class MaterialWithModalsPageRoute<T> extends MaterialPageRoute<T> {
(
nextRoute
is
CupertinoPageRoute
&&
!
nextRoute
.
fullscreenDialog
)
||
(
nextRoute
is
MaterialWithModalsPageRoute
&&
!
nextRoute
.
fullscreenDialog
)
||
(
nextRoute
is
modal_bottom_sheet
.
Modal
Bottom
SheetRoute
);
(
nextRoute
is
modal_bottom_sheet
.
ModalSheetRoute
);
}
@override
void
didChangeNext
(
Route
?
nextRoute
)
{
if
(
nextRoute
is
modal_bottom_sheet
.
Modal
Bottom
SheetRoute
)
{
if
(
nextRoute
is
modal_bottom_sheet
.
ModalSheetRoute
)
{
_nextModalRoute
=
nextRoute
;
}
...
...
Please
register
or
login
to post a comment