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
Amarjeet Srivastava
2023-06-18 14:54:56 +0530
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-06-18 11:24:56 +0200
Commit
2005ba18e33bf29281f97cfe6335dd796c079a14
2005ba18
1 parent
09f4adcd
fixes (#353)
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
15 deletions
modal_bottom_sheet/lib/src/bottom_sheets/bar_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/lib/src/bottom_sheets/bar_bottom_sheet.dart
View file @
2005ba1
import
'dart:async'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
hide
ModalBottomSheetRoute
;
import
'package:flutter/services.dart'
;
import
'../../modal_bottom_sheet.dart'
as
modal_bottom_sheet
;
const
Radius
kDefaultBarTopRadius
=
Radius
.
circular
(
15
);
class
BarBottomSheet
extends
StatelessWidget
{
...
...
@@ -98,7 +96,7 @@ Future<T?> showBarModalBottomSheet<T>({
assert
(
debugCheckHasMediaQuery
(
context
));
assert
(
debugCheckHasMaterialLocalizations
(
context
));
final
result
=
await
Navigator
.
of
(
context
,
rootNavigator:
useRootNavigator
)
.
push
(
modal_bottom_sheet
.
Modal
SheetRoute
<
T
>(
.
push
(
ModalBottom
SheetRoute
<
T
>(
builder:
builder
,
bounce:
bounce
,
closeProgressThreshold:
closeProgressThreshold
,
...
...
modal_bottom_sheet/lib/src/bottom_sheets/material_bottom_sheet.dart
View file @
2005ba1
import
'package:flutter/material.dart'
;
import
'package:modal_bottom_sheet/modal_bottom_sheet.dart'
as
modal_bottom_sheet
;
import
'dart:async'
;
import
'package:flutter/material.dart'
hide
ModalBottomSheetRoute
;
import
'package:modal_bottom_sheet/modal_bottom_sheet.dart'
;
/// Shows a modal material design bottom sheet.
Future
<
T
?>
showMaterialModalBottomSheet
<
T
>({
required
BuildContext
context
,
...
...
@@ -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
SheetRoute
<
T
>(
.
push
(
ModalBottom
SheetRoute
<
T
>(
builder:
builder
,
closeProgressThreshold:
closeProgressThreshold
,
containerBuilder:
_materialContainerBuilder
(
...
...
@@ -52,8 +52,7 @@ Future<T?> showMaterialModalBottomSheet<T>({
}
//Default container builder is the Material Appearance
modal_bottom_sheet
.
WidgetWithChildBuilder
_materialContainerBuilder
(
BuildContext
context
,
WidgetWithChildBuilder
_materialContainerBuilder
(
BuildContext
context
,
{
Color
?
backgroundColor
,
double
?
elevation
,
ThemeData
?
theme
,
...
...
modal_bottom_sheet/lib/src/material_with_modal_page_route.dart
View file @
2005ba1
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
hide
ModalBottomSheetRoute
;
import
'../modal_bottom_sheet.dart'
as
modal_bottom_sheet
;
import
'../modal_bottom_sheet.dart'
;
import
'bottom_sheet_route.dart'
;
class
MaterialWithModalsPageRoute
<
T
>
extends
MaterialPageRoute
<
T
>
{
/// Construct a MaterialPageRoute whose contents are defined by [builder].
...
...
@@ -19,7 +20,7 @@ class MaterialWithModalsPageRoute<T> extends MaterialPageRoute<T> {
builder:
builder
,
maintainState:
maintainState
);
modal_bottom_sheet
.
Modal
SheetRoute
?
_nextModalRoute
;
ModalBottom
SheetRoute
?
_nextModalRoute
;
@override
bool
canTransitionTo
(
TransitionRoute
<
dynamic
>
nextRoute
)
{
...
...
@@ -28,12 +29,12 @@ class MaterialWithModalsPageRoute<T> extends MaterialPageRoute<T> {
(
nextRoute
is
CupertinoPageRoute
&&
!
nextRoute
.
fullscreenDialog
)
||
(
nextRoute
is
MaterialWithModalsPageRoute
&&
!
nextRoute
.
fullscreenDialog
)
||
(
nextRoute
is
modal_bottom_sheet
.
Modal
SheetRoute
);
(
nextRoute
is
ModalBottom
SheetRoute
);
}
@override
void
didChangeNext
(
Route
?
nextRoute
)
{
if
(
nextRoute
is
modal_bottom_sheet
.
Modal
SheetRoute
)
{
if
(
nextRoute
is
ModalBottom
SheetRoute
)
{
_nextModalRoute
=
nextRoute
;
}
...
...
@@ -41,6 +42,11 @@ class MaterialWithModalsPageRoute<T> extends MaterialPageRoute<T> {
}
@override
void
didPopNext
(
Route
nextRoute
)
{
super
.
didPopNext
(
nextRoute
);
}
@override
bool
didPop
(
T
?
result
)
{
_nextModalRoute
=
null
;
return
super
.
didPop
(
result
);
...
...
Please
register
or
login
to post a comment